## easy riddle

**F**rom the current Riddler, a problem that only requires a few lines of code and a few seconds of reasoning. Or not.

N households each stole the earnings from one of the (N-1) other households, one at a time. What is the probability that a given household is not burglarised? And what are the expected final earnings of each household in the list, assuming they all start with $1?

The first question is close to Feller’s enveloppe problem in that

is close to exp(-1) for N large. The second question can easily be solved by an R code like

N=1e3;M=1e6 fina=rep(1,N) for (v in 1:M){ ordre=sample(1:N) vole=sample(1:N,N,rep=TRUE) while (min(abs(vole-(1:N)))==0) vole[abs(vole-(1:N))==0]=sample(1:N, sum(vole-(1:N)==0)) cash=rep(1,N) for (t in 1:N){ cash[ordre[t]]=cash[ordre[t]]+cash[vole[t]];cash[vole[t]]=0} fina=fina+cash[ordre]}

which returns a pretty regular exponential-like curve, although I cannot figure the exact curve beyond the third burglary. The published solution gives the curve

corresponding to the probability of never being robbed (and getting on average an extra unit from the robbery) and of being robbed only *before* robbing someone else (with average wealth N/(N-1)).

## Leave a Reply