# Throwing dice a randomly determined number of times

Let $X$ be the number that shows up when rolling a die. Now throw another dice $X$ times $(Y_1, ..., Y_X)$ and calculate the sum $Z = \sum_{k=1}^X Y_k$.

What kind of Stochastic Process is this? How do you calculate mean value and variance of $Z$?

-

## 3 Answers

Look up Wald's Lemma. This lemma is applicable here as $X$ and $Y_k$ are independent. Variance also can be found using this lemma and using the fact that $Z^2=\sum_{k=1}^{X}Y_k^2+\sum_{i<j}Y_i Y_j$ where we have $X(X-1)/2$ terms in the second sum.

-

Does this help find the variance? – opt Oct 28 '11 at 6:42
Yes, so long as $X$ and $Y_k$ are independent which is actually the case here. – Ashok Oct 28 '11 at 7:49
@Ashok Thank you for the answer.  However, I wonder why the Wikipedia article does not mention that independence of X and Y_k is necessary. – artistoex Oct 28 '11 at 15:26
Condition (3) is essentially saying about the amount of dependence is allowed. See the discussion of assumptions below the statement in the Wikipedia page. – Ashok Oct 29 '11 at 3:03

It is a compound probability distribution.

You can marginalize by taking the average of the six pmfs, giving a distribution that looks like $p(1) = 1/6^2,\dots, p(36) = 1/6^7$ and then you can find the variance of this finite marginal distribution directly. For the mean you can just take the mean of the six distribution means.

-

Your random variable is also a branching process $(Z_n)$ observed at time $n=2$, where the offspring distribution is given by a single roll of the die. You want to substitute $n=2$ below, where $\mu$ and $\sigma^2$ are the mean and variance for a single die roll $$\mathbb{E}(Z_n)=\mu^n\quad\mbox{ and }\quad\mathbb{V}(Z_n)={\sigma^2\mu^n(\mu^n-1)\over\mu^2-\mu}.$$

-

Glad to know this interpretation! – Ashok Oct 28 '11 at 13:46
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 17, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9139391183853149, "perplexity_flag": "head"}