Just how many ways are there to get it all wrong!

So that this does not have to be a computer problem, n = 11 n = 11 . This can be done easily on a calculator that has factorial on it, paper and a writing instrument, for example.

Given that you have n n letters addressed to n n different people and n n envelopes, which are addressed each to a different person of the same group of people, how many (permutations, if you will) are there to put every letter into an incorrect envelope. Note: if even one letter gets into its correct envelope, that is a failure.

To help you, here a table for values of n n from 1 1 to 5 5 : n count 1 0 2 1 3 2 4 9 5 44 \begin{array}{r|r} n & \text{count} \\ \hline 1 & 0 \\ 2 & 1 \\ 3 & 2 \\ 4 & 9 \\ 5 & 44 \\ \end{array}


The answer is 14684570.

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.

2 solutions

Note the expansion of ( s f ) 5 (s-f)^5 is 10 f 3 s 2 + 10 f 2 s 3 + 5 f 4 s f 5 5 f s 4 + s 5 -10 f^3 s^2+10 f^2 s^3+5 f^4 s-f^5-5 f s^4+s^5 , which is just the binomial expansion, with f representing failure and s representing success .

From this, the formula t t ! n = 0 t ( 1 ) n n ! t\rightarrow t! \sum _{n=0}^t \frac{(-1)^n}{n!} can be derived.

For 11 11 , that evaluates to 14684570 14684570 .

The problem ask for finding the number of ways q ( n ) q(n) of getting all n n letters into the wrong n n addressed envelopes. From first few n n and q ( n ) q(n) given we note that q ( n ) = ( n 1 ) ( q ( n 1 ) + q ( n 2 ) ) q(n) = (n-1)(q(n-1)+q(n-2)) for n 3 n \ge 3 . Using the recursive relation we have:

n q ( n ) \ 1 0 2 1 3 2 4 9 5 44 6 265 7 1854 8 14833 9 133496 10 1334961 11 14684570 12 176214841 13 2290792932 \begin{array} {r|r} n & q(n) \quad \ \ \\ \hline 1 & 0 \\ 2 & 1 \\ 3 & 2 \\ 4 & 9 \\ 5 & 44 \\ 6 & 265 \\ 7 & 1854 \\ 8 & 14833 \\ 9 & 133496 \\ 10 & 1334961 \\ \boxed{11} & \boxed{14684570} \\ 12 & 176214841 \\ 13 & 2290792932 \end{array}

The Note is correct. If even one letter gets into its correct envelope, that case can not be counted (it is a failure).

The proof of the binomial theorem is recursive in its iteration. It is not necessary to evaluate a binomial coefficient that way though. They can be evaluated as ( n k ) = n ! k ! ( n k ) ! \binom{n}{k}=\frac{n!}{k! (n-k)!} , which is found on some calculators directly and can be done on any calculator with factorial (!).

Using the binomial expansion of ( s f ) 5 (s-f)^5 , one can see that it is 10 f 3 s 2 + 10 f 2 s 3 + 5 f 4 s f 5 5 f s 4 + s 5 -10 f^3 s^2+10 f^2 s^3+5 f^4 s-f^5-5 f s^4+s^5 . where s s represents successes (that is, letters in wrong envelopes) and f f represents failures (letters in correct envelopes). This can be generalized using the binomial theorem, noting that the sign changes follow the failures, and there is only one way to have success gives j = 0 5 ( 1 ) j ( 5 j ) f j s 5 j \sum _{j=0}^5 (-1)^j \binom{5}{j} f^j s^{5-j} . Failures ( f ! f! ) are just ( 5 j ) ! (5-j)! . Expanding the ( n j ) \binom{n}{j} to its definition and doing the f f substitution gives j = 0 5 5 ! ( 1 ) j ( 5 j ) ! j ! ( 5 j ) ! \sum _{j=0}^5 \frac{5! (-1)^j (5-j)!}{j! (5-j)!} which evaluates to 44 44 . Generalizing that formula for arbitrary n n with a term cancellation and moving a constant n ! n! out of the summation gives n ! j = 0 n ( 1 ) j j ! n! \sum _{j=0}^n \frac{(-1)^j}{j!} as was stated in the original solution.

As a check, for n n from 1 to 9, all the permutations of n n objects were generated and the successful permutations were counted directly. The results were the same.

A recursive evaluation of the following table would a very long time. Using the formula method, it takes milliseconds. n count 1 0 2 1 3 2 4 9 5 44 6 265 7 1854 8 14833 9 133496 10 1334961 11 14684570 12 176214841 13 2290792932 14 32071101049 15 481066515734 16 7697064251745 17 130850092279664 18 2355301661033953 19 44750731559645106 20 895014631192902121 21 18795307255050944540 22 413496759611120779881 23 9510425471055777937262 24 228250211305338670494289 25 5706255282633466762357224 26 148362637348470135821287825 27 4005791208408693667174771274 28 112162153835443422680893595673 29 3252702461227859257745914274516 30 97581073836835777732377428235481 \begin{array}{r|r} \text{n} & \text{count} \\ \hline 1 & 0 \\ 2 & 1 \\ 3 & 2 \\ 4 & 9 \\ 5 & 44 \\ 6 & 265 \\ 7 & 1854 \\ 8 & 14833 \\ 9 & 133496 \\ 10 & 1334961 \\ 11 & 14684570 \\ 12 & 176214841 \\ 13 & 2290792932 \\ 14 & 32071101049 \\ 15 & 481066515734 \\ 16 & 7697064251745 \\ 17 & 130850092279664 \\ 18 & 2355301661033953 \\ 19 & 44750731559645106 \\ 20 & 895014631192902121 \\ 21 & 18795307255050944540 \\ 22 & 413496759611120779881 \\ 23 & 9510425471055777937262 \\ 24 & 228250211305338670494289 \\ 25 & 5706255282633466762357224 \\ 26 & 148362637348470135821287825 \\ 27 & 4005791208408693667174771274 \\ 28 & 112162153835443422680893595673 \\ 29 & 3252702461227859257745914274516 \\ 30 & 97581073836835777732377428235481 \\ \end{array}

Now, read Derangement . Therefore, the limit as n n\to\infty of derangments of n n objects, also known as, Subfactorial ( n ) \text{Subfactorial}(n) or ! n \text{!}n , divided by n ! n! can seen easily as e 1 e^{-1} . The n ! n! terms cancel and what remains is the series expansion for e 1 e^{-1} .

A Former Brilliant Member - 1 year, 2 months ago

Log in to reply

@Jane Doe , sorry, I misread "to put every letter into an incorrect envelope" as correct.

Chew-Seong Cheong - 1 year, 2 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...