Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with python coding Show all work and steps Problem 2: Rolling dice Now that we can roll a single die, we want to

Need help with python coding
Show all work and steps
image text in transcribed
Problem 2: Rolling dice Now that we can roll a single die, we want to sce the probabilities of rolling any possible number when we have N dice rolled simultaneously. To Do: 1. Write a new python file called Dice.py that imports rollFa irDie and rollun Fa ir Die from Die.py and includes a function called ro11 Dice (N=1), where N is a keyword argument that specifies the number of dice to be rolled. rolli Dice should call ro 11Fa i Di NN times and return the total score by summing the score of each die. 2. In a separate file called HW1SP23_Prob2.py, write and call a main () function that specifies the number of dice (n) and calls the function rollDice (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 dice, min score =3,max score =18, for 4 dice, min score =4,max score =24, etc.) Problem 3: A continuous random variable Description: To simulate real-world behavior of systems, we often must produce normally distributed values for a property of a system (e.g., the average mass of a pebble in a pile of gravel). Here, you must produce a program that yields an array of data that is normally distributed around a specified mean () and standard deviation (). (Note: if I use a random number generator to produce a uniformly distributed value between 0 and 1 , we can use this value as the dependent variable on a cumulative distribution function and find the independent variable value (x) corresponding to this probability. The values of x will be normally distributed.) Your program should output an array of size N drawn from normally distributed population. You should do this work in a file called HW1SP23_Prob3.py Hint: from the module random, you should investigate the use of the function norma lvariate()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions