
Posted by Moby Dick
![]()
on 22/9/2009, 10:23 am, in reply to "My favorite probability puzzle of all time."
I thought that there might be a solution in Bob varying his second pick depending on what he found in his first pick - but I am still unable to improve upon a probability of 1/2.
Here's my program:
( /* if Bob nae picks car, his next pick is the index of what he did pick in list "Bob" + 1 */
ckg: permutations({c,k,g}),
kg: permutations({k,g}),
for Bob in kg do (
for Alice in powerset({1, 2, 3},2) do (
tries: 0,
wins: 0,
for perm in ckg do (
tries: tries + 1,
if (perm[1] = c) then
wins: wins + AliceWin(Alice)
else
for i: 1 thru 2 do
if Bob[ i ] = perm[1] then
if (perm[i + 1] = c) then
wins: wins + AliceWin(Alice)
),
if (wins / tries > 1/2) then
print("Probability", wins / tries, "achieved with Bob set to", Bob, "and Alice set to", Alice)
)
)
);
...and here's the output:
Probability 1/2 achieved with Bob set to [g,k] and Alice set to {1,3}
Probability 1/2 achieved with Bob set to [g,k] and Alice set to {2,3}
Probability 1/2 achieved with Bob set to [k,g] and Alice set to {1,2}
Probability 1/2 achieved with Bob set to [k,g] and Alice set to {2,3}


Message Thread:
![]()
« Back to thread