Monty Hall Simulation - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: Monty Hall Simulation (/showthread.php?tid=773) Pages:
1
2
|
Monty Hall Simulation - dcromley - 08-16-2022 Quote:>> I wrote: (https://qb64phoenix.com/forum/showthread.php?tid=762&pid=5250#pid5250): Quote:>> @Jack wrote: Thanks for the challenge. The classic 'Monty Hall' problem is interesting: (from https://en.wikipedia.org/wiki/Monty_Hall_problem) Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say #1. The host opens another door, say door #3, which has a goat. He then says to you, 'Do you want to change your pick to door #2?' Is it to your advantage to switch your choice? If you "stick" (don't switch), the probability is simple: P(win) = P(choice is car) = 1/3 If you "switch": P(win) = P(choice is not the car) = 2/3 because the host will then open the other non-car door and offer you the third door, which has to have the car. But that's just MY take. There has been enormous discussion on the subject. Hit the link above for a BIG read. This program simulates many trials of the Monty Hall "problem". It pretty much confirms the 1/3 - 2/3 probabilities. Code: (Select All) _Title "Monty Hall Simulator" ' dcromley RE: Monty Hall Simulation - bplus - 08-16-2022 The odds after host opens 1 door is 50:50 if you choose to switch doors, certainly not 2/3! But the choice to switch doors is the one to pick because the odds of picking from 3 doors is 1/3 for grand prize at start, now improved to 1/2 after one door removed. I ran the sim years ago. RE: Monty Hall Simulation - SMcNeill - 08-16-2022 (08-16-2022, 04:23 PM)bplus Wrote: The odds after host opens 1 door is 50:50 if you choose to switch doors, certainly not 2/3! But the choice to switch doors is the one to pick because the odds of picking from 3 doors is 1/3 for grand prize at start, now improved to 1/2 after one door removed. I ran the sim years ago. It's not. The odds are 1/3 you picked the right door and 2/3 you picked the wrong door -- and they stay those odds for the whole game. Something is behind door 1, 2, or 3. You choose 1. There's a 1 in 3 chance you guessed right. 2 in 3 you guessed wrong. I tell you, it's not in door #3. Do you want to swap to Door #2? What's your odds?? Just as they were before: 1 in 3 that you guessed right. 2 in 3 you guessed wrong. Switch to Door #2 and you have twice the chance to win as in Door #1. RE: Monty Hall Simulation - bplus - 08-16-2022 Yeah I just ran a sim again either the First Picker wins or the Switcher wins. If the First Picker wins 1/3 then the Switcher wins 2/3 the time! Man 2/3 the time is a shocker! I thought it only improved odds by 1/6th to 50/50 but no, I was wrong, Here is my sim that I used to prove to myself: Code: (Select All) Option _Explicit RE: Monty Hall Simulation - SMcNeill - 08-16-2022 Here's my sim: Code: (Select All) Dim door(1 To 3) RE: Monty Hall Simulation - bplus - 08-16-2022 Wait... the Switcher is only going to win 1/2 the time against the show and get the car or other Grand Prize. 1/2 is better than 1/3 but switcher won't win 2/3 the time. Eh, no when a door is opened odds are 50:50 to get it right but first picker is stuck with their choice 1/3 chance, so Switcher takes up slack 2/3's. So show wins 2/3 of time against a First picker and 1/3 time against a Switcher. RE: Monty Hall Simulation - SMcNeill - 08-16-2022 (08-16-2022, 05:09 PM)bplus Wrote: Wait... the Switcher is only going to win 1/2 the time against the show and get the car or other Grand Prize. The switcher wins 2/3 of the time. We just showed that with the simulation runs. RE: Monty Hall Simulation - bplus - 08-16-2022 Yeah I appended to that post a correction, somewhere I had in my memory the show wins 50% or 50% was a relevant consideration. Maybe the First picker wins 50% less than Switcher. RE: Monty Hall Simulation - SMcNeill - 08-16-2022 Here's one to think about: The state lottery makes a mistake and prints 10 scratch-off lottery tickets. One of them has a $1,000,000 prize to it, the rest are losers. Hearing the news, you quickly run down to the local store and buy they only ticket they have for $1000. Too nervous to scratch it off, you stick it in your pocket and go to work. During your shift, the state rushes out and manages to buy up 8 of the remaining tickets. Scratching them they confirm they're all losers. Now, what's the chance your ticket is a winner?? If your neighbor somehow bought the other ticket, and wanted to trade, would your odds be better or worse by trading? RE: Monty Hall Simulation - Jack - 08-16-2022 "Now, what's the chance your ticket is a winner" easy, 50% |