Combinatorics and not getting your hat

In summary, we were given an extra credit problem involving n people going to a party and taking random hats when they leave. Using a derangement formula, we were able to simplify the problem to a summation of -1 to the x divided by x factorial from 0 to n. While there is no non-summation formula for this, we can approximate it using a Taylor series and estimate its error using the alternating series estimation. This allows us to find the probability that no one ends up with the same hat to be approximately round(n!/e).
  • #1
Alkatran
Science Advisor
Homework Helper
959
0
We were given an extra credit problem in discrete structures 2 today. The problem is: n people go to a party and leave a hat. When they leave they take a random hat. What is the probability that no one ends up with the same hat?
I can calculate the probability, but I was just wondering if I can simplify this any more. Here is my basic work (obviously a lot of reasoning is left out):

2 people:
[tex]2! - 2*1! + 1 = 1[/tex]

3 people:
[tex]3! - 3*2! + 3*1! - 1 = 2[/tex]

generalized:
[tex]
\sum_{x=0}^n _n C_x (n - x)! (-1)^x
[/tex]

simplified:
[tex]
\sum_{x=0}^n \frac{n!}{x!}(-1)^x
[/tex]
I know that this needs to be divided by n! to get the probability.

Is there any way to get rid of the summation or simplify in some other way?

edit: just realized I could take the n! out. It's now obvious that the summation stays nicely between 1 and 0... still not sure where to simplify from there.
 
Last edited:
Physics news on Phys.org
  • #2
This is a derangement problem and you got it: good job! The number of derangements of n objects, say hats, is variously denoted by [itex]D_n[/itex] or by [itex]!n[/itex] and is given by

[tex]D_n=!n=\sum_{k=0}^n \frac{n!}{k!}(-1)^k[/tex]

EDIT: I fixed the link (it goes to mathworld now).
 
Last edited:
  • #3
Excellent. So I suppose that means there isn't a non-summation (elementary?) formula for the summation of -1 to the x divided by x factorial from 0 to n?
 
  • #4
[tex]!n=\left[ \frac{n!}{e}\right][/tex] where [x] is the nearest integer function.
 
  • #5
benorin said:
[tex]!n=\left[ \frac{n!}{e}\right][/tex] where [x] is the nearest integer function.

I found that one on mathworld too, very nice. Small point though: It doesn't match when n = 0.

I'm going to stick with the summation form: I can show the work to make it there. I have no idea how to reach round(n!/e).
 
  • #6
Hmm... I'll try.

We know that [tex]!n=\sum_{k=0}^n \frac{n!}{k!}(-1)^k=n!\sum_{k=0}^n \frac{(-1)^k}{k!}[/tex] is, by your combinatorial arguement, an integer, furthermore we have

[tex]\frac{n!}{e}=n!e^{-1}=n!\sum_{k=0}^{\infty} \frac{(-1)^k}{k!} = n!\sum_{k=0}^{n} \frac{(-1)^k}{k!} + n!\sum_{k=n+1}^{\infty} \frac{(-1)^k}{k!} = !n+n!\sum_{k=n+1}^{\infty} \frac{(-1)^k}{k!}[/tex]

so we need to show that the second term in the last equality is less than unity, and we wish to know when it is greater than 0.5 [I think].

Since it is an alternating series, we have an estimation theorem for that... notably, it is also the remainder for a Taylor series (times n!).
 
  • #8
benorin said:
Hmm... I'll try.
We know that [tex]!n=\sum_{k=0}^n \frac{n!}{k!}(-1)^k=n!\sum_{k=0}^n \frac{(-1)^k}{k!}[/tex] is, by your combinatorial arguement, an integer, furthermore we have
[tex]\frac{n!}{e}=n!e^{-1}=n!\sum_{k=0}^{\infty} \frac{(-1)^k}{k!} = n!\sum_{k=0}^{n} \frac{(-1)^k}{k!} + n!\sum_{k=n+1}^{\infty} \frac{(-1)^k}{k!} = !n+n!\sum_{k=n+1}^{\infty} \frac{(-1)^k}{k!}[/tex]
so we need to show that the second term in the last equality is less than unity, and we wish to know when it is greater than 0.5 [I think].
Since it is an alternating series, we have an estimation theorem for that... notably, it is also the remainder for a Taylor series (times n!).

so, picking up at the alternating series estimation, we know that the error in estimating [itex]\frac{n!}{e}[/itex] by stopping at the nth term is less than the absolute value of the next term in the series, hence

[tex]\left| \frac{n!}{e} - !n\right| \leq \frac{n!}{(n+1)!} = \frac{1}{n+1}<1,[/tex]

therefore round it! [but I am tired :zzz: , so have a go at it: I'm likely missing something...]
 

1. What is combinatorics?

Combinatorics is a branch of mathematics that deals with counting and organizing objects or events that have certain properties.

2. How is combinatorics used in real life?

Combinatorics is used in various fields such as computer science, economics, and genetics, to solve problems related to counting and optimization.

3. What is the significance of the "hat problem" in combinatorics?

The "hat problem" is a famous combinatorial problem that involves arranging hats on prisoners, and has applications in various fields such as computer science and game theory.

4. How can combinatorics be applied in probability and statistics?

Combinatorics plays a crucial role in probability and statistics, as it provides tools and techniques for counting the number of possible outcomes in a given scenario.

5. Can combinatorics be used to solve real-world problems?

Yes, combinatorics has many real-world applications, such as in scheduling, design of experiments, and cryptography, to name a few.

Similar threads

  • Calculus and Beyond Homework Help
Replies
16
Views
1K
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
Replies
8
Views
988
  • Calculus and Beyond Homework Help
Replies
3
Views
914
  • Calculus and Beyond Homework Help
Replies
3
Views
413
  • Calculus and Beyond Homework Help
Replies
15
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
270
  • Calculus and Beyond Homework Help
Replies
3
Views
737
  • Calculus and Beyond Homework Help
Replies
9
Views
766
  • Calculus and Beyond Homework Help
Replies
16
Views
1K
Back
Top