10

A burglar breaks into a bank with the intention to open the vaults and steal some gold coins. He knows that each vault contains a number of 1 to 100 such coins with equal probability for each number. Since he is what we call an “ethical burglar”, he will only get 100 coins to help some people in need. How many vaults must he breach on average?

This is really confusing because we are not given how many vaults we have. Is it safe to say that since the numbers from 1 to 100 have equal probability, then we have 100 vaults? Then, if vault Number 1 has 1 coin, 2 has 2 etc, we need to open as many that will give sum of 100? And then get the average?

I need help with the interpretation and solution please!

Ok after having asked several people, here is my interpretation: We may have any number of vaults, not necessarily 100 (maybe more, maybe less) but the number of coins in them has been placed randomly, with equal probability for each number from 1 to 100.

The burglar will stop once he has collected 100 or more coins: That is, if, after the last vault, he has 99, he may open another one, with 23 coins, so he will have a total of 122 and this is OK.

Any ideas for the solution?

Thank you!

  • The number of vaults matters. Say you had only two vaults, with one containing $1$ and the other containing $2$. If your goal is to get $3$ you are guaranteed to get it done in exactly two tries. But if you had four vaults, with two containing $1$ and two containing $2$ then it's possible it will take you three tries. – lulu Feb 07 '20 at 12:55
  • No, you have an unlimited number of vaults. But the burglar stops opening vaults as soon as he reaches 100 gold – giolendius Feb 07 '20 at 12:56
  • Two natural readings of the question: the first is that the vaults independently contain $1$ to $100$. In that case the number of vaults does not matter (just assume you have enough). The second is that you have $100$ vaults and that one contains $1$, one contains $2$, and so on. In this case the contents are not independent and the number does matter. – lulu Feb 07 '20 at 13:01
  • @lulu: That was also my question. It doesn't clearly say (or imply) that we have 100 vaults, but if we have equal probability for each number, doesn't this mean that 3 is equally likely with 7 and with 28, so in essence we must have ALL numbers from 1 to 100 only once? – Marius Stephant Feb 07 '20 at 13:09
  • @lulu: I believe it must be a diophantine equation c1+c2+...+c100 =100 but some of them may be zero - and we count the possible ways to form 100 and then take the average... Does this make any sense? (c1 etc are the number of coins in each vault). – Marius Stephant Feb 07 '20 at 13:11
  • I don't understand the "diophantine equation" bit. Presumably the thief will wind up with over $100$, not exactly $100$. Anyway, you have to decide which interpretation to solve. The other commenters seem convinced that the first of my two readings is correct. They may well be right, though I don't think that's obvious. Anyway, it is certainly a good place to start. – lulu Feb 07 '20 at 13:17
  • To get started on the problem, I suggest you do it for a smaller number. Suppose each vault independently contains $1$ to $5$ coins. What's the expected number it takes to get a total of at least $5$? – lulu Feb 07 '20 at 13:19
  • @lulu: In your example, there are 31 different ways to open from 1 to 5 vaults, of which, only 3 give exactly 5 coins: Opening only 1 vault containing 5 coins, or opening one with 1 and one with 4, or opening one with 2 and one with 3. So we have probability 3/31 and therefore the expected number is 10.333. Correct? – Marius Stephant Feb 07 '20 at 14:10
  • 1
    Once again: I don't believe the question calls for $\textit {exactly}$ $N$ coins. I think it calls for $\textit {at least}$ $N$ coins. So it's fine if the thief first draws $4$ and then draws $2$ (in the case of $N=5$). – lulu Feb 07 '20 at 14:26
  • @lulu: Correct, at least N coins. – Marius Stephant Feb 07 '20 at 16:32
  • It's unfortunate that you're extending this question more and more, now with a bounty. You had originally asked for an interpretation of the problem. This was given in an answer, and a comment under that answer appropriately suggested that if you now want to ask about the solution of the problem, you should open another question for that. Instead you've completely changed the question to ask for the solution, resulting in a confusing mix of answers to the original question and the new question, and a devaluation of the correct answers to the original question. – joriki Feb 18 '20 at 22:39

3 Answers3

3

Let $E(n)$ be the expected number of vaults needed to obtain at least $n$ coins. By conditioning on the number $k$ of coins in the next vault, we have $$E(n)= \begin{cases} 0 &\text{if $n\le 0$}\\ 1+\displaystyle{\frac{1}{100}\sum_{k=1}^{100} E(n-k)} &\text{if $n > 0$} \end{cases} $$

