document.write( "Question 1042549: One evening, n men enter the restaurant and put their hats at the reception. Each man gets a random hat back
\n" ); document.write( "when going back after having dinner. Find the expected number of men who get their right hat back.\r
\n" ); document.write( "\n" ); document.write( "A. 1\r
\n" ); document.write( "\n" ); document.write( "B. 1/2\r
\n" ); document.write( "\n" ); document.write( "C. 1/n\r
\n" ); document.write( "\n" ); document.write( "D. n/2
\n" ); document.write( "

Algebra.Com's Answer #657657 by robertb(5830)\"\" \"About 
You can put this solution on YOUR website!
There are n hats and each person picks a hat uniformly at random hence each gets their right hat back with probability \"1%2Fn\".
\n" ); document.write( "Since expectation is linear even when the random variables are dependent, it follows that the mean of the total number of persons who
\n" ); document.write( "get their right hat back is \"1%2Fn+%2B+1%2Fn\"+..+ \"1%2Fn+=+n%2A%281%2Fn%29+=+highlight%281%29\". \r
\n" ); document.write( "\n" ); document.write( "***This is the famous \"hat-matching problem\". The one given above is the most intuitive but the least rigorous of all the proofs I've seen,
\n" ); document.write( "but does the job well in giving the correct answer. The other rigorous proofs involve finding the pmf of \"mismatches\", or derangements of n objects (in mathematical parlance) and then applying the definition of expectation of a random variable.***\r
\n" ); document.write( "\n" ); document.write( "
\n" ); document.write( "
\n" );