Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use Python (A) Write a function 'rolling_ dice()' which simulates the rolling of two dice (discrete values 1 to 6) and . accepts two input
use Python
(A) Write a function 'rolling_ dice()' which simulates the rolling of two dice (discrete values 1 to 6) and . accepts two input values of o the number of throws and o the face value of the requested double throw, i.e. double six or four etc. Limit the number of throws to a maximum of 1 million (return None if over limit). . Counts the number of a given double throvw. Return the value of your counter. (B) Write a test function 'test throw) with identical input parameters to rolling_dice() which . filters non-sensical input (no face higher than 6 on a die, wrong type of the input parameter etc.), calls the 'rolling_dice( function and . receives the number of counts and divides it by the the number of attempts Increasing the number of throws should yield closer and closer results to the probability of 1/36 for a double throw Answer: (penalty regime 10, 20, 96) 1Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started