Extra Credit 2

Due: February 1, 2019
Points: 20


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:

Histogram for extra credit 2

Submit. Name your program “montyex.py” and submit it to the Extra Credit 2 area for this class on Canvas.


You can also obtain a PDF version of this. Version of January 19, 2019 at 5:05PM