I am working with binomial distribution and understand how I can compute probabilities of a particular number of heads or tails in a sequence of coin tosses. I can also use the distribution to find the number of coin tosses for k heads or tails using the distribution. But I want to compute the conditional probability that the r-th trial is a head given that there are k heads, regardless of what the prev and consequent trial outcomes are in a sequence of n coin tosses. The way I am computing is that there are r-1 tosses before and n - r tosses after. The conditional probability for any possible combination for these two blocks will be 1/(r-1)C0*(n-r)C(k-1) + 1/(r-1)C1*(n-r)C(k-2) + … + 1/(r-1)C(k-1)*(n-r)C0. Because I fix the r-th position as a head and find the different possibilities of the remaining k-1 heads distributed among the two blocks. Does this make sense or is there a more cleaner way of doing this?
2 Answers
Without any real computing, we can work out the expected number of heads on the $r^\text{th}$ trial conditional on $k$ total heads.
Simply notice the answer must be the same for each trial (because of independence among the trials, which means they are exchangeable) and that the sum of all these conditional expectations (over $r=1,2,\ldots, n$) equals the number of heads, $k,$ whence the answer is $k/n.$ But the conditional expectation equals the conditional probability, QED.
For a simple combinatorial solution in the spirit of the answer suggested in the question, observe there are $\binom{n}{k}$ equally probable ways to distribute $k$ heads among $n$ trials and $\binom{n-1}{k}$ ways to distribute $k$ heads among all the trials except trial $r.$ (This neatly sidesteps the attempted decomposition into numbers of heads before and after trial $r.$) Therefore the conditional probability of heads at trial $r$ is the proportion of all configurations in which the latter situation does not happen, equal to
$$1 - \frac{\binom{n-1}{k}}{\binom{n}{k}} = 1 - \frac{n-k}{n} = \frac{k}{n}.$$
Finally, here is an easy no-arbitrage solution. At the casino, allow customers to place bets on any trial they choose (before any trials are carried out). The game consists of randomly selecting $k$ of the trials as "winners." (Imagine a roulette wheel with $n$ slots using $k$ balls at a time.) If the casino takes no vigorish, the total payout to the winners is the total of all bets.
Since all trials are equally likely to be winners, the value of any particular bet $X$ can be found by spreading that bet equally across all $n$ trials, betting $X/n$ on each trial.
That's the setup. Here is the analysis: Exactly $k$ of those bets will be winners and the total take is the total bet $X,$ whence a win pays $n/k$ times the amount bet. That means the odds are $k:(n-k),$ equal to a probability of $k/n.$
-
$\begingroup$ Thanks for the responses. The reason I tried to separate the before and after blocks was also because I’m considering the case that the coin toss is not fair. I forgot to mention this in the question. Does this change the analysis? $\endgroup$ Commented Dec 13, 2023 at 17:22
-
5$\begingroup$ It doesn't change the methods at all -- and it turns out the answer doesn't change either! The point is that by the time you condition on $k$ heads, it doesn't matter how unusual getting $k$ heads might have been. As any of these solutions demonstrates, the answer relies solely on the exchangeability of the trials conditional on the number of heads. What would change the method, and perhaps compel us to use your more detailed analysis, would be when the chances are different from trial to trial (but still known). But that would be very messy. $\endgroup$– whuber ♦Commented Dec 13, 2023 at 17:24
You're conditioning on there being $k$ heads in $n$ trials. If you pick any one trial at random, the probability that it is a head is just $k/n$.
There are lots of different ways to see this. For example, there are ${n \choose k}$ possible arrangements of the $k$ heads, all of which are equally likely. If we force the $r$th trial to be a head (assuming $k>1$), there are ${n-1 \choose k-1}$ to arrange the remaining $k-1$ heads.
The probability we want is, thus, ${n-1 \choose k-1} / {n \choose k} = k/n$.
-
2$\begingroup$ But (n-1)C(k-1) would also be the possibilities regardless of heads in the r-th position (it could be in 1st or 2nd or any other position) right? So I am not clear on how to fix the position outcome, which is why I separated the sequence into two blocks prior and after the r-th trial $\endgroup$ Commented Dec 13, 2023 at 16:26
-
1$\begingroup$ That's correct. The probability of heads in the 1st, or 2nd, ..., or $n$th trial are all equal to $k/n$. $\endgroup$ Commented Dec 13, 2023 at 18:08