# Introduction to Random Variables

## Random Variable

A

random variableis a mapping

X : Ω→R

that assigns a real number X(ω) to each outcome ω

Getting proper intuitions of X is very important to understand probability. Let us try understanding random variables with an example.

Let the experiment be flipping a coin twice and X be the number of heads.

Then P(X=0) = P({TT}) = 1/4, P(X=1) = P({HT, TH}) = 1/2 and P(X=2) = P({HH}) = 1/4.

We summarize the information as follows:

ω | P({ω}) | X(ω) |

TT | 1/4 | 0 |

TH | 1/4 | 1 |

HT | 1/4 | 1 |

HH | 1/4 | 2 |

x | P(X = x) |

0 | 1/4 |

1 | 1/2 |

2 | 1/4 |

Note that X denotes random variable and x denotes a possible value of X.

## Distribution Function and Probability function

### Cumulative Distribution Function

The cumulative distribution function (or distribution function), CDF, is the function

F_{X}: R→[0,1] defined by

F_{X}(x) = P(X ≤ x)

The** cumulative distribution function** of x is the sum of probabilities of all those values of random variables that are less than or equal to x. Every CDF is non-decreasing and right continuous. If X is discrete and is defined for x1, x2, … then CDF of X will be discontinuous at points x1, x2, …

CDF for the experiment of flipping a coin twice.

### Probability Function or Probability Mass Function

X is discrete if it takes countably many values {x

_{1}, x_{2}, …}

We define the probability function or probability mass function for X byf

_{X}(x) = P(X = x)

Here, **f _{X}(x) ≥ 0** for all x ∈ R and

**∑**. The CDF of X is related to f

_{i}f_{X}(x_{i}) = 1_{X}by

We will use f_{X} and F_{X} simply as f and F. Try writing and plotting probability function for flipping a coin experiment whose CDF is shown in previous section.

### Probability density function

A random variable X is continuous if there exists a function f_{X}such that f_{X}(x) ≥ 0 for all x,and for every a ≤ b,

The function f_{X}is called the probability density function (PDF). We have thatand

f_{X}(x) = F’_{X}(x) at all points x at which F_{X}is differentiable.

Suppose that X has a PDF

clearly f_{X}(x) ≥ 0 and f_{X}(x)dx = 1. A random variable with this density is said to have Uniform (0,1) distribution. The CDF is given by