The only way to know the total number of balls is to have them counted or have that information given to you. Lets call this number N. You can find the experimental probability of finding a black ball by, say, pulling balls out of a bag which contains them all. You count how many balls you take in total (lets call this number S, the sample size) and also how many are black balls we get (call that B). The experimental probability is given by P=B/S, the fraction of balls which are black. The total number of black balls can be found by taking N*P, as long as the number of balls S you sampled is large enough.