# Probability that X restaurants will be visited if Y people choose independently

#### JPC

##### New Member
I am trying to determine for Y people selecting from X restaurants (with an equal probability) what the expected value of the number of restaurants chosen would be. All decisions are independent.

Ex: 2 people and 2 restaurants - E(X) = 1(.5) + 2(.5) = 1.5 restaurants will be visited on average
EX: 3 people and 3 restaurants - E(X) = 1(1/9) + 2(6/9) + 3(2/9) = 2.11 restaurants will be visited on average

This is simple enough for small values like these. However, I would like to be able to do this for any combination of X and Y and create a table of expected values. For larger numbers I am having trouble determining the probabilities to plug into the expected value formula. When calculating the probabilities, I know that the denominator will always be X^Y but I am really struggling to find a way to calculate the numerator without writing down every possible combination.

My ultimate goal would be to create a table in excel that for any given number of restaurants and people, returns the expected value.

I'm running into a major road block so any help would be appreciated.

#### BGM

##### TS Contributor
Let
$$n$$ be the total number of restaurants.
$$X$$ be the number of restaurants visited by at least 1 person
$$k$$ be the total number of people
$$B_i, i = 1, 2, \ldots, n$$ be the indicators of the $$i$$-th restaurant being visited by at least 1 person

If you are only interested in the expected value $$E[X]$$, we can try to calculate it without actually calculating the pmf of $$X$$. The trick is to consider the following decomposition, having the same spirit as the one we do in calculating the expected value of hypergeometric distribution:

$$X = \sum_{i=1}^n B_i$$

Note those $$B_i$$ are not independent; but this does not matter - all we need is the linearity of the expectation. Further note that

$$E[B_i] = \Pr\{B_i = 1\} = 1 - \left(1 - \frac {1} {n}\right)^k$$

and therefore

$$E[X] = nE[B_1] = n\left[1 - \left(1 - \frac {1} {n}\right)^k \right]$$

#### JPC

##### New Member
That worked perfectly. Thank you! Glad I asked because I was not headed in the right direction.