\documentclass[a4paper,12pt]{article}

\begin{document}

\parindent=0pt

\begin{center}

MA181 INTRODUCTION TO STATISTICAL MODELLING

RANDOM VARIABLES

\end{center}

\begin{description}

\item[Definition]
A \textit{random variable} $X$ is a real-valued function defined
on a sample space.

\item[Examples]

\begin{enumerate}

\item
The number on a die,

\item
Height of a 5 year old boy,

\item
$x=\left\{\begin{array}{cc}0,&\textrm{black hair},\\
1,&\textrm{brown hair,}\\ 12,&\textrm{red/fair hair}.
\end{array}\right.$

\end{enumerate}

If the range of $X$ is discrete, i.e. it consists of a finite or
countably infinite number of points, then $X$ is called a
\textit{discrete} random variable, otherwise it is said to be
\textit{continuous}.

\item[Notation]
We let the upper case letter $(X)$ denote the definition of a
random variable and a lower case letter $(x)$ denote a value taken
by it. Thus it makes sense to ask if $X=x$ or if $Y=3$.

\item[Probability function]

\item[Definition]
Let $p(x)=P(X=x)$. Then $p(x)$ is called the \textit{probability
function} (pf) of $X$.

\item[Notes]

\begin{enumerate}

\item
$0\leq p(x)\leq 1$ for all $x$,

\item
$\sum_{\textrm{all }x}p(x)=1.$

\end{enumerate}

\item[Example]
$p(x)=\left\{\begin{array}{ll} 0.3,&x=1\\0.4,&x=3,\\
0.1,&x=6,\\0.2,&x=10.\end{array}\right.$

\item[Distribution function]

\item[Definition]
Let $F(x)=P(X\leq x)$. Then $F(x)$ is called the
\textit{(cumulative) distribution function} (cdf) of $X$.

\item[Notes]

\begin{enumerate}

\item
$F)(x)$ is defined over the whole line, i.e. for
$-\infty<x<\infty$.

\item
$F(x)$ is a monotonic increasing function of $x$ such that
$F(-\infty)=0$ and $F(\infty)=1$.

\item
$F(x)$ is continuous from the right but not necessarily from the
left. So, for $\varepsilon>0,\
F(x)=\lim_{\varepsilon\to0}F(x+\varepsilon)$.

\end{enumerate}

\item[Example]
Consider the example with the probability function defined above.
Then

$F(x)=\left\{\begin{array}{ll}0,&-\infty<x<1,\\ 0.3,&1\leq x<3,\\
0.7,&3\leq x<6,\\ 0.8,&6\leq x<10,\\ 1,&10\leq
x<\infty.\end{array}\right.$

Note that, if $X$ takes integer values, $p(x)=F(x)-F(x-1)$.

\item[Transformations of random variables]
Occasionally we may know the distribution of a random variable $X$
but require the distribution of a function $Y$ of $X$. If the
function is one-one, then the problem is easily solved.

\item[Example]
Let $X$ be the number of heads showing when four coins are tossed
and let $Y=3X+5$ be my winnings. Then $P(Y=y)=P[X=(y-5)/3]$, so
that

\begin{tabular}{ccc}
$p_X(x)=\left\{\begin{array}{ll}\frac{1}{16},&x=0,\\
\frac{1}{4},&x=1,\\ \frac{3}{8},&x=2,\\ \frac{1}{4},&x=3,\\
\frac{1}{16},&x=4.\end{array}\right.$& and
&$P_Y(y)=\left\{\begin{array}{ll}\frac{1}{16},&x=5,\\
\frac{1}{4},&x=8,\\ \frac{3}{8},&x=11,\\ \frac{1}{4},&x=14,\\
\frac{1}{16},&x=17.\end{array}\right.$
\end{tabular}

Many-one functions need a little more care. Suppose $Y=X^2$. Then,
for example, $P(Y=16)=P(X^2=16)=P(X=-4)+P(X=4)$ since there are
two mutually exclusive ways for $Y$ to equal 16. Similarly,
$P(Y\leq25)=P(-5\leq X\leq5)$.

\end{description}

\end{document}
