Question: needing help with Python code writing! Problem 1: A game of chance, rolling a single die In the development of probability theory that underpins much

needing help with Python code writing!
needing help with Python code writing! Problem 1: A game of chance,

Problem 1: A game of chance, rolling a single die In the development of probability theory that underpins much of statistics, the roll of a "fair die" is often cited as a key concept. We want to write a simple program that utilizes a random number generator to mimic the behavior of a fair die. To Do: 1. Create a file called myModule.py in PyCharm. 2. Create a function called rollDie() that takes no arguments and returns an integer between 1 and 6 inclusively, but at random each time the function is called. 3. In a separate file called HW1SP22_Probl.py, write a main() function that imports myModule and calls rollDie() 1000 times and tabulates the fraction of rolls that yield 1, 2, 3, etc. Output the probability of each of the possible number to the screen as: Probability of rolling a 1: 0.1667 Probability of rolling a 2: 0.1668 Etc. Do these probabilities match the theory? If not, see what happens if we roll the die 10,000 times

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!