Question: Problem 2. using sage math Write a Sage function Simulation(), which can simulate 1 million drawings by calling the function MegaMillions() from Problem 1 within
Problem 2. using sage math
Write a Sage function Simulation(), which can simulate 1 million drawings by calling the function MegaMillions() from Problem 1 within its own definition. In addition, consider that a player chose to play numbers [4, 26, 42, 50, 60, [24]]. Among the 1 million drawings, make the function Simulation() print how the often the following combinations occurred:
[4, [24]]
[4, 26, [24]]
[4, 26, 42, [24]]
[4, 26, 42, 50, [24]]
[4, 26, 42, 50, 60, [24]]
The printout format is up to you but you can make it appear like this:
[4, [24]] : 10
[4, 26, [24]] : 20
[4, 26, 42, [24]] : 30
[4, 26, 42, 50, [24]] : 40
[4, 26, 42, 50, 60, [24]]: 50
The given occurrence counts 10, 20, 30, 40, 50, are hypothetical and serve only as an example. In general, the output format is not important but the counts are!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
