0

Assuming my world is made up of 100 distinct states such that:

$$S = (s1, s2, s3, ... s100)$$

Let's call the number of states 'K'.

And assuming that I perform N trials, wherein each trial I visit one of the states in S randomly, with replacement.

What is the probability that I visit all states at least once in N successive independent trials?

Here's what I have so far: The probability of visiting all states at least once is the inverse of the probability of never visiting a particular state, for each state $s_i$.

$$P(S_{once}) = N * (1 - P(s_i))^{N}$$

However, the math shows I am wrong here. Assuming N = 200, In this example, this works out to: $$P(S_{once}) = 200 * (1 - \frac{1}{100})^{200}$$

Clearly, this seems wrong. For one thing, the probability is greater than 1 at the end of this exercise. My guess is I am assuming some independence here which does not hold true. Can you help me come up with the right formula here, assuming there is one?

Update

I made an error in translating my words to formula:

The probability of visiting all states at least once is the inverse of the probability of never visiting a particular state, for each state $s_i$

This should be represented by the formula: $$P(S_{once}) = K * (1 - P(s_i))^{N}$$

Answer

Thanks to the comments pointing me to the Coupon Collector problem, I have my answer now.

The number of trials T required to visit all K states is:

$$ T = K * \sum_{i=1}^K\frac{1}{i} $$

This is approximately equal to $K ln K$

Reference:https://www.youtube.com/watch?v=3mu47FWEuqA

Note: The video has a typo on the final formula, the summation is from 1 to K (not K-1).

rtindru
  • 275
  • 1
    Study the coupon collector's problem – true blue anil Jul 19 '18 at 07:26
  • 1
    I linked to a number of different originals that all deal with the probability distribution in the coupon collector's problem. The answer to your specific question, in the notation of the answer to this question, is

    $$ \def\stir#1#2{\left{#1\atop#2\right}} P(N\le n)=\frac{m!}{m^n}\stir nm;. $$

    In your case, $m=100$ and $n=N$, so this is

    $$ \frac{100!}{100^N}\stir N{100};. $$

    – joriki Jul 19 '18 at 09:54
  • 1
    Thanks @joriki, that's exactly what I needed. I was not aware of the Coupon Collector problem, and searching on Google & here didn't suggest that as a possible duplicate. – rtindru Jul 20 '18 at 04:40
  • 1
    Yes, it's one of those cases where you don't know what to search for unless you already know the answer. We have enough duplicates on the site that could easily have been avoided by searching, but I don't think this is one of them. – joriki Jul 20 '18 at 04:44
  • What you wrote under "Answer" isn't the answer to your question. You asked about the probabilities; the "answer" contains the expected number of trials required. This expectation is, as usual, much easier to calculate than the probability distribution; calculating the expected number from the probability distribution is a huge detour; I only did it in the linked question because someone explicitly asked for that particular calculation. – joriki Jul 20 '18 at 06:38

0 Answers0