Wednesday, 20 April 2011

What if Alice used Java?

There was a cool puzzle posted on xkcd blag not so long ago. Well, it was actually more than a year ago... Anyway, the puzzle goes like this:
Alice secretly picks two different real numbers by an unknown process and puts them in two (abstract) envelopes. Bob chooses one of the two envelopes randomly (with a fair coin toss), and shows you the number in that envelope. You must now guess whether the number in the other, closed envelope is larger or smaller than the one you’ve seen.

Is there a strategy which gives you a better than 50% chance of guessing correctly, no matter what procedure Alice used to pick her numbers?
I decided to check what would happen if the unknown and mysterious process of Alice was in fact Java pseudo-random generator.

Monday, 11 April 2011

[PL] Paradoks Monty'ego Halla

W odpowiedzi na dyskusję, która pojawiła się pod pytaniem o wybór bramki w paradoksie Monty'ego Halla, postanowiłem napisać notkę, która dokładniej tłumaczyłaby ideę paradoksu.

Ale najpierw przedstawię oryginalny problem. Sprawa ma się tak:
Zawodnik stoi przed trzema zasłoniętymi bramkami. Za jedną z nich (za którą – wie to tylko prowadzący program) jest nagroda (umieszczana całkowicie losowo). Gracz wybiera jedną z bramek. Prowadzący program odsłania inną bramkę (co istotne – anonsując, że jest to bramka pusta), po czym proponuje graczowi zmianę wyboru. (źródło: Wikipedia) 
Pytanie brzmi: czy zawodnik zyskuje coś przez zmianę bramki?