28

I roll a fair die and sequentially sum the numbers the die shows. What are the odds the summation will hit exactly 100?

More generally, what are the odds of hitting an exact target number t while summing the results of numbers sequentially drawn uniformly from a set S.

I have experimentally tested this and the result is (warning - spoilers ahead):

1 over the expectation of the drawn numbers. In the case of the fair die 1/((1+2+3+4+5+6)/6) = 6/21 = 2/7

However I do not have a strong intuition, let alone a formal proof, why this is the case.

I'll be happy to get your thoughts!

Dancrumb
  • 375
Ohad Dan
  • 547

7 Answers7

25

The probability of hitting $n$ on the nose is a function of $n$, call it $f(n)$. It satisfies the recurrence $$f(n)=\frac{f(n-1)+f(n-2)+f(n-3)+f(n-4)+f(n-5)+f(n-6)}6$$ with boundary values $f(0)=1$ and $f(n)=0$ for $n\lt0$. I didn't try to solve the recurrence, but my numerical calculations agree with yours, it looks like $f(n)\to2/7$.

bof
  • 78,265
  • 14
    Based on your recurrence, I was able to compute the case for 100 exactly: $$\frac{186662463857159746887081233650939816277072280598086888295658941442344128837463}{653318623500070906096690267158057820537143710472954871543071966369497141477376}$$ which to 14 decimal places is the same at 2/7 ($0.2857142857142805$ vs. $0.2857142857142857$). Higher values of $n$ produce values that are the same as 2/7 to machine precision. – BeaumontTaz Oct 17 '14 at 11:02
23

The generating function $$H(x)=\sum\limits_{n=0}^\infty h_nx^n,$$ where $h_0=1$ and, for every $n\geqslant1$, $h_n$ is the probability to hit exactly $n$, solves the identity $$H(x)=1+P(x)H(x),\qquad P(x)=\frac16(x+x^2+\cdots+x^6),$$ hence $$H(x)=\frac1{1-P(x)}.$$ The limit of $h_n$ when $n\to\infty$ is $$\ell=\lim_{x\to1}(1-x)H(x)=\frac1{P'(1)},$$ that is, $$\ell=\frac6{1+2+\cdots+6}=\frac27.$$ This extends to every "die" producing any collection of numbers in any biased or unbiased way. If the "die" produces a random positive integer number $\xi$, the limit of $h_n$ becomes $$\ell=\frac1{E(\xi)}.$$ Assuming the limit $\ell$ exists, this can be understood intuitively as follows: by the law of large numbers, the sum of $n$ draws is about $k=nE(\xi)$ hence, after $n$ draws, $n$ large, one has hit $n$ values from roughly $k$. If each value has a chance roughly $\ell$ to be hit, one can expect that $\ell\approx n/k$, QED. Obvious counterexamples are when $\xi$ is, say, always a multiple of $3$, and these are essentially the only cases since $\ell$ exists if and only if the greatest common divisor of the support of $\xi$ is $1$.

Edit: To estimate the difference $h_n-\ell$ in the usual case, note that $$1-P(x)=(1-x)(1+x/a)(1-x/u)(1-x/\bar u)(1-x/v)(1-x/\bar v),$$ for some $a$ real positive and some complex numbers $u$ and $v$ with nonzero imaginary parts, hence $$H(x)=\frac{\ell}{1-x}+\frac{b}{1+x/a}+\frac{r}{1-x/u}+\frac{\bar r}{1-x/\bar u}+\frac{s}{1-x/v}+\frac{\bar s}{1-x/\bar v},$$ for some real number $b$ and some complex numbers $r$ and $s$ defined as $$b=-\frac1{aP'(-a)},\qquad r=\frac1{uP'(u)},\qquad s=\frac1{vP'(v)}.$$ Thus, for every $n$, $$h_n=\ell+b(-1)^na^{-n}+2\Re\left(r u^{-n}+s v^{-n}\right).$$ Numerically, $a\approx1.49$, and $|u|$ and $|v|$ are approximately $1.46$ and $1.37$, hence all this yields finally $$|h_n-\ell|=O(\kappa^{-n}),\qquad\kappa\approx1.37.$$ For $n=100$, $\kappa^{-n}\approx2\cdot10^{-14}$ hence one expects that $h_n$ coincides with $\ell$ at up to $13$ or $14$ decimal places.

Did
  • 279,727
  • 2
    My intuition: if everything would go 'as expected' (impossible) then each 'next stop' is $\frac{7}{2}$ higher. – drhab Oct 17 '14 at 11:23
  • 1
    $H(x) = 1 + P(x) + P(x)^2 + \ldots$ is obviously correct. Why is $H(x) = 1 + P(x) H(x)$ obviously correct? A priori it's clearly plausible that it could work out that way, but IMO it's very nonobvious how to (directly) show that it does. –  Oct 17 '14 at 11:55
  • 1
    @Hurkyl A direct approach is to note that (hits $n$) is the disjoint union of (hits $n-k$ and draws $k$) hence, for every $n\geqslant1$, $h_n$ is a sum of $h_{n-k}p_k$ where $p_k$ is the probability to draw $k$, provided one sets $h_0=1$. In terms of generating functions, this reads $H(x)=1+P(x)H(x)$. – Did Oct 17 '14 at 12:31
  • Hrm. I had set that up, but your words explaining it make it more clear than the words I was using in my head. Thanks! –  Oct 17 '14 at 13:39
  • @Hurkyl Well... I am flattered. :-) – Did Oct 17 '14 at 13:40
  • 1
    I'm having trouble understanding the initial part of this answer :( Can someone explain what $H(x)$ and $P(x)$ actually represent, or point me to further reading? – UncleZeiv Oct 17 '14 at 16:31
  • 2
    @UncleZeiv ?? These are actually defined in the answer, hence I actually have some trouble to actually understand what you actually fail to understand. – Did Oct 17 '14 at 16:55
  • 1
    Hi Did, I know they are defined in the answer, but I still fail to understand intuitively what they are meant to represent? $P(x)$ is the probability of what? What is $x$? I understand the reasoning behind @bof's answer better, but it still doesn't click how it's related to yours (it looks like $f(n)=h_n$). (Btw I'm not criticizing your answer, just asking for a little help in understanding it :)) – UncleZeiv Oct 18 '14 at 23:59
  • @UncleZeiv First, P(x) is not a probability but a polynomial and x is a dummy variable. The function P is the generating function of the result of one throw of the die. Likewise, the function H encodes all the probabilities h_n of interest in a single function of the variable x. Finally, sorry but I see no reason why I should relate some (explicitely defined) notations in my answer to every other notation of other users. It happens that f(n) in the answer you cite is h_n, and so what? (You surely noted that the other answer you "understand better" actually does not solve the question). – Did Oct 19 '14 at 06:21
  • Thanks Did, this clarified the matter a lot. Hurkyl's comment also helped. – UncleZeiv Oct 22 '14 at 13:22
5

Some addition on the answer of @bof:

For $n\in\mathbb{Z}$ let $E_{n}$ denote the event that number $n$ shows up in the sequence.

This with $E_{n}=\emptyset$ if $n<0$ and $E_{0}=\Omega$ (we start the list with $0$).

Let $X$ denote the first number that appears.

Then $P\left(E_{n}\right)=\sum_{i=1}^{6}P\left(E_{n}\mid X=i\right)P\left(X=i\right)=\frac{1}{6}\sum_{i=1}^{6}P\left(E_{n-i}\right)$

drhab
  • 151,093
1

Not a formal proof but an intuition -

let $k$ be the number showing on the face of the die when it reaches $100$ or above for the first; considering

  • (a) this face has $\large{k \over \sum \text{Faces}}$ chances of appearing, and
  • (b) when it appears there is a $1\over k$ chance that exactly $100$ was reached

... then there is a chance of $\large{1 \over \sum \text{Faces}}$ that the die stopped on face $k$ on exactly $100$, so a $\large{|\text{Faces}| \over \sum \text{Faces}}$ chance that exactly $100$ was reached.

Which for a fair die results in $\frac{6}{21} = \frac 27$.

(I think (b) is true, but I'm not sure about (a))

DanielV
  • 23,556
Emile
  • 109
1

...oh I see my error, it's sides/(sum(1 to #sides). That matches. I forgot to change the numerator. I'll leave my comment as is here...

I was curious about the answer, and while I'm not very mathy, I did write a little simulation, to explore the result for dies with different number of sides

For 6 sided die, the answer agreed with the above: 2/7 (~0.28571) probability

but for other die, the answer wasn't 6/sum(1 to #sides)

sides: probability (success at hitting 100 when summing sequential rolls)

2 0.666666...

3 0.5

4 0.4

5 0.333333...

6 ~0.28571

7 0.25

8 0.222222..

9 0.2

10 0.181818..

which suggests the answer is always 2/(#sides+1)

If the answer 6/(sum(1 to #sides)) was used, it was only correct for the sides=6 case (comparing to simulation).

Does the limit for the equations above always work out to 2/(sides+1) for different sided die? (I think? my simulation is accurate)

I was thinking that if the equation was "right", it would be right for die of all sizes?

The 2 sided case suggests an interesting bar-bet that would make money on average (flipping a coin and summing with either 1 or 2, trying to hit 100)

-kevin

kevin
  • 11
  • 2
    HI and welcome to the site. You answer look ok, but we use mathjax. For some basic information about writing math at this site see e.g. here, here, here and here. – Joao Oct 18 '14 at 05:01
0

I here will first describe my approach.

Approach:

As the question asks for the computation of the probability for a win- to get a perfect 100 by rolling a fair die ‘n’ no of times, my approach is to start the computation of the two factors: win and loss, from the points where it begins to matter- and becomes countable, and this point is when the value of the sum becomes 94.

When the sum is 94, the probability to win is 1/6 by getting a 6Φ; the probability to lose is 0. When the sum is 95, then the probability to win is 1/6, again by getting a 5Φ (I am excluding the redundant counts- as the sum of smaller value, like (‘1’,’1’,’1’,’1’,’1’), (‘2’,’1’,’2’), (‘4’,’1’), etcetera.), and the probability to lose is 1/6, by getting a ‘6’. Similarly, for sum equivalent to 96, the probability to win is also 1/6, by getting a 4Φ, and the probability to lose is 2/6 (by getting a ‘5’ or ‘6’); for 97, the probability to win is again 1/6 by getting a 3 Φ, and the probability to lose is 3/6 (by getting any one among ‘4’,’5’,’6’); for 98, the probability to win is 1/6 as well by getting a 2Φ, and that to lose is 4/6 (be it with either of ‘3’,’4’,’5’,’6’). When the sum is 99, there is just one value which can assure a win- by getting a ‘1’ in the next roll, and thus the probability for a win is 1/6; any other resultant leads to a disappointing defeat, be it with ‘2’,’3’,’4’,’5’ or ’6’, and thus, the probability to lose is 5/6.

When accumulated and calculated, the probability for a win is as follows.

Total chances for a win= 1/6 + 1/6 + 1/6 + 1/6 + 1/6 + 1/6= 1 = P(w)

Total chances for a loss= 0 + 1/6 + 2/6 + 3/6 + 4/6 + 5/6 = 15/6 = P(l)

Thus probability is = (P(w))/(P(w)+ P(l)) = 1/(1+15/6 ) = 1/(21/6) = 6/21 = 2/7 = 0.2857142857142857

Legends:

Φ: individually or as a sum of smaller numbers in any permutation.

Any feedback is welcome. Thanks.

a_r
  • 101
-7

I would say since the possible outcomes are $1,2,3,4,5,6$ on the die that the chances of getting exactly $100$ are the same as that of getting any single desired digit on the die once you are in the $94$ to $99$ range. Eventually you will get into that range such that you need either a $1,2,3,4,5$ or $6$ to make a $100$ sum. Then you must get that number to achieve the $100$ sum. So I would say $1$ in $6$ chance at that point. For example, suppose the partial sum is $94$, then you would need a $6$. If you instead roll a $2$ and get $96$ then you would need a $4$. If instead you roll a $3$ then you need a $1$. So anytime you get into the $94$ to $99$ range, you have a $1$ in $6$ chance of hitting exactly $100$ on a single final roll. If you instead consider the probability from the beginning when the partial sum is $0$ or when the partial sum is in the range $94$ to $99$ and considering multiple "final" rolls, then the answer will be different.

So the answer depends on when you start counting the probability but in my case, I simplified and only care about the one final roll that would give you a $100$ sum.

One can also argue/claim that the probability is $0$ if the number of die rolls for the $100$ sum case is less than $17$ rolls. The original question didn't specify how many rolls are allowed or will take place.

Another answer is to interpret the question to mean only 1 die roll and sum (as many times as needed) only the numbers showing. This could be interpreted many ways such as only the top number (in which case $1, 2, 4$, and $5$ would "always" sum to exactly $100$), or all sides except the "hidden" bottom side (assuming it wasn't rolled on a see thru table or equivalent), or even summing all $6$ sides if they are all visible.

Also the question doesn't state only base $10$ of the sum $100$ so if I go past that, I could change to base $11$ and keep rolling (and go for $121$ in base $10$ which is $100$ in base $11$). If I miss that I can go for $144$ which is $100$ in base $12$....

How about if you interpret the question as strictly $1$ die roll and all $6$ faces are visible thus adding up to $21$ and then expressing that sum in base $21^{1/2}$ which would be written as $100$? Then it is $100$% chance of getting it.

I don't know the answer to the more general question yet but I will think about it some.

David
  • 1,702
  • 3
    This is obviously wrong. If you get to, say, 96, you don't have just a single chance to hit 100: you might throw a 1 followed by a 3, for instance. – TonyK Oct 17 '14 at 12:46
  • My answer is not wrong. I specifically stated I am computing the probability of a single final die roll that exactly makes the $100$ sum. I also stated that if you consider multiple "final rolls" the probability will be different. In your case, I would view the partial (accumulated) sum of $97$ and then say there is a $1$ in $6$ chance of rolling a $3$ at that point. A single question can have multiple interpretations so if the interpretation is stated in the answer, then the answer, even though it may be different from other answers, may still be right. – David Oct 17 '14 at 12:50
  • 3
    OP says "I sequentially sum the numbers". This implies to me that there is more than one roll involved. Of course if you decide to answer a question different from the one asked, you may very well get a different answer. – David K Oct 17 '14 at 14:17
  • I answered the question as asked. The first part doesn't state or imply multiple die rolls. I did not answer the 2nd part of the question. The original question can be correctly interpreted as one die roll and then sequentially sum the numbers of the visible faces of that die and then you are done. – David Oct 17 '14 at 14:19
  • 1
    This is incorrect in at least two ways. First, as @TonyK points out, for any of 94, ..., 98, it's possible to get to 100 in two or more rolls, as well as in just one roll. Second, even if you ignore that, it seems unlikely that the probabilities of reaching 94, ..., 99 are equal so the answer would have to involve a calculation such as $\Pr(\text{get to 94})\Pr(\text{roll 6}) + \Pr(\text{get to 95})\Pr(\text{roll 5})+\dots$. – David Richerby Oct 17 '14 at 15:05
  • This approach also completely ignores that, one you're in the 94-99 range, there are rolls that take you past 100. This invalidates your approach of "not caring" about rolls that don't get you to exactly 100. – Dancrumb Oct 17 '14 at 16:21
  • 1
    @David Your intuition is good here, but not quite correct. Try working the problem with a total sum of 8 (which appears to be the smallest non-trivial case) and you will see where the bugaboo occurs –  Oct 17 '14 at 17:07
  • @barrycarter You're right. I should have said that it's not obvious that those probabilities are (asymptotically?) equal so that shouldn't be assumed without proof. – David Richerby Oct 17 '14 at 17:25
  • I do not ignore the fact that the sum can go over $100$. Please read my first comment in this section. The question is worded so vaguely/badly anyway that there are multiple "correct" answers such as $0$ probability since only $1$ die roll is a valid interpretation of the question. – David Oct 17 '14 at 18:30
  • @David Another wording might be "I roll fair 6-sided dice until the total exceeds 100. What is the chance the total was exactly 100 on my penultimate roll?" –  Oct 17 '14 at 21:06
  • 1
    If you feel the question is worded poorly, you should post a comment explaining this or explaining the interpretation you feel is correct, and possibly downvote. That is better practice. If you answer your best guess to the problem, you should explicitly say so at the top but I still would not recommend this. – djechlin Oct 18 '14 at 03:38
  • 5
    Where on earth do you get the idea that the OP did not mean base 10 when s/he wrote 100? Do you think every math paper starts with the sentence "All numbers are written in base 1+1+1+1+1+1+1+1+1+1, where 1 denotes the multiplicative identity"? This answer is borderline a troll. – djechlin Oct 18 '14 at 03:39