Random Variables

In a random experiment, the outcomes may not always be numerical and we maybe interested in some consequences of its random outcome. These outcomes maybe associated with some numerical values of interest using the notation of a random variable.

Definition 1 (Random variable) :

A random variable is a function X:ΩRX : \Omega \to \mathbb{R} with the property that {ωΩ:X(ω)x}F\{ \omega \in \Omega : X(\omega) \leq x \} \in \mathcal{F} for each xRx \in \mathbb{R}. Random variables map Ω\Omega into R\mathbb{R}.


Figure 1: RV associated with a sample point


Figure 2: RV associated with a coin toss exp

Example 1 A fair coin is tossed twice. The sample space can be written as Ω={HH,HT,TH,TT}\Omega = \{HH, HT, TH, TT\}. For ωΩ\omega \in \Omega, let X(ω)X(\omega) be the number of heads in ω\omega so X(HH)=2,X(HT)=X(TH)=1,X(TT)=0X(HH) = 2, X(HT) = X(TH) = 1, X(TT) = 0 . This function X:Ω(R)X : \Omega \rightarrow \mathbb(R) is a random variable with respect to the σ\sigma algebra F={ϕ,Ω,{TT},{HH,HT,TH},{HH},{HT,TH,TT}}\mathcal{F} = \{ \phi, \Omega, \{ TT \}, \{ HH, HT, TH \}, \{ HH \}, \{ HT, TH, TT \} \} ,

Example 2 Let WW be a random variable based on the experiment where a person AA is gambling BB rs amount on the result of the experiment. He gambles cumalatively so that his fortunes double everytime a head appears and is annhilated when a tail appears. Lets assume that the person AA has gambled twice. The sample space can be written as Ω={HH,HT,TH,TT}\Omega = \{HH, HT, TH, TT\}. For ωΩ\omega \in \Omega and the sigma algebra F={ϕ,Ω,{TT,TH,HT},{HH}}\mathcal{F} = \{ \phi, \Omega, \{ TT, TH, HT \}, \{ HH \}\} , so W(HH)=4B,W(HT)=W(TH)=W(TT)=0W(HH) = 4B, W(HT) = W(TH) = W(TT) = 0 .

After the experiment is done and the outcome ωΩ\omega \in \Omega is known, a random variable X:ΩRX : \Omega \to \mathbb{R} takes some value.

Definition 2 (Cumulative Distribution Function) :

The distribution function of a random variable XX is the function FX:R[0,1]F_X : \mathbb{R} \to [0, 1] given by FX(x)=P(Xx)F_X(x) = \mathbb{P}(X \leq x)

  • For Example 1, if PX(x)=1/4\mathbb{P}_X(x) = 1/4, for all xXx \in X

FX(x)={0x<0140x<1341x<21x2 \begin{equation} F_{X}(x) = \begin{cases} 0 & \text{$x < 0$}\\ \frac{1}{4} & \text{$0 \leq x < 1$}\\ \frac{3}{4} & \text{$ 1 \leq x < 2$}\\ 1 & \text{$x \geq 2$} \end{cases} \end{equation}


Figure 3: Distribution for Example 1

  • For Example 2, if PW(ω)=1/4\mathbb{P}_W(\omega) = 1/4, for all ωW\omega \in W

FW(ω)={0ω<0340ω<41ω4 \begin{equation} F_{W}(\omega) = \begin{cases} 0 & \text{$\omega < 0$}\\ \frac{3}{4} & \text{$ 0 \leq \omega < 4$}\\ 1 & \text{$\omega \geq 4$} \end{cases} \end{equation}


Figure 4: Distribution Function for Example 2

The CDF FF has the following properties

  • limxF(x)=0\lim_{x \to - \infty} F(x) = 0 , limxF(x)=1\lim_{x \to \infty} F(x) = 1
  • if x<yx < y. then F(x)F(y)F(x) \leq F(y)
  • FF is a right continous, that is F(x+h)F(x)F(x + h) \to F(x) as h0h \to 0

FF is the cumulative distribution function of some random variables if and only if it satisfies the above 3 properties.

Suppose FF is a CDF of XX. Then

  • P(X>x)=1F(x)\mathbb{P}(X > x) = 1 - F(x)
  • P(x<Xy)=F(y)F(x)\mathbb{P}(x < X \leq y) = F(y) -F(x)
  • P(X=x)=F(x)lim(h0+)F(xh)\mathbb{P}(X = x) = F(x) - \lim_{(h \to 0^+)} F(x-h)

Definition 3 (Inverse Image of a Random Variable) :

For a random variable X:ΩRX : \Omega \to \mathbb{R}, the inverse image of a set BRB \subseteq \mathbb{R} is the set

X1(B)={ωΩX(ω)B}. \begin{equation} X^{-1}(B) = \{\omega \in \Omega \mid X(\omega) \in B\}. \end{equation}

For sets of the form B=(,c]B = (-\infty, c], the inverse image is

X1((,c])={ωΩX(ω)c}. \begin{equation} X^{-1}((-\infty, c]) = \{\omega \in \Omega \mid X(\omega) \le c\}. \end{equation}

  • For Example: Let Ω={ω1,ω2,ω3}\Omega = \{\omega_1,\omega_2,\omega_3\} and let XX be a random variable defined as

X(ω1)=0,X(ω2)=1,X(ω3)=2. \begin{equation} X(\omega_1)=0,\quad X(\omega_2)=1,\quad X(\omega_3)=2. \end{equation}

For the set B=(,1]B = (-\infty,1], the inverse image is X1((,1])={ω1,ω2} \begin{equation} X^{-1}((-\infty,1]) = \{\omega_1,\omega_2\} \end{equation}