You are here: Home » Communication Engineering » Random Variables – Definition, Classification, CDF, PDF with easy examples

Random Variables – Definition, Classification, CDF, PDF with easy examples

What are Random Variables – Definition

Before discussing Random Variables, we need to know some basic definitions:

Sample Space : Sample space may be defined as a collection of all the possible, separately identifiable outcomes of a random experiment.

Example of Sample Space : If you toss a coin, then output may come as head or tail. So the sample space of tossing a coin is

S = { H, T}

Sample space is denoted by S. One more example of Sample space : If you roll a dice, then output may come 1,2,3,4,5 or 6. So the sample space of Rolling a dice is

S : { 1,2,3,4,5,6} Random Experiment definition : An experiment is called as random experiment if the outcome of experiment cannot be predicted.

Examples of Random Experiment:

• Tossing a coin
• Rolling a dice
• Drawing a card from a deck

Now we come to the main Topic Random Variable.

Random Variable is used to signifying a rule by which a real no. is assigned to each possible outcome of an experiment.

Example of a Random Variable

Suppose we perform an experiment of measuring a random voltage V between a set of terminals and find the no. of possible outcomes V1, V2, V3 or V4. Then for identifying symbols for the outcomes we use X(V1), X(V2), or X(V3).

So This X() is random variable and it is defining a rule that whatever value of voltage is coming will be the value of Random Variable.

Types of Random Variable

There are two types of Random Variable.

• Discrete Random Variable
• Continuous Random Variable

Definition of Discrete Random Variable : If in any finite interval, X() assumes only a finite no of outcomes or if the outcomes of random variable is countable, then the random variable is said to be Discrete random variable.

Example of discrete random variable:

• tossing a coin
• rolling a dice and many more

Definition of Continuous Random Variable : If in any finite interval, X() assumes infinite no of outcomes or if the outcomes of random variable is not countable, then the random variable is said to be Discrete random variable.

Example of continuous random variable:

the noise voltage generated by an electronic amplifier has a continuous amplitude. This means that sample space of the noise voltage amplitude is continuous and uncountable.

Probability Distribution :

Probability Distribution in random variables can be done by two types.

• Cumulative Distribution Function ( CDF)
• Probability Density Function (PDF)

Some times PDF is also called Probability Distribution Function in case of Discrete random variables. So don’t be confused if anyone says it like this.

Now we will study PDF and CDF one by one with example and you will also get to know the difference between CDF and PDF.

Cumulative Distribution Function ( CDF)

It is defined as the probability that the random variable X takes values less than or equal to x.

or

the probability that the outcome of an experiment will be one of the outcomes for which X ≤ x.

x is a dummy variable or any real no. ranging from – ∞ to ∞.

CDF is represented by Fx(x) and is equal to

Fx(x) = P { X ≤ x }

Let us consider CDF by an example

Example of Cumulative Distribution Function ( CDF)

Let us take an example of a dice which has 6 outcomes, it mat be either 0,1,2,3,4,5 or 6. The probability of any outcome will be 1/6. But when we talk about CDF, then the probability of coming 1 is 1/6. But for outcome 2, the probability will not be same i.e 1/6. It will be 1/6 plus previous value of probability i.e probability of outcome 1 or simply individual probabilty of outcome 2 + previous probability of outcome 1 = 1/6 + 1/6 = 1/3

Similarly CDF of outcome 3 = CDF of outcome 2 + probability of 3

= 1/3+1/6 = 1/2

CDF of outcome 4 = CDF of outcome 3 + probability of 4

= 1/2 + 1/6 = 2/3

CDF of outcome 5 = CDF of outcome 4 + probability of 5

= 2/3 + 1/6 = 5/6

CDF of outcome 6 = CDF of outcome 5 + probability of 6

= 5/6 + 1/6 = 1

The CDF graph is shown below. Properties of Cumulative Distribution Function ( CDF)

(1) CDF is Non Decreasing.

As we have seen in the above example, that as the random variables are increasing CDF is also increasing.It never decreases.

(2) 0 ≤ Fx(x) ≤ 1

As we have seen in the above example that CDF value always lies in between 0 to 1.

(3) F ( – ∞ ) = 0 and F ( ∞ ) = 1

It states that F ( – ∞ ) includes no possible event or probability of occurrence of any particular event is 0.

F ( ∞ ) states that for certain event or probability of occurrence of any particular event is 1.

Solved example of Cumulative Distribution Function ( CDF)

Question

Consider the experiment that consists in the tossing of 3 coins simultaneously. The random variable is defined as assigning 0 to tail and 1 to head and then adding the no.

Determine

1. sample space
2. define and rewrite the random variable
3. calculate the various probabilities
4. compute CDF

Solution:

Part 1 : Sample space S = { ttt, tth, tht, htt, thh, hth, hht, hhh}

or

S = { 000, 001, 010, 100, 011,101, 110,111}

Part 2 :

Now we have to add the digits as said in the random variable definition

X = {0, 1, 2, 3}

or we can say in adding digits we are getting these 4 outcomes

0,1,2,3

Part 3 :

P ( X= 0)       =  P (000) = P(0) x P(0) x P(0) = 1/2 x 1/2 x 1/2 = 1/8     ( As probability of coming 0 or 1 is 1/2)

P ( X = 1)      =   P (001) + P (010) + P (100) = 1/8 + 1/8 + 1/8 = 3/8

P ( X = 2)      =   P (011) + P (101) + P (110) = 1/8 + 1/8 + 1/8 = 3/8

P ( X = 3)      =   P (111) = 1/2 x 1/2 x 1/2 = 1/8            ( As probability of coming 0 or 1 is 1/2)

Part 4 :

CDF Calculation

Fx(0) = 1/8     ( Probability of P(000)  )

Fx(1) = Probability of outcome 1 + CDF of previous value i.e cdf of 0

= 3/8 + 1/8 = 1/2

Fx(2) = Probability of outcome 2 + CDF of previous value i.e cdf of 1

= 3/8 + 1/2 = 7/8

Fx(3) = Probability of outcome 3 + CDF of previous value i.e cdf of 2

= 1/8 + 7/8 = 1