7

At a party n people throw their name tags on a table. The name tags are mixed up and then each people randomly and simultaneously selects one. Find the expected number of people who select their own name tag.

Since the people choose simultaneously, I assumed that each has $\frac{(n-1)!}{n!}$ or $\frac{1}{n}$ chance of selecting their own, thus expected number of people who get their own name tag is $ n\cdot \frac{1}{n} = 1 $. Am I correct in this?

bobbym
  • 2,566
daniel
  • 83
  • Here is some MathJax tutorial – ASB Feb 24 '15 at 09:01
  • I think that this question is essentially the famous Hat Check Problem, which has been asked here various times in several different versions (such as this one for example). If I'm not mistaken, then the answer is $\frac1e$ as $n$ tends to $\infty$. – barak manos Feb 24 '15 at 09:01
  • @Daniel link The answer looks like it is 1 by the linearity of expectation. – bobbym Feb 24 '15 at 09:31
  • Ah, looking at the link you gave it is exactly the problem I was asking and by the comments the answer was indeed 1. Thanks! – daniel Feb 24 '15 at 09:32
  • 1
    @barakmanos It is indeed that problem, but here we are dealing with expectation (more easy). The probability that no person will get his own hat tends to $e^{-1}$ if $n$ tends to infinity. – drhab Feb 24 '15 at 10:02
  • @drhab: Thanks, I was indeed wondering whether it was the answer to the probability or to the expectation. – barak manos Feb 24 '15 at 10:06

2 Answers2

8

Yes, you're right. To make the reasoning a little more precise, for each person $1,\dots,n$ we could define a Bernoulli random variable $X_i$, i.e., a random variable which takes one of only two possible values 0 and 1. We set $X_i$ to equal $1$ if the $i$th person draws their own name tag and $0$ if they do not. As you argue, the probability of any particular person drawing their own name tag is $1/n$. That is, $P(X_i=1)=1/n$. It follows that the expected value of $X_i$ is \begin{align*} E(X_i)&=\sum_{x=0}^1 xP(X_i=x) \\ &= 0\cdot P(X_i=0)+1\cdot P(X_i=1) \\ &= 0+1/n \\ &= 1/n \end{align*} Now the total number of people who select their own name tag is $X_1+\cdots+X_n$, and we can use the linearity property of expected value to conclude that $$E(X_1+\cdots+X_n) = E(X_1)+\cdots+E(X_n) = \frac1n+\cdots+\frac1n = n\cdot\frac1n = 1$$

Brent Kerby
  • 5,709
  • Hmm.. what if the question had asked the number of pairs that exchanged tags? – Huzo Feb 24 '19 at 08:19
  • @Huzo Please do not extend the posted problem in that way. Instead, ask the question about (for example) the expected number of pairs of exchanged tags in a separate posted question. – user2661923 Jul 09 '23 at 03:48
1

This is the expected number of fixed points in a random permutation which has combinatorial class in the notation from Analytic Combinatorics $$\def\textsc#1{\dosc#1\csod} \def\dosc#1#2\csod{{\rm #1{\small #2}}}\textsc{SET}(\mathcal{U}\times\textsc{CYC}_{=1}(\mathcal{Z}) + \textsc{CYC}_{=2}(\mathcal{Z}) + \textsc{CYC}_{=3}(\mathcal{Z}) + \textsc{CYC}_{=4}(\mathcal{Z}) +\cdots).$$ This gives the generating function $$G(z,u) = \exp\left(uz +\frac{z^2}{2}+\frac{z^3}{3}+\frac{z^4}{4}+\cdots\right)$$ which is $$G(z, u) = \exp\left((u-1)z + z + \frac{z^2}{2}+\frac{z^3}{3}+\frac{z^4}{4}+\cdots\right) = \frac{1}{1-z} \exp((u-1)z) \\ = \frac{\exp(-z)}{1-z} \exp(uz).$$

To get the expected value compute $$\left.\frac{\partial}{\partial u} G(z,u)\right|_{u=1} = \left. \frac{\exp(-z)}{1-z} \exp(uz) \times z\right|_{u=1} = \frac{z}{1-z}.$$

Extracting coefficients for the expected value we obtain $$[z^n]\frac{z}{1-z} = 1$$ as claimed.

Marko Riedel
  • 64,728