View Single Post
Old 14-08-2009, 22:46   #31
danielf
cf.mega poser
 
danielf's Avatar
 
Join Date: Jun 2003
Posts: 16,687
danielf has a golden auradanielf has a golden auradanielf has a golden aura
danielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden auradanielf has a golden aura
Re: Programming Challenges?

Here's an interesting one, well I think it's interesting if only from a counter-intuitive statistical perspective.

The 'Monty Hall problem'.

Today's challenge (if you're interested) is to implement the conditions: there's a Ferrari hidden randomly behind one of 3 doors, and a goat behind the other two. You want the Ferrari. You choose one door, and the host then eliminates one of the goats (the host knows where the Ferrari is). So now there's two choices left. The statistical conundrum is: should you stick with your choice or change to the other door? Which one has the best odds?

Run the program in both conditions (switch/no switch) for a decent number of trials, and record the probabilities of getting the car.

You'll be surprised.

BTW: I've done this one before, and it really is quite simple. My code is about 30 lines, but a third of that is variable declaration and printing. It prints "Hello World" as well...
__________________
Remember kids: We are blessed with a listening, caring government.
danielf is offline   Reply With Quote