Problem

Distinct values. Write a client that takes integers M, N, and T as command-line arguments,...

Distinct values. Write a client that takes integers M, N, and T as command-line arguments, then uses the code given in the text to perform T trials of the following experiment: Generate N random int values between 0 andM - 1 and count the number of distinct values. Run your program for T = 10 and N = 10 3, 10 4, 10 5, and 10 6, with M = N/ 2, and N, and 2N. Probability theory says that the number of distinct values should be about M (1 - e α) where α = N /M—print a table to help you confirm that your experiments validate that formula.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2.5