Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Any help with this? Heres my function for lotteryPick(M): import random #allows Python to pick random numbers def lotteryNum(M): #defining the function lotteryPick=[] #Stores the

Any help with this?

image text in transcribed

Heres my function for lotteryPick(M):

import random #allows Python to pick random numbers

def lotteryNum(M): #defining the function lotteryPick=[] #Stores the lottery numbers if M=5: #if they are greater or equal to 5, lottery sample will pick through the range lotteryPick= random.sample(range(1,M+1),5) return lotteryPick

Lottery games award players for money if they are able to match two, three four or five integers from integers selected at random in a range 1 to M (inclusive of M). Design a well-documented, Python main program that uses the function lotteryPick(M) to estimate the probability of winning a lottery game in the range 1 to M (inclusive of M) by repeating the lottery game 10N trials. Ask the user for the value of N as a prompt in your program lottery2.py. To estimate the probability of winning with only one match, for example, have your code count the number of times one match is found in 10 trials and divide it by the number of trials. Lottery games award players for money if they are able to match two, three four or five integers from integers selected at random in a range 1 to M (inclusive of M). Design a well-documented, Python main program that uses the function lotteryPick(M) to estimate the probability of winning a lottery game in the range 1 to M (inclusive of M) by repeating the lottery game 10N trials. Ask the user for the value of N as a prompt in your program lottery2.py. To estimate the probability of winning with only one match, for example, have your code count the number of times one match is found in 10 trials and divide it by the number of trials

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 Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Create a Fishbone diagram with the problem being coal "mine safety

Answered: 1 week ago