Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for C++ Let's make a dealgame _ game showcase first choose a door then Monty Hall shows you a door you did not choose. You

image text in transcribed

for C++

Let's make a dealgame _ game showcase first choose a door then Monty Hall shows you a door you did not choose. You chose 1 and Monty showed door 2(which has a goat) Consider criteria for shown door (pseudocode) X-0; Shown -1; Do x+t: If (x!-chosen) && (x -winning) Shown x; While (x !- shown) Should switch to door 3 or stay with door 1? borrow a function rand() from borrow time from srand(time()) srand(1) rand()- an integer from 0 to 65375 rand number is uniformly distributed - all values are equally likely over time rand()%6+1 standard die 6 unit of probability equally likely add 1 for fun compare how many successes if we stay vs when we switch output is prob of prize from staying vs switching input from user is door chosen computer has to show a non winning door test whether staying is better than switching run it 1000's of time Loop- For loop 1000, 10,000 100,000 trials Let's make a dealgame _ game showcase first choose a door then Monty Hall shows you a door you did not choose. You chose 1 and Monty showed door 2(which has a goat) Consider criteria for shown door (pseudocode) X-0; Shown -1; Do x+t: If (x!-chosen) && (x -winning) Shown x; While (x !- shown) Should switch to door 3 or stay with door 1? borrow a function rand() from borrow time from srand(time()) srand(1) rand()- an integer from 0 to 65375 rand number is uniformly distributed - all values are equally likely over time rand()%6+1 standard die 6 unit of probability equally likely add 1 for fun compare how many successes if we stay vs when we switch output is prob of prize from staying vs switching input from user is door chosen computer has to show a non winning door test whether staying is better than switching run it 1000's of time Loop- For loop 1000, 10,000 100,000 trials

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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions