Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*simulate a monty hall problem in python. Recall the Monty Hall problem. The game show host Monty Hall shows you 3 doors: 2 doors contain

*simulate a monty hall problem in python.

Recall the Monty Hall problem. The game show host Monty Hall shows you 3 doors: 2 doors contain nothing

and 1 door contains a prize. Monty asks you to choose a door. You choose a door. Monty then opens one

of the doors you didnt open, which you see does not contain the prize. (Monty always opens a non-prize

door.) He now asks you whether youd like to switch your door. Should you switch?

In a Monte Carlo simulation, you perform a trial of several experiments, analyze the quality of the trial, and

repeat the batch of trials with a larger sample size if the quality is lower than you want.

-create three functions:

-one function that finds the door monty will open

-another function that finds the door the contestant could switch to

-one last function that is the monty hall experiment:

experiment steps:

Choose the prize door randomly and uniformly over [1,2,3].

Choose your door randomly and uniformly over [1,2,3].

Monty Hall chooses the door that is not the prize door and not your door.

You may or may not switch to the remaining door.

With the never-switch policy, you never switch.

With the always-switch policy, you always switch.

With the random-switch policy, you flip a fair coin to decide if you switch.

The experiment yields an answer: did you win the prize?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions