Confusion regarding the interpretation of probability in this example
This might sound like a stupid question, but please bear with me.
Suppose I have $N$ balls of different colours in a bag, and I want to know the number of blue balls. What I do is, pick up a single ball, and find the probability of that ball being blue. Then I multiply this probability with the total number of balls, to get the number of blue balls.
Suppose I get $n$ blue balls after doing this.
But now I want to check the probability of all $n$ balls to be blue. In the previous question, it is established that there are $n$ blue balls. So the probability of all these balls to be blue is obviously $1$, as this is a yes or no question.
However, I can check this by doing the following : I check the probability of the first ball being blue, then multiply the probability of the second ball being blue, then the third, and go on, till I reach the probability that the $n$th ball is blue. I multiply all these numbers to get an answer which is obviously not equal to $1$.
This second method is the way we do the sum, but why is my earlier method wrong? It is clear I'm having some trouble understanding and interpreting probability. Any help regarding this would be much appreciated.
EDIT :
Suppose, by performing the experiment multiple times I've found the probability of getting a certain number of blue balls. I multiply this with the total number of balls in the bag, to get the expectation value of the number of blue balls in the bag.
However, say, the expectation value is $17$ as in the comments. What is the probability now, that there are actually $17$ blue balls in the bag. Something along the lines of what is the probability of obtaining the expectation value ?
Is it given by : $$P(\langle\space blue\rangle )=\frac{^{17}C_{17}}{^{100}C_{17}}$$
However, suppose we have carried out the trial thousands of times, and found that blue ball comes up $17$ percent of the time, shouldn't the expectation value converge more and more towards the actual value. In that case, the probability of getting exactly 17 blue balls out of hundred should be one, right ?
Solution 1:
Suppose the ratio of blue balls to the total is $p$. The probability that exactly $k$ blue balls are picked up in $n$ trials follows the binomial distribution, i.e.
$P_r(k,n,p)=\binom{n}{k}p^k(1-p)^{(n-k)}$.
Now what you want to do is to estimate $p$ based on observations of $n$ and $k$.
Strictly speaking, in general it is impossible to know the exact value of $p$ by sampling (except to check every ball's colour in the bag). What we can get is an estimate of a range (i.e. confidence interval) of $p$ with a certain confidence level.
For instance, if 17 blue balls are picked in 100 trials, the estimated $p$ is 0.17, associated with a 95% confidence interval (CI) of [0.1022, 0.2582]. It means that we have 95% confidence to believe that $p$ is within this range.
On the other hand, if 170 balls are picked in 1000 trials, the estimated $p$ is still 0.17, but the 95% CI is [0.1472, 0.1947].
There are various methods to calculate the confidence interval of binomial distribution. Matlab has a function called 'binofit.m' to do this.