Day 24: Deranged Distribution

Santa is running out of time distributing presents to everyone, so he has asked a helper to help him.

However the helper is lazy. When he arrives at a street with seven houses (which each get one present) he randomly throws one unique present into each house (all the presents he throws belong to the houses), And having beginner's luck, he gets at least two presents in the correct houses.

How many ways are there to distribute the presents?


The answer is 1331.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Michael Ng
Dec 23, 2014

Let us call a permutation where all the objects are not in their original places a derangement ; define D ( n ) D(n) as the number of derangements for n n objects. D ( n ) D(n) is a well known function whose formula can be derived using the Principle of Inclusion and Exclusion .

First we consider how many ways there are to get only two presents correct. We choose two presents to be fixed then we multiply by the number of derangements of the other five objects. So there are: ( 7 2 ) × D ( 5 ) = 21 × 44 = 924 \binom{7}{2}\times D(5) = 21 \times 44 = 924 ways.

Then we consider how many ways there are for three objects correct up to seven objects correct, giving us: 924 + 315 + 70 + 21 + 0 + 1 = 1331 924 + 315 + 70 + 21 + 0 + 1 = \boxed{1331} ways as our answer.

It is also possible to consider the complement using D ( 7 ) D(7) and D ( 6 ) D(6) , but I think that this method's calculation is perhaps easier.

Solved it using the complement of getting none correct and getting exactly one correct. Derangement of 7 objects by the well known formula for derangement is 1854 ways and derangement of 6 objects is 265ways which is multiplied by 7 since one correct object could be any of the seven= 1855. Number of ways = 1854 + 1855 = 3709. Total ways is 7! = 5040. Getting at least two correct is 5040 - 3709 = 1331.

Satyen Nabar - 6 years, 5 months ago

Can you tell me more about 'dearangament'?. I never heard about that.

Poetri Sonya - 6 years, 5 months ago

Log in to reply

http://en.wikipedia.org/wiki/Derangement

Satyen Nabar - 6 years, 5 months ago

Log in to reply

There is a alternative way : Say it is [(n+r)] ^(n-r) Here in our case n=7 r=4 Which gives us 11^3 =1331

PANKAJ KUMAR - 3 years ago

Please tell me what is wrong with the following : Lets choose 2 houses for correct delivery : 7 C 2 ways. There is only one way to have correct delivery for these two houses. For the rest 5 houses, deliveries can be arranged in 5! ways. These will include both correct and incorrect deliveries. Thus, the required number is 7C2x5!

Kausik Sen - 6 years, 5 months ago

Log in to reply

You are counting some cases twice. For example take the case where all houses get the right present. You could choose the first two houses then have one way of getting the other five houses all correct, but you could also choose the last two houses first and do the same. Hope this helps!

Michael Ng - 6 years, 1 month ago

Number of ways to get atleast two correct = Total - Number of ways of getting none correct - Number of ways of getting one correct.
Total number of ways to arrange = 7 ! 7!
Number of ways to get none correct = 7 ! i = 0 7 ( 1 ) i 1 i ! = 1854 7! \displaystyle \sum_{i=0}^{7}(-1)^{i}\dfrac{1}{i!}= 1854 [ Using the Derangement theorem ]

Number of ways to get one right = Choosing one house which gets correctly × \times Derangements of other 6 = ( 7 1 ) × 6 ! k = 0 k = 6 ( 1 ) k 1 k ! = 1855 \dbinom{7}{1} \times 6! \displaystyle \sum_{k=0}^{k=6}(-1)^{k}\dfrac{1}{k!} = 1855
\therefore Require ways = 5040 1854 1855 = 1331 = 5040 - 1854 - 1855 = 1331

Answer = 7! - (D7+7*D6)=1331. where Dn denotes the number of ways in which n caps can be distributed to n persons such that nobody recieves his own cap.(Google it if you want)

in a solution your supposed to explain d(n), and not rip off the first solution. you also need to explain how you got to your answer, not just put it there

Kevin Long - 2 months, 3 weeks ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...