POW: Dice Running Total

At QED there are a number of weekly exercises we participate in, to help keep our minds sharp and also just have some fun. One of them is Purdue University’s Math Problem of the Week (POW), a fun event has been going strong since the year 2000. During the spring and fall semesters of each academic year, a new problem is released, similar to those seen in math contests. Participants who mail in the correct answer will have their names and affiliations listed in the official solution that is released later. We’ve archived our writeups for some of our favorite problems at http://qed.ai/fun/#purdue, and thank the administrators for facilitating so many years of interesting problems.

The latest POW problem we like involves rolling a die repeatedly and keeping a running total. We are then challenged with the following question: which of the following numbers is most likely to appear as one of the totals: 2, 6, or 1006?

We can think of at least three different approaches for solving this problem:

dynamic programming

Let be the probability of generating a sum of in rolls. Then

By conditioning on the first roll, we have the recurrence

Lastly, summing over all possible numbers of rolls, the probability of seeing occur is the row sum . Below is a short computer program to fill the table using dynamic programming:

linear recurrence

An alternative approach is to compute these probabilities directly through a closed-form expression. Let be the probability of seeing a sum of . Then, by conditioning on the first roll, we have the recurrence

which has characteristic equation . Denoting the roots of this equation by , the general solution to the recurrence is given by . The coefficients can be solved by supplying six initial conditions, which are easily computed by direct evaluation: , , , , and . Then we have a polynomial expression that yields the same results as the dynamic programming approach.

induction

A slicker approach that does not involve computing any dirty numbers, which we learned from discussions with our associate Dr. Eric Freeman and which was also used in Purdue’s official solution, is to use induction. Starting with initial values , the next value is the average of these initial values, and is smaller than . As we continue computing a running average of the preceding six values, that average will stay below .