Question:
At a party $n$ people toss their hats into a pile in a closet. The hats are mixed up, and each person selects one at random. What is the expected number of people who select their own hats?
My Attempt:
Note,
$$E(X) = \sum_{s\in S} p(s)X(s)$$
- $E(x)$ is the expected value.
- $p(s)$ is the probability of event $s$.
- $S$ is the sample space.
- $X(s)$ is the random variable.
The probability of one person picking his/her hat is $\dfrac{1}{n}$, two person picking their hat is $\dfrac{1}{n}\dfrac{1}{n-1}$. Let $n$ be the number of people, let $P(n, r)$ be number of $r-permutation$ in $elements$. to generalize,
$$p(s) = \dfrac{1}{P(n, s)}$$ where $s$, the sample is the number of people who picked their own hat.
Before I plug it all in to the $E(X)$ equation, the random variable is $X(s) = s$, or simply an identity function. My expected value formula is,
$$E(X) = \sum_{s\in S} \dfrac{1}{P(n, s)}*s$$
$$E(X) = \sum_{s=1}^{n} \dfrac{1}{P(n, s)}*s$$
Is this anywhere right? If I'm on track, how do I show what it equals to? The answer key said it should equal to one, but I'm lost from here.