1
$\begingroup$

I have a probability question which boils down to a combinatoric question.

$\textbf{Problem Statement:}$ You have a dice with sides with numbers labeled $[1\dots k]$, with equal probability $(\frac{1}{k})$ of being rolled. Call the value of each roll $d_i \in [1\dots k]$, and $s_i= \sum_{j=1}^i d_j$ the running sum. I want the expected number of times that $s_i$ divides $k$ in a total of $r$ rolls.


So I call $X$ the R.V. that is the number of times that $s_i$ divides $k$. Then $X$ = $\sum_{i=1}^r \mathbb{1}_{k \vert s_i}$, and so $\mathbb{E}[X] = \sum_{i=1}^r \mathbb{P}(s_i \vert k) = \sum_{i=1}^r \sum_{m=1}^i \mathbb{P}(s_i = mk)$ (the inner summand is only up to $i$ because the support of $s_i$ is only up to $ik$).

Now I must evaluate $\mathbb{P}(s_i = mk)$. This is equal, using the law of conditional probability, to $\sum_{n_1 = 1}^k \mathbb{P}(s_{i-1} = mk - n_1)\mathbb{P}(s_i =n_1) = \frac{1}{k}(\sum_{n_1=1}^k \mathbb{P}(s_{i-1} = mk - n_1))$. We recurse back to the base case, and it is equal to $\frac{1}{k^{i-1}} \sum_{n_1 = 1}^k \sum_{n_2 = 1}^k \dots \sum_{n_{i-1} = 1}^k \mathbb{P}(s_1 = mk -\sum_{j=1}^{i-1}n_j)$.

Now, essentially now I must count the number of times $(mk -\sum_{j=1}^{i-1}n_j)$ lies in the support of $s_0$ which is $[1,\dots,k]$. So I want to count the number of times $1 \leq (mk -\sum_{j=1}^{i-1}n_j) \leq k$, or $(mk-1) \leq \sum_{j=1}^{i-1}n_j \leq (m+1)k$, where each $n_j \in [1,\dots,k]$. I am stuck here. If I could somehow arrive at an inequality to when $\sum_{j=1}^{i-1}n_j \leq a$ for some $a$, with restriction on $n_j$, this would be greatly helped. Thanks.

$\endgroup$
3
  • $\begingroup$ Two questions: (a) $s_i=mk$ means $k$ divides $s_i$, not $s_i$ divides $k$. Which one of these do you mean? (b) If you do mean $k\mid s_i$, won't $X$ have infinite expectation? $\endgroup$
    – joriki
    Jul 5, 2018 at 5:25
  • $\begingroup$ @joriki sorry the division notation always messes me up. The statement of the problem is, exactly, "What is the expected number of different values of i where $s_i$ is divisible by $k$?" I interpreted that to mean that $s_i = mk$ for some m. So i guess that does mean $k \vert s_i$. In addition, I read t he problem again, and I saw that there is a finite number of total rolls, r, so the sum should only be up to r. I will fix this. $\endgroup$
    – blanchey
    Jul 5, 2018 at 5:37
  • $\begingroup$ Wait, do you want $s_i | k$ or $k | s_i$? Your notation is inconsistent. $\endgroup$ Jul 5, 2018 at 6:15

2 Answers 2

1
$\begingroup$

On each roll, the probability of landing on a multiple of $k$ is $\frac1k$. Thus, by linearity of expectation,

$$\mathbb E[X]=\frac rk\;.$$

$\endgroup$
1
  • $\begingroup$ oh my gosh... that was really it all along... cheers to you $\endgroup$
    – blanchey
    Jul 5, 2018 at 5:46
1
$\begingroup$

From your question I thought you wanted the expected number of times $s_i | k$. Apparently that's not what you wanted, but I may as well answer that original question since I've thought about it. Here the number of rolls can be infinite, since after $k$ rolls your sum will be at least $k$ so you can't have any more divisors of $k$ in the partial sums.

You can take a generating function approach here. If $a_{i,j}$ is the number of ways of rolling $i$ dice so that they sum to $j$, then $$\sum_{j=0}^\infty a_{i,j} x^j = (x + x^2 + \cdots + x^k)^i = \Big(\frac{x(1 - x^k)}{1-x}\Big)^i.$$

So for a fixed divisor $d$ of $k$, $P(s_i = d)$ is $a_{i,j} / k^i$, or the coefficient $x^d$ in $$\Big(\frac{x(1 - x^k)}{k(1-x)}\Big)^i.$$

Then by linearity of expectation the expected number of times $s_i = d$ is the coefficient of $x^d$ in $$\sum_{i=0}^\infty \Big(\frac{x(1 - x^k)}{k(1-x)}\Big)^i = \frac{k(1-x)}{k(1-x) - x(1 - x^k)}.$$

Now extract the coefficient of $x^d$ for all divisors $d$ of $k$ and add them to get the expected number of times $s_i | k$. e.g., for $k=9$ I compute an expectation of $196190821/387420489 \approx 0.5064.$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .