I can't wrap my head around the solution presented for this problem:
Suppose a trial has a success probability $p$, let $X$ be the random variable for the number of trials it takes to stop at $r$ successes. Calculate $E[X]$.
The solution starts by letting $X=G_1+G_2+...+G_r$, where $G_i$ are geometric random variable; and this is where I do not understand. Intuitively it makes sense because the linguistic translation for both sides is the same, but the book I am reading does not provide a mathematical reasoning.
Can someone please tell me the mathematical structure that underlies the division of a random variable? I am trying to learn concepts from an intuitive point of view, as well as a firm and rigorous mathematical one. For this, the intuition is down, but I need the math.
Thank you very much.
A geometric random variable $G_i$ is the number of Bernoulli trials needed to get one success. Your variable $X$ is the number of trials needed to get $r$ successes, and so if these trials are carried out one after another, you must first have success $1$, success $2$, $\ldots$, success $r$; the number of trials to get success $1$ is $G_1$, the number of trials after the first success up to and including success $2$ is $G_2$, etc. Therefore, the total number of trials $X$ performed to get $r$ successes can be written as $X = G_1 + \cdots + G_r$.
Note that the geometric distributions are the memoryless discrete probability distributions, so that after success $1$, the number of trials until success $2$ is a random variable $G_2$ that is independent of and distributed identically to $G_1$; the $G_i$ are i.i.d. random variables.