Question: In a lottery the player has to select several numbers out of a list. Write a user-defined function that generates a list of n integers
In a lottery the player has to select several numbers out of a list. Write a user-defined function that generates a list of n integers that are uniformly distributed between the numbers a and b. All the selected numbers on the list must be different. For function name and arguments, use x = lotto (a, b, n) where the input argument are the numbers a and b, and n, respectively. The output argument x is a vector with the selected numbers.
(a) Use the function to generate a list of seven numbers from the numbers 1 through 59.
(b) Use the function to generate a list of eight numbers from the numbers 50 through 65.
(c) Use the function to generate a list of nine numbers from the numbers -25 through-2.
Step by Step Solution
3.46 Rating (182 Votes )
There are 3 Steps involved in it
Script file disp Part a xlotto1597 disp Part b xlotto50658 disp P... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
652-B-F-F-M (753).docx
120 KBs Word File
