Take the program “monty3.py” that you wrote for Homework #2 and add another method.
Specifically, if the contestant decides whether to change doors at random, how does that affect the probability of her winning?
To see this, write a third routing montyrandom() that randmly determined whether the contestant should change doors, returning the Boolean True if the contestant wins and False if not.
Then draw a third bar on the bar graph and label it appropriately.
The text output should be a third line that looks like this (again, your numbers may vary):
Randomly switching wins: 0.4975200 (49752 games)and your histogram like this:
Submit. Name your program “montyex.py” and submit it to the Extra Credit #2 area for this class on SmartSite.
|You can also obtain a PDF version of this.||Version of April 18, 2014 at 6:40AM|