The matching problem. Suppose that N items labeled 1, 2, , N are shuffled so that they

Question:

The matching problem. Suppose that N items labeled 1, 2, …, N are shuffled so that they are in random order. Of interest is how many of these will be in their “correct” positions (e.g., item #5 situated at the 5th position in the sequence, etc.) after shuffling.

a. Write program that simulates a permutation of the numbers 1 to N and then records the value of the variable X = number of items in the correct position.

b. Set N = 5 in your program, and use at least 10,000 simulations to estimate
E(X), the expected number of items in the correct position.
c. Set N = 52 in your program (as if you were shuffling a deck of cards), and use at least 10,000 simulations to estimate E(X). What do you discover? Is this surprising?

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Modern Mathematical Statistics With Applications

ISBN: 9783030551551

3rd Edition

Authors: Jay L. Devore, Kenneth N. Berk, Matthew A. Carlton

Question Posted: