There is a bag with balls numbered 1 to 9. Two players take turns at randomly taking a ball from the bag. If a player gets three balls that sum fifteen, he wins. Getting fifteen with more or less balls doesn't count.
What are the odds of the first player winning? Of a draw?
The following has a flaw somewhere that causes the total probability to add to more than 1. I can't find the mistake.
Assuming that as soon as someone has a subset of three of his numbers that adds to 15 he wins (there are no "last licks"), the only way of getting a tie is if neither player has a subset of three numbers that add to 15, since they can't both have such a subset. That means, in the case of ties, play has continued until all nine balls have been drawn. The first player will have five of them and the second player four. There are 16 ways, out of the 126 combinations of who has which balls, that neither player has a subset of three that add to 15:
first player second player
1 2 3 4 5 6 7 8 9
1 2 3 4 6 5 7 8 9
1 2 3 4 7 5 6 8 9
1 2 3 5 6 4 7 8 9
1 2 3 6 9 4 5 7 8
1 2 4 5 7 3 6 8 9
1 2 4 7 8 3 5 6 9
1 4 5 7 8 2 3 6 9
1 4 7 8 9 2 3 5 6
2 3 5 6 9 1 4 7 8
2 3 6 8 9 1 4 5 7
3 5 6 8 9 1 2 4 7
3 6 7 8 9 1 2 4 5
4 5 7 8 9 1 2 3 6
4 6 7 8 9 1 2 3 5
5 6 7 8 9 1 2 3 4
so there is probability 16/126 = 8/63 or about .126984126984127 that there will be a tie.
(from program:
FOR b1 = 1 TO 5
b(1) = b1
FOR b2 = b1 + 1 TO 6
b(2) = b2
FOR b3 = b2 + 1 TO 7
b(3) = b3
FOR b4 = b3 + 1 TO 8
b(4) = b4
FOR b5 = b4 + 1 TO 9
b(5) = b5
which = 1
FOR i = 1 TO 9
IF i <> b1 AND i <> b2 AND i <> b3 AND i <> b4 AND i <> b5 THEN
c(which) = i
which = which + 1
END IF
NEXT
hit = 0
FOR x1 = 1 TO 3
FOR x2 = x1 + 1 TO 4
FOR x3 = x2 + 1 TO 5
sum = b(x1) + b(x2) + b(x3)
IF sum = 15 THEN hit = 1
sum = c(x1) + c(x2) + c(x3)
IF sum = 15 AND x3 < 5 THEN hit = 1
NEXT
NEXT
NEXT
IF hit = 0 THEN
tie = tie + 1
PRINT b1; b2; b3; b4; b5; " "; c(1); c(2); c(3); c(4)
ELSE
END IF
total = total + 1
NEXT
NEXT
NEXT
NEXT
NEXT
PRINT tie, total
)
These are the combinations that add up to 15:
1 5 9
1 6 8
2 4 9
2 5 8
2 6 7
3 4 8
3 5 7
4 5 6
If the first player gets any of these 8 combinations, out of the 84 possible combinations, on his first three draws, he wins, for a probability of 8/84 = 2/21 or about 0.095238095238095.
Out of the 1680 ways that the first three for player 1 and the first 3 for player 2 can be allocated, 148 result in a win for player 2, for a probability of 148/1680 = 37/420 or about 0.0880952380952380952.
Out of the 1260 ways that the first four for player 1 and the first 3 for player 2 can be allocated, 350 result in a win for player 1 at the draw of his ball 4 and not sooner, for a probability of 350/1260 = 5/18 or about 0.2777777777777777778.
Of the 630 ways that four balls could be divided between the two players, 130 result in a win for the second player at the taking of his fourth ball, for a probability of 130/630 = 13/63 or about 0.2063492063492063491.
Of the 126 ways of allocating 5 balls to player 1 and 4 to player 2, 29 provide a win for player 1 on his last selection, for a probability of 29/126 or about 0.2301587301587301586.
The sum of the winning probabilities for player one comes out to .603174603174603. For player 2 it comes out to 0.294444444444444
But the above totals add to 1.024603174603174not good for a probability.
The program that typifies the calculations done (this version is for a win by player 1 on exactly the 5th try) is:
FOR n1 = 1 TO 5
FOR n2 = n1 + 1 TO 6
FOR n3 = n2 + 1 TO 7
FOR n4 = n3 + 1 TO 8
FOR n5 = n4 + 1 TO 9
FOR c1 = 1 TO 6
IF c1 <> n1 AND c1 <> n2 AND c1 <> n3 AND c1 <> n4 AND c1 <> n5 THEN
FOR c2 = c1 + 1 TO 7
IF c2 <> n1 AND c2 <> n2 AND c2 <> n3 AND c2 <> n4 AND c2 <> n5 THEN
FOR c3 = c2 + 1 TO 8
IF c3 <> n1 AND c3 <> n2 AND c3 <> n3 AND c3 <> n4 AND c3 <> n5 THEN
FOR c4 = c3 + 1 TO 9
IF c4 <> n1 AND c4 <> n2 AND c4 <> n3 AND c4 <> n4 AND c4 <> n5 THEN
IF n1 + n2 + n3 <> 15 THEN
IF c1 + c2 + c3 <> 15 THEN
IF n1 + n4 + n3 <> 15 AND n1 + n2 + n4 <> 15 AND n4 + n2 + n3 <> 15 THEN
IF c1 + c4 + c3 <> 15 AND c1 + c2 + c4 <> 15 AND c4 + c2 + c3 <> 15 THEN
IF n1 + n5 + n3 = 15 OR n1 + n2 + n5 = 15 OR n5 + n2 + n3 = 15 OR n4 + n5 + n1 = 15 OR n4 + n2 + n5 = 15 OR n5 + n4 + n3 = 15 THEN
PRINT n1; n2; n3; n4; n5; " "; c1; c2; c3; c4
ct = ct + 1
END IF
END IF
END IF
END IF
END IF
tot = tot + 1
END IF
NEXT
END IF
NEXT
END IF
NEXT
END IF
NEXT
NEXT
NEXT
NEXT
NEXT
NEXT
PRINT ct, tot

Posted by Charlie
on 20050324 14:51:38 