In a lottery the player has to select several numbers out of a list. Write a user-defined

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 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.
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: