Random Variables#

A lot of this material is inspired by:

  1. Wiki article on Random Variables

  2. Khan academy videos

  3. MIT OCW course

Assume you toss a coin once, the coin can land either as heads or tails. The outcome is unknown before the throw.

We can denote the sample space as: Ω={H,T}

Now, let us say that if the coin lands as Heads, we win 1$ and we win 0$ if the coin lands as Tails. We can associate a function W with the experiment such that W(Heads) = 1 and W(Tails) = 0

Random Variable

A random variable is a function mapping the sample space (for example: Ω={H,T}) of an experiment to a measurement space E={0,1}. Random variables are represented using capital letters.

While we may have generally seen a random variable W associated with a coin toss taking the values 1 for Heads, 0 for Tails, we might have chosen any other values and still have a random variable. As an example

Y(ω)={100, if ω= heads 20, if ω= tails 

If our experiment is to roll two die (6-faced die) and note the sum of the numbers on the top side.

The sample space for this example is:

S={(1,1),(1,2),,(1,6),(2,1),(2,2),,(2,6),,,,(6,1),(6,2),,(6,6)}

Based on this sample space, we can see that our random variable Z denoting the sum of numbers on the top side takes the values {2,3,4,5,6,7,8,9,10,11,12}

Discrete Random Variable

A discrete random variable can take discrete values. For example, W representing the money we win if we toss a coin randomly. Or, Y the top face of a dice when the dice is rolled. Or, Z denoting the sum of numbers on the top side of two dies.

Let us now take a different example. Our experiment is to pick a person at random from a university and measure their weight. The sample space would be the list of all the people in the university and the random variable T would be weight corresponding to that randomly chosen person. The weight of that person would be a continuous scale.

Continuous Random Variable

A continuous random variable takes continuous values.