<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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,&amp;\textrm{black hair},\\
1,&amp;\textrm{brown hair,}\\ 12,&amp;\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,&amp;x=1\\0.4,&amp;x=3,\\
0.1,&amp;x=6,\\0.2,&amp;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&lt;x&lt;\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&gt;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,&amp;-\infty&lt;x&lt;1,\\ 0.3,&amp;1\leq x&lt;3,\\
0.7,&amp;3\leq x&lt;6,\\ 0.8,&amp;6\leq x&lt;10,\\ 1,&amp;10\leq
x&lt;\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},&amp;x=0,\\
\frac{1}{4},&amp;x=1,\\ \frac{3}{8},&amp;x=2,\\ \frac{1}{4},&amp;x=3,\\
\frac{1}{16},&amp;x=4.\end{array}\right.$&amp; and
&amp;$P_Y(y)=\left\{\begin{array}{ll}\frac{1}{16},&amp;x=5,\\
\frac{1}{4},&amp;x=8,\\ \frac{3}{8},&amp;x=11,\\ \frac{1}{4},&amp;x=14,\\
\frac{1}{16},&amp;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}
</pre></body></html>