Solution (source code)

= Solution
{c}

A <discrete random variable> on a <probability space> $(\Omega,\mathcal F,\mathbb P)$ is a real-valued <measurable function> $X:\Omega\to\mathbb R$ whose <probability distribution> is concentrated on some finite or countable set $S$:
$$
\boxed{\mathbb P(X\in S)=1,\qquad S\text{ countable}.}
$$
<Measurability> means $\{\omega:X(\omega)\le t\}\in\mathcal F$ for every real $t$. Its <probability mass function> is $p_X(x)=\mathbb P(X=x)$, and $\sum_{x\in S}p_X(x)=1$. Requiring a countable image everywhere, rather than outside a <null set>, is an equivalent convention after harmless modification on a <null set>.