### Post by hydrophilic on Oct 12, 2015 8:16:56 GMT

I give you an interesting "paradox" in game theory which is demonstrated by vintage TV game show

This is a simple BASIC 7+ program for download: monty hall.bas (1.42 KB)

In case you are too busy/lazy to follow the previous links, let me give you a very quick summary:

You (the player) gets to choose 1 of 3 "doors" (or Quit). One of the doors is a "winner"; the other two are each a "looser". My PRG starts by telling you how much money ($) you have. The following assumes you do not Quit (you want to play)!

In my PRG, you spend $24 to play (because you did not Quit)... The PRG tells you how much money you have remaining after you choose to play.

After you make your choice (type 1,2,3 in the PRG), the "host" (Monty Hall) will give you a clue! One of the two options you did NOT pick will be revealed as a "looser".

At this point, there are still two "secret" values (un-opened doors). One of them is your original choice (shown as **), the other is the door NOT opened by Monty Hall (nor chosen by you), which is shown as "??"

Next, you have two options:

Finally, your choice is revealed! If it is a "looser" (1~10), then you loose (win nothing). If your choice is a "winner" (J!, Q!, or K!) then you win $71 or $50 (depending if you kept your original choice, or if you changed your choice, respectively).

After the win/loose is revealed, the game loops (choose 1,2,3 or Quit)

Good luck finding the best strategy!

I always found this Monty Hall "paradox" interesting, so I was curious to see how reliable the Commodore RND function worked... is it reliable? After playing several games, I am convinced RND works as expected from probability theory.

I hope some of you find it educational...

P.S. This is fairly simple BASIC code, but you would have to replace DO/LOOP and BEGIN/BEND structures if you want to port it to C64/Plus-4/VIC-20 (with nasty IF/THEN/GOTO spaghetti code). Also, Plus/4 allows ELSE, but for C64/VIC-20, additional spaghetti code would be required.

P.P.S. I noticed (after additional tests) that my (original) program favored initial choice < 3 ... I added "randomizer" to make initial choice (1~3) all equally likely.

*Let's Make A Deal*originally hosted by Monty Hall.This is a simple BASIC 7+ program for download: monty hall.bas (1.42 KB)

In case you are too busy/lazy to follow the previous links, let me give you a very quick summary:

You (the player) gets to choose 1 of 3 "doors" (or Quit). One of the doors is a "winner"; the other two are each a "looser". My PRG starts by telling you how much money ($) you have. The following assumes you do not Quit (you want to play)!

In my PRG, you spend $24 to play (because you did not Quit)... The PRG tells you how much money you have remaining after you choose to play.

After you make your choice (type 1,2,3 in the PRG), the "host" (Monty Hall) will give you a clue! One of the two options you did NOT pick will be revealed as a "looser".

At this point, there are still two "secret" values (un-opened doors). One of them is your original choice (shown as **), the other is the door NOT opened by Monty Hall (nor chosen by you), which is shown as "??"

Next, you have two options:

- Keep your original choice (if it is correct, you win $71)
- Change your choice (if the "other" choice is correct, you win $50)

Finally, your choice is revealed! If it is a "looser" (1~10), then you loose (win nothing). If your choice is a "winner" (J!, Q!, or K!) then you win $71 or $50 (depending if you kept your original choice, or if you changed your choice, respectively).

After the win/loose is revealed, the game loops (choose 1,2,3 or Quit)

**unless**you don't have enough money to play again, or if you won too many times and Monty Hall decides to "eject" you from the game.Good luck finding the best strategy!

I always found this Monty Hall "paradox" interesting, so I was curious to see how reliable the Commodore RND function worked... is it reliable? After playing several games, I am convinced RND works as expected from probability theory.

I hope some of you find it educational...

P.S. This is fairly simple BASIC code, but you would have to replace DO/LOOP and BEGIN/BEND structures if you want to port it to C64/Plus-4/VIC-20 (with nasty IF/THEN/GOTO spaghetti code). Also, Plus/4 allows ELSE, but for C64/VIC-20, additional spaghetti code would be required.

P.P.S. I noticed (after additional tests) that my (original) program favored initial choice < 3 ... I added "randomizer" to make initial choice (1~3) all equally likely.