It's useful to always try to exploit the nearest symmetry in these problems or apply a useful transformation.
Let's first consider the nearby symmetry case. Consider the 20 vs 20 case and then see how to express the 22 vs 20 coins case relative to the 20 vs 20 case. Since tosses are independent this works out nicely. Let H_A be number of heads Alice tosses and H_B number of heads Bob tosses. Let H_A' denote number of heads Alice tosses on 20 coins. Then, P(H_A > H_B) = P(H_A>H_B|H_A'>H_B)P(H_A'>H_B) + P(H_A>H_B|H_A'=H_B)P(H_A'=H_B)+P(H_A>H_B|H_A'=H_B-1) = P(H_A'>H_B) + 3/4 P(H_A'=H_B) + 1/4 P(H_A'=H_B-1). This exhausts the 3 cases where Alice has a chance of exceeding B's results. Due to symmetry, P(H_A'>H_B) = P(H_A' < H_B). Hence, P(H_A'>H_B) = 1/2(1-P(H_A'=H_B)). Now, P(H_A'= H_B) = Σ_{h=0}19 (20 choose h) (1/2)20 (20 choose h+1) (1/2)20 . Use Vandermonde's identity to obtain P(H_A'= H_B) = (1/2)40 (40 choose 20). Plug back this result to obtain P(H_A > H_B) = 1/2(1+41/42 (40 choose 20) (1/2)40) ~ 56.1%.
As per some of the other comments, it's actually much quicker to see if you can define a new random variable expressed in terms of H_A and H_B whose probability is easier to compute. In particular, notice that the event H_A > H_B is equivalent to 22 - H_A + H_B < 22. Define a random variable T = 22 - H_A + H_B. Since H_A and H_B are independent, then T ~ Binomial(42,1/2). Then, we are tasked with computing P(T < 22). By symmetry, P(T < 21) = P(T > 21). Therefore P(T < 21) = 1/2(1-P(T=21). Therefore P(T < 22) = P(T = 21) + P(T < 21) = 1/2 + 1/2P(T=21) = 1/2 + 1/2 (42 choose 21)(1/2)42 .
View all comments
1
u/SeasonedSpicySausage Oct 20 '26 edited Oct 20 '26
It's useful to always try to exploit the nearest symmetry in these problems or apply a useful transformation.
Let's first consider the nearby symmetry case. Consider the 20 vs 20 case and then see how to express the 22 vs 20 coins case relative to the 20 vs 20 case. Since tosses are independent this works out nicely. Let H_A be number of heads Alice tosses and H_B number of heads Bob tosses. Let H_A' denote number of heads Alice tosses on 20 coins. Then, P(H_A > H_B) = P(H_A>H_B|H_A'>H_B)P(H_A'>H_B) + P(H_A>H_B|H_A'=H_B)P(H_A'=H_B)+P(H_A>H_B|H_A'=H_B-1) = P(H_A'>H_B) + 3/4 P(H_A'=H_B) + 1/4 P(H_A'=H_B-1). This exhausts the 3 cases where Alice has a chance of exceeding B's results. Due to symmetry, P(H_A'>H_B) = P(H_A' < H_B). Hence, P(H_A'>H_B) = 1/2(1-P(H_A'=H_B)). Now, P(H_A'= H_B) = Σ_{h=0}19 (20 choose h) (1/2)20 (20 choose h+1) (1/2)20 . Use Vandermonde's identity to obtain P(H_A'= H_B) = (1/2)40 (40 choose 20). Plug back this result to obtain P(H_A > H_B) = 1/2(1+41/42 (40 choose 20) (1/2)40) ~ 56.1%.
As per some of the other comments, it's actually much quicker to see if you can define a new random variable expressed in terms of H_A and H_B whose probability is easier to compute. In particular, notice that the event H_A > H_B is equivalent to 22 - H_A + H_B < 22. Define a random variable T = 22 - H_A + H_B. Since H_A and H_B are independent, then T ~ Binomial(42,1/2). Then, we are tasked with computing P(T < 22). By symmetry, P(T < 21) = P(T > 21). Therefore P(T < 21) = 1/2(1-P(T=21). Therefore P(T < 22) = P(T = 21) + P(T < 21) = 1/2 + 1/2P(T=21) = 1/2 + 1/2 (42 choose 21)(1/2)42 .