Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can you modify this code? I need it To estimate the probability of winning with only one match, for example, have your code count the

Can you modify this code? I need it 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 10N trials and divide it by the number of trials.

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

def main(): #sets a new function M=1 N=5 while M

image text in transcribed

import random #allows Python to pick random numbers def lotteryNum (M): #de fining the function lotteryPickz[] #Stores the lottery numbers if M-5: #if they are greater or equal to 5, lottery sample will pick through the range return lotteryPick print ("Error, number must be a5") #Asked to have numbers greater than 5 lotteryPick- random.sample (range(1,M+1),5) def main(): #sets a new function M-1 N-5 while M-5: #if they are greater or equal to 5, lottery sample will pick through the range return lotteryPick print ("Error, number must be a5") #Asked to have numbers greater than 5 lotteryPick- random.sample (range(1,M+1),5) def main(): #sets a new function M-1 N-5 while M<:><:><:>

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_2

Step: 3

blur-text-image_3

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

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

2. What appeals processes are open to this person?

Answered: 1 week ago