8

Five letters are addressed to five different persons and the corresponding envelopes are prepared. The letters are put into the envelopes at random. What is the probability that no letter is in its proper envelope?

damra
  • 109

6 Answers6

8

The formula for the derangement can be used directly. The number of derangements is $$n! \left(\frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!} + \ldots + \frac{(-1)^n}{n!}\right)$$ put the value of n and get your answer. I guess this is the fastest and safest way. Hope it helpful. Cheers.

4

This is called Montmort's matching problem. Just Google it. Any short answer I can provide will not have the same clarity or completeness as any you will find on the web! If you still have difficulties, let me know. Or may be someone else will provide an answer.

In case I am not around when you post the comment, the final answer is $$ 44/5! \approx 0.36667$$

The notation that is used is $$ \frac{!5}{5!}$$ where $$ !n = \text{Round}\left(\frac{n!}{e}\right)$$

See https://en.wikipedia.org/wiki/Derangement for more details.

user44197
  • 9,730
2

Slight variations of derangement are quick to compute once the all wrong solution is found.

Consider the two wrong solution out of seven envelopes. How many deranged solutions are possible.

7! = 5040

7 all wrong is 1854 = Derange(7) 6 all wrong is 265 = Derange(6) 5 all wrong is 44 = Derange(5) 4 all wrong is 9 = Derange(4) 3 all wrong is 2 = Derange(3) 2 all wrong is 1 = Derange(2) 1 all wrong is 0 = Derange(1)

One right in 7 envelops Derange(7-1) * 7!/(1!*(7-1)!) = 265 * 7 = 1855

Two right in 7 envelopes Derange(7-2) * 7!/(2!*(7-2)!) = 44 * 7 * 6 * 5 / 2 = 924

Three right in 7 envelopes Derange(7-3) * 7!/(3!*(7-3)!) = 9 * 7 * 6 * 5 * 4 / 6 = 315

Four right in 7 envelopes Derange(7-4) * 7!/(4!*(7-4)!) = 2 * 7 * 6 * 5 / 6 = 70

Five right in 7 Derange(7-5) * 7!/(5!*(7-5)!) = 1 * 7 * 6 / 2 = 21

Six right in 7 Derange(7-6) * 7!/(6!*(7-6)!) = 0 * 7 = 0

7 envelopes: 7 wrong: 1854 6 wrong: 1855 5 wrong: 924 4 wrong: 315 3 wrong: 70 2 wrong: 21 1 wrong: 0 0 wrong: 1

Sum: 1854 + 1855 + 924 + 315 + 70 + 21 + 0 + 1 = 5040 = 7!

Pattern extends to any size derangement so long as zero wrong equals 1.

Compute the Derangement values. from N to 0, and select the correct coefficient for the binomial theorem and the problem is done: worked and validated. Don Turnblade 10/22/2014

Also note: A recursion relationship exists inside the Derangement series:

Derange(2) = 1 Derange(3) = 3 * 1 - 1 = 2 Derange(4) = 4 * 2 + 1 = 9 Derange(5) = 5 * 9 - 1 = 44 Derange(6) = 6 * 44 + 1 = 265 Derange(7) = 7 * 265 - 1 = 1854

More fun still is that the Derangement series itself is driving to approximate e = 2.718...

2!/Derange(2) = 2/1 = 2 3!/Derange(3) = 6/2 = 3 4!/Derange(4) = 24/9 = 2 + 6/9 = 2.666... 5!/Derange(5) = 120/44 = 2 + 32/44 = 2.7272... 6!/Derange(6) = 720/265 = 2 + 190/265 = 2.71698... 7!/Derange(7) = 5040/1854 = 2 + 1332/1854 = 2.7184...

For N large n!/derange(n) = e = 2.718...

So, fast Derange computation is simply, N!/e

Derange(1) ~ 1!/2.718 = 0.4 ~ 0 Derange(2) ~ 2!/2.718 = 0.7 ~ 1 Derange(3) ~ 3!/2.718 = 2.2 ~ 2 Derange(4) ~ 4!/2.718 = 8.8 ~ 9 Derange(5) ~ 5!/2.718 = 44.1 ~ 44 Derange(6) ~ 6!/2.718 = 264.9 ~ 265 Derange(7) ~ 7!/2.718 = 1854.1 ~ 1854 Derange(8) ~ 8!/2.718 = 14832.9 ~ 14833

Even envelopes lead to odd Derange numbers Odd envelopes lead to even Derange numbers

The one right scenario is either one up or one down from the Derange number always. But the multiple wright scenarios can be a bugger to estimate, I posted a generalized solution.

In my case, the problem assists with a Modern Application: Computer Security

Deranged computer configurations / all possible computer configurations = 1/e

So, what are the odds that staff is allowing Deranged computer security settings.

W = vulnerable systems. M = total number of systems

Estimate of IT Derangement of Information Security Settings = W/M * e (All Wrong)

or variations (1 right, 2 right, 3 right, 4 right out of N possible right)

So, it is not so difficult to understand the following results from a vulnerability scanner on a corporate network.

5000 systems 1839 systems have one or more high or critical vulnerabilities that have not been patched in more than a month. Odds of InfoSec derangement 1836/5000 * e = 100% Welcome to business intelligence metrics directly from an InfoSec tool.

1

So let the letters be : A B C D E and the corresponding envelopes are : a b c d e. Now A cannot go to a, so A can for example go to c. Then C has 4 options to go to: a , b, d, and e. The 1st has 2 choices, the 2nd has 3, the 3rd has 3, and the 4th has 3 choices. So there are 2 + 3 + 3 + 3 = 11 choices. Since A has 4 options to go to, the total is then : 11*4 = 44. And there are a total of 5! ways to do so. So then probability is : 44/120. This is perhaps easier to digest than using the full theorem.

DeepSea
  • 77,651
  • What do you mean by 'The 1st has 2 choices, the 2nd has 3, the 3rd has 3, and the 4th has 3 choices'? Please say, otherwise your answer is absolutely fine. – Sankha Jan 22 '15 at 15:12
0

Let us have n letters corresponding to which there exist n envelopes bearing different addresses.

A Match occurs if $Letter_{i}$ gets into $Envelope_{i}$ , $Letter_{j}$ gets into $Envelope_{j}$. Let us denote this event as $E_{i}$ .

A NO Match occurs if $Letter_{i}$ gets into $Envelope_{j}$ , $Letter_{j}$ gets into $Envelope_{i}$. Let us denote this event as $\overline{E_{i}}$ .

$E_{i}$ : Denote the Event where that the ith object occupies the ith position corresponding to its number. Then, the probability 'p' that P(None of the objects occupies the place corresponding to its number) = P( No Letter will be in its proper Envelope corresponding to its number) is given by : $ p = P(\overline{E1} \cap \overline{E2} \cap \overline{E3}.... \cap \overline{En} ) = 1 - P(\text{Atleast one of the objects occupies the place corresponding to its number})= 1 - P(\text{Atleast One Letter will be in its proper Envelope corresponding to its number})= 1 - P(E1 \cup E2\cup E3.... \cup En) = 1 - [\sum_{i=1 }^{n}P(E_{i}) - \sum_{i=1 }^{n}\sum_{j=1 }^{n}P(E_{i} \cap E_{j})....+(-1)^{n-1}P(E_{1} \cap E_{2}\cap E_{3}....... \cap E_{n}) ]= 1 - [\frac{\binom{n}{1}}{n} - \frac{\binom{n}{2}}{n(n-1)} + \frac{\binom{n}{3}}{n(n-1)(n-2)} - ..... + \frac{(-1)^{n-1}}{n(n-1)(n-2)...3.2.1} ] = 1- [ 1- \frac{1}{2!} + \frac{1}{3!}-...+\frac{^{(-1)^{(n-1)}}}{n!}]= \frac{1}{2!} - \frac{1}{3!} + \frac{1}{4!} - ........ + \frac{(-1)^{(n)}}{n!} = \sum_{k = 0 }^{n}\frac{(-1)^{k}}{k!}$ ...........................................................................

We know that $e^x=1+\frac{x}{1!}+\frac{x^2}{2!}+\frac{x^3}{3!}+...$. Putting $x = -1$, $e^{-1}=1-\frac{1}{1!}+\frac{1}{2!}-\frac{1}{3!}+...$

But for large n :

p = $1-1 + \frac{1}{2!} + \frac{1}{3!} + \frac{1}{4!} - ........... = e^{-1}$

And, the Probability of Atleast One match : $1 - p = (1-e^{-1})$

.........................................................................

Therefore, P(None of the n letters goes to the correct envelope ) = $\sum_{k = 0 }^{n}\frac{(-1)^{k}}{k!}$

0

Let $1,2,3,4,5$ be the letters and let $A,B,C,D,E$ be the proper envelope resepctively.

1) In case of five proper envelopes, only $1$ pattern.

2) In case of only four proper envelopes, the last one is in the proper envelope, so $0$ pattern.

3) In case of only three proper envelopes, you have $\binom{5}{3}\times 1=10$ patterns.

4) In case of only two proper envelopes, you have $\binom{5}{2}\times 2=20$ patterns.

For example, for $A=1, B=2,C,D,E$, you have two patterns as $(C,D,E)=(4,5,3),(5,3,4).$

5) In case of only one proper envelope, you have $\binom{5}{1}\times 9=45$ patterns.

For example, for $A,B,C,D,E=5$ you have nine patterns as $$(A,B,C,D)=(2,1,4,3),(2,3,4,1),(2,4,1,3),(3,1,4,2),$$$$(3,4,1,2),(3,4,2,1),(4,1,2,3),(4,3,1,2),(4,3,2,1).$$

Hence, what you want is $$1-\frac{1+0+10+20+45}{5!}=\frac{5!-76}{5!}=\frac{44}{120}=\frac{11}{30}.$$

mathlove
  • 139,939