A random variable $X$ is a function from a probability space $\Omega$ into $I\!R$
Note: this is perfectly legitimiate if $\Omega$ is finite or countable.
The sum of the values in a roll of two dice is a function from a set $\Omega$ with $36$ outcomes to the finite set of integeres $2,3, .. 12$
$\{X = x\}$ is an event
Toss a coin $n$ times independently. Probability of a head is always $p\in (0,1)$
Let $X_i =1 $ if ith toss is heads, and $X_i=0$ if toss is tails.\
So we see $P_{X_i}(1) = p$ and $P_{X_i}(0) = 1- p$
This $X_i$ is called a Bernoulli random variable. We can interpret $X_i = 1$ as a success at trial $i$. Moreover, those $X_i$'s are all independent of each other.
Now, let $X=\#\text{of successes (heads)}$ in these $n$ independet trials (tosses). X is also a random variabkle, which can take the values $0,1,2, .. n$. This $X$ is called a binomial with parameters $n$ and $p$.
Let us find the binomial $X$'s prob mass $P_X(k) = \left\{\text{exactly }k\text{ successes in }n\text{ trials}\right\}$
the sum of $n$ independent Bernoulli random variables with parameter $p$ is a binomial random variable with parameters $n$ and $p$
where $Y_i\sim Geometric()$ and therefore $Y\sim NegativeBinomial$
For a sequence of failure/success: $001010001000$
$Y_1 = 3~\ ~Y_2=2~\ ~Y_3=4,...$
There is another convention, that they define $Y'_i=Y_i-1$, so in this other convention: $Y'_1=2, Y'_2=1, Y'_3=3$
Therefore, the negative binomial under this other convention is $Y'=Y-n$
In [ ]: