• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

Rolling a die

radosr

Baruch MFE Faculty
Joined
7/18/07
Messages
660
Points
73
You roll a fair n-sided die repeatedly and sum the outcomes. What is the expected number of rolls until the sum is a multiple of n?
 
Look at what you have me doing Rados... on a Friday night!

Let (Y) be the number of rolls it takes until the sum equals a multiple of (n). Let (X_i) be the results of the rolls. Let's think about (P(Y=k)).

The first roll is a multiple of (n) only when it lands on (n), so (P(Y=1) = \frac{1}{n}).

For (Y=2), the first roll cannot land on (n), so there are (n-1) choices. The second roll has to land on the unique number such that (X_1 + X_2 = n). Therefore (P(Y=2) = \frac{n-1}{n} \frac{1}{n}).

Someone more elegant than me can explain that (P(Y=k) = \frac{(n-1)^{k-1}}{n^k}).

Therefore (\mathbb{E}[Y] = \sum_{k=1}^{\infty} k P(Y=k) = \sum_{k=1}^{\infty} k \frac{(n-1)^{k-1}}{n^k}).

Note that (\frac{d}{dn} \bigg( \frac{n-1}{n} \bigg)^k = \frac{1}{n} k \frac{(n-1)^{k-1}}{n^k}.)

Therefore (\mathbb{E}[Y] = \sum_{k=1}^{\infty} n \frac{d}{dn} \bigg( \frac{n-1}{n} \bigg)^k = n \frac{d}{dn} \sum_{k=1}^{\infty} \bigg( \frac{n-1}{n} \bigg)^k = n \frac{d}{dn} \bigg( \frac{1}{1-\frac{n-1}{n}} - 1 \bigg) = n \frac{d}{dn} (n-1) = n.)
 
Correct answer but not that trivial, let (E_n) be the event of multiple of n, and in general E(j) be the event of residue j mod n.
then we have n equations:

(E(j)= 1/n+1/n\sum_{k\neq j} (E(k) +1))

then the solution is E(j)==n, for any j.
 
Note that E(i) = E(j) =E for any i, j, rearrange and you have what I wrote.
 
Easier solution: consider the cumulative sum of the dice rolls modulo n. After each roll, there is only one way to get this number to 0 modulo n. This problem is thus equivalent to computing the expected value of a geometric distribution with parameter p = 1/n, which is just n.
 
Back
Top