Now that we can roll a single pie, we want to see the probabilities of rolling any
Question:
Now that we can roll a single pie, we want to see the probabilities of rolling any possible number when we have N pice rolled simultaneously.
To Do:
1. Write a new python file called Pice.py that imports rollFairPie and rollUnFairPie from Pie.py and includes a function called rollPice(N=1), where N is a keyword argument that specifies the number of pice to be rolled. rollPice should call rollFairPie N times and return the total score by summing the score of each pie.
2. In a separate file called HW1SP21_Prob2.py, write and call a main() function that specifies the number of pice (n) and calls the function rollPice(N=n) 1000 times and then outputs the probability for each possible score to the screen as:
Probability of rolling a 3: 0.xxx
Etc.
(note: for 3 pice, min score =3, max score =18, for 4 pice, min score = 4, max score = 24, etc.)
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill