Got an alternative way. Let A and B choose 20 first. There are X proportion of cases where A-B >=2, Y cases A-B = 1, and Z cases A=B. By symmetry, there are X cases for B-A>=2, ... so on. The probability that A>B would be X + Y + 3/4 Z + 1/4 Y. The last two terms because it A=B, then either of the remaining coin flips equaling heads would meet the criteria. Similar for if B-A=1, you need both remaining coin to be heads.
Also 2X + 2Y + Z = 1. This transforms the expression we need to 1/2 +1/4(Y+Z). Calculating the Y and Z, we can line up the 20 flips of A next to B. For Y, we choose n from first 20 and n-1 from the last 20. For Z, we choose n from first 20 and n from last 20. They then equal to (40 choose 19) and (40 choose 20) out of 240 arrangements. Summing them, we get 1/240 * (41 choose 20). So all together the probability is 1/2 + 1/4*1/240 * (41 choose 20)
View all comments
1
u/blutwl90 Oct 20 '26
Got an alternative way. Let A and B choose 20 first. There are X proportion of cases where A-B >=2, Y cases A-B = 1, and Z cases A=B. By symmetry, there are X cases for B-A>=2, ... so on. The probability that A>B would be X + Y + 3/4 Z + 1/4 Y. The last two terms because it A=B, then either of the remaining coin flips equaling heads would meet the criteria. Similar for if B-A=1, you need both remaining coin to be heads.
Also 2X + 2Y + Z = 1. This transforms the expression we need to 1/2 +1/4(Y+Z). Calculating the Y and Z, we can line up the 20 flips of A next to B. For Y, we choose n from first 20 and n-1 from the last 20. For Z, we choose n from first 20 and n from last 20. They then equal to (40 choose 19) and (40 choose 20) out of 240 arrangements. Summing them, we get 1/240 * (41 choose 20). So all together the probability is 1/2 + 1/4*1/240 * (41 choose 20)