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
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.)
Step by Step Solution
There are 3 Steps involved in it
To achieve this you can create two Python files Piepy and HW1SP21Prob2py and implement the required ... View full answer
Get step-by-step solutions from verified subject matter experts
