Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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) 1

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions