# Unexpected result from very simple statistics problem

I have stumbled across this problem on my mathematics book, the problem states:

A person is distributing 3 packages in a city consisting of 3 houses, each package assigned to a single house. He has lost the delivery notes, and doesn't know which package belongs to which house. What is the chance that at least a single package makes its way to the correct location if he distributes them randomly?

To solve the problem I decided to draw a simple "state machine". I assume that the order of visiting the houses doesn't change the result (am I wrong here?). The number below each package (the stars) is the house it's meant to be delivered to. Clearly, 4 out of the 6 final states have at least one correctly distributed package, so 2/3 is the result.

The solution stated by the book is 0.704 (it's rounded).

After puzzling for some time, I decided to code a quick simulation in C++, and the simulation (assuming the same premises as these used to build the graphic) converges to 2/3, too, so I wonder, am I interpreting the problem correctly? What method can lead to the result given in the book? I assume I'm missing a very easy and straightforward method as this book is designed for students new to statistics.

I suspect your book contains an error, or you may have missed a detail you didn't give us.

We can represent the houses that the packages are delivered to as a permutation on 3 elements. For instance, the permutation $$(123)$$ represents the case where all packages are delivered correctly, and $$(213)$$ represents the case where the package to house $$3$$ is delivered correctly, and the other two have been switched.

Now, if your delivery person delivers packages at random, then every possible permutation is equally likely.

In this formulation, the probability that at least one package is delivered correctly is the probability that a random equiprobable permutation has at least one fixed point, i.e., at least one of the numbers is in the correct position.

Now, the total number of permutations on $$n$$ elements is $$n!$$. The number of permutations with at least one fixed point is $$n!-!n$$, where $$!n$$ gives the number of derangements, i.e., permutations with no fixed points. The Wikipedia page gives information and a recursive formula for $$!n$$.

In our case, $$n=3$$, so $$n!=6$$, and it turns out that $$!n=2$$. (The two derangements on $$n=3$$ elements are $$(312)$$ and $$(231)$$, all other permutations have at least one fixed point.) So the probability you are looking for is

$$\frac{n!-!n}{n!} = \frac{4}{6} = \frac{2}{3}.$$

Now, if your state machine, your simulation and this little calculation all end up with the same answer which is different from the one in your book, my conclusion is as above.

• Thank you! I guess that the book must have some kind of error. I see the mathematical solution is very straightforward! – TajamSoft May 5 at 22:52
• I found the book's solutions, and they reach that result by first calculating the probability of none arriving, which is calculated as $(\frac{2}{3})^3$. (That's incorrect unless you assume that the postman can give more than one packet to each house, and that's not given in the problem), and then the probability of at least one arriving is $1 - (\frac{2}{3})^3 = 0.703$ – TajamSoft May 6 at 15:54
• Yes, that probability is wrong, because packages being misdelivered is not independent: the probability that the second package is misdelivered is different if the first one was correctly delivered or not. Specifically, if the first package was delivered correctly, then the second package is misdelivered with $p=\frac{1}{2}$ (because we have two packages and two houses left, and one of the packages should go to one of the houses.) ... – Stephan Kolassa May 6 at 16:07
• ... Conversely, if the first package was wrongly delivered, then with $p=\frac{1}{2}$ it was the package intended for house #2, so the probability for the second delivery to be correct is zero, and with $p=\frac{1}{2}$, it was the one intended for house #3, so we still have a chance of $p=\frac{1}{2}$ to deliver the second one correctly. Thus, in this case, the probabilty for a misdelivery to the second house is $\frac{3}{4}$. ... – Stephan Kolassa May 6 at 16:07
• ... I hope the rest of the book is better. – Stephan Kolassa May 6 at 16:08