To make this derivation explicit for $n>0$, let random variable $V_n$ be the number of vaults needed to obtain at least $n$ coins, and let (discrete uniform) random variable $C$ be the number of coins in a vault. By the law of total expectation, conditioning on $C$ yields \begin{align} \mathbb{E}(V_n)&=\sum_{k=1}^{100}\mathbb{E}(V_n|C=k)\mathbb{P}(C=k)\\ &=\sum_{k=1}^{100}(1+\mathbb{E}(V_{n-k}))\frac{1}{100}\\ &=1+\frac{1}{100}\sum_{k=1}^{100}\mathbb{E}(V_{n-k}) \end{align}

We want to compute $E(100)$, which turns out to be approximately 2.678. You can verify that $E(n)=1.01^{n-1}$ satisfies the recursion if $n>0$, so the exact value is $E(100)=1.01^{99}$.

enter image description here

RobPratt
  • 45,619
2

It doesn't matter how many vaults there are - you open the first one you come to and it will have an amount of coins in which can be any number between 1 and 100 with equal probability.

You pocket all those coins and move onto the next vault. This vault also has between 1 and 100 coins in, again with equal probability for each number.

You add together these coins and the ones already in your pocket. If this number is greater than or equal to 100 then you stop and leave with your 100 coins. If you have less than 100 coins, then you pocket all the coins and move on to the next vault, repeating the process until you have the desired 100 coins

lioness99a
  • 4,943
  • Yes but we are asking how many vaults on average he will have to open (so as to reach 100 coins). – Marius Stephant Feb 07 '20 at 12:58
  • 3
    The original question was about how to interpret the question. If you want help answering the actual question now, you can create a new question – lioness99a Feb 07 '20 at 12:59
1

Very nice problem! You can safely assume that there are exactly $100$ vaults since this is the maximal number of vaults the burglar may have to open. (See below for an argument.)

My take on the interpretation is as follows: Number the vaults $V_1, V_2, \ldots, V_{100}$ and say that the burglar opens $V_1$ first, then $V_2$ if necessary, and then $V_3$ and so on. Suppose that the number of coins in vault $V_i$ is $C_i$. There are $N = 100^{100}$ different possible configurations of coins in the vaults, all of which are equally likely if we assume that the contents of different vaults are independent. That is, for any $(n_1, \ldots, n_{100}) \in S:= \lbrace 1, \ldots, 100 \rbrace^{100}$, \begin{align*} P\left( C_1 = n_1, \ldots, C_{100} = n_{100} \right) = \frac{1}{N}. \end{align*} For $\textbf{n} = (n_1, \ldots, n_{100}) \in S$, corresponding to specific configuration of coins, let

\begin{align*} b(\textbf{n}) = \min \left\lbrace 1 \leqslant x \leqslant 100 \mid n_1 + \cdots + n_x \geqslant 100 \right\rbrace. \end{align*}

The problem is to compute \begin{align*} P_{100} := \frac{1}{\# S} \sum_{\textbf{n} \in S} b(\textbf{n}) = \frac{1}{N} \sum_{\textbf{n} \in S} b(\textbf{n}). \end{align*}

To see why you can assume that there are only $100$ vaults, consider $100 + k$ vaults for some $k \geqslant 1$. Then (extending our notation in an obvious way) we have

\begin{align*} P\left( C_1 = n_1, \ldots, C_{100 + k} = n_{100 + k} \right) = \frac{1}{100^k N}. \end{align*} But for $\textbf{n} = (n_1, \ldots, n_{100+k})$, it is clear that $b (\textbf{n})$ is independent of $n_{101}, \ldots, n_{100+k}$ since $n_i \geqslant 1$ for all $i$. Letting $S_{100+k} = \lbrace 1, \ldots, 100 \rbrace^{100 + k} = S \times \lbrace 1, \ldots, 100 \rbrace^k$, we now see that the average number of vaults the burglar needs to open in the case of $100 + k$ vaults is \begin{align*} P_{100+k} := \frac{1}{100^k N} \sum_{\textbf{n} \in S_{100 + k}} b(\textbf{n}) = \frac{100^k}{100^k N} \sum_{\textbf{n} \in S} b(\textbf{n}) = P_{100}, \end{align*} since there are precisely $100^k$ ways to choose the last $k$ entries of the $(100+k)$-tuple n, and $b(\textbf{n})$ is independent of these entries.