Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: A Rebol Challenge. The Monty Hall Puzzle

From: sunandadh:aol at: 16-Dec-2001 14:18

Hi Patrick,
> Your work is brilliant ! It helps me to get to the problem, and finally my > 17 years'old son explained it to me. If you consider that each time I loose > I did not win, the answer can be shorten a bit.
Thanks,
> rebol[] > win: 100 print ["Win% = " loop win [ win: win - first random [0 0 1]]] > > It is a beat cheatting considering that your version iterate 500 times so I > give also my 1000 iterations version. > > rebol[] > win: 1000 print ["Win% = " (loop win [ win: win - first random [0 0 1]]) / > 10] > > These are respectively 43 and 51 bytes long.
Good stuff! Your solutions embody the logic that : 1. If I stick with what I've got, I've a 1/3rd chance of winning 2. Therefore Monty has a 2/3 chance of having the car 3. But Monty has shown me an empty door, So, if Monty has the car it MUST be behind the door he didn't open. 4. Therefore I'll take that unopened door and win 2/3s of the time Given we all accept that logic, that, we could shorten the puzzle even more: Print ["Win% " 200 / 3] <g!> The problem being that not everyone does accept that logic at first view. So, to be fair, we need code that runs a fair emulation of making a choice. Sunanda