# Random Variables and its Probability Distributions

In Mathematics, a probability is a branch that deals with the occurrence of an event. It helps to predict how likely the events are going to happen. We have learned that the probability of an event happening is defined as the ratio of number of favourable outcomes to the total number of outcomes. Here, we are going to learn the definition of random variable, probability distribution of random variable, mean and variance of random variable with their formulas and solved examples.

## Random Variable Definition

In probability, a random variable is a real valued function whose domain is the sample space of the random experiment. It means that each outcome of a random experiment is associated with a single real number, and the single real number may vary with the different outcomes of a random experiment. Hence, it is called a random variable and it is generally represented by the letter “X”.

For example, let us consider an experiment for tossing a coin two times.

Hence, the sample space for this experiment is S = {HH, HT, TH, TT}

If X is a random variable and it denotes the number of heads obtained, then the values are represented as follows:

X(HH) = 2, X(HT) = 1, X(TH) = 1, X(TT) = 0.

Similarly, we can define the number of tails obtained using another variable, say Y.

(i.e) Y(HH) = 0, Y(HT) = 1, Y(TH) = 1, Y(TT)= 2.

## Probability Distribution of a Random Variable

The probability distribution of a random variable X for the system of numbers is defined as follows:

X :

x1

x2

xn

P(X) :

p1

p2

pn

$$\sum_{i=1}^{n}p_{i} = 1$$

Where,

pi > 0, and i= 1, 2, 3, …, n.

The real numbers x1, x2, x3,…xn are the possible values of the random variable X, and p1, p2, p3, …pn are the probabilities of the random variable X that takes the value xi.

Therefore, P(X = xi) = pi.

(Note: The sum of all the probabilities in the probability distribution should be equal to 1)

## Mean of a Random Variable

If X is a random variable, and its possible values are x1, x2, x3,…xn associated with the probabilities p1, p2, p3, ..pn, respectively, then the mean of the random variable X is given by the formula:

$$E(X)=\mu = \sum_{i=1}^{n}x_{i}p_{i}$$

The mean of the random variable (µ) is also called the expectation of the random variable E(X).

The mean of the random variable X can also be represented by

E(x) = x1p1+x2p2+x3p3+…..+xnpn

Thus, the mean or the expectation of the random variable X is defined as the sum of the products of all possible values of X by their respective probability values.

## Variance of a Random Variable

Assume that X is a random variable whose possible values are x1, x2, x3,…xn which occurs with the probability p(x1), p(x2), p(x3),…p(xn), respectively, then the variance of the random variable X is given by:

Variance (X) = σx2 = $$\sum_{i=1}^{n}(x_{i}-\mu )^{2}p(x_{i})$$

The above formula can also be expressed as:

σx2 = E(X-µ)2

(or)

Var (X) = E(X2)-[E(X)]2, where E(X2) = $$\sum_{i=1}^{n}x_{i}^{2}\ p(x_{i})$$

Here,

E(x) = µ = Mean or the expectation of the random variable

Var (X) = σx2 = Variance of the random variable.

## Standard Deviation of a Random Variable

From the variance formula, we can easily derive the formula for the standard deviation of a random variable.

For the non-negative number, the standard deviation of the random variable X is given as:

$$\sigma _{x} = \sqrt{Var (X)} = \sqrt{\sum_{i=1}^{n}(x_{i}-\mu )^{2}p(x_{i})}$$

### Examples

Example 1:

Find the probability distribution for the number of doublets in the three throws of a pair of dice.

Solution:

Let X be a random variable and it denotes the number of doublets. Hence, the possible number of doublets are (1, 1), (2, 2), (3, 3), (4, 4), (5, 5), and (6, 6)

Given that, X can take the values 0, 1, 2 or 3.

If a pair of dice is thrown, the number of sample space S is 36.

Therefore, the probability of getting a doublet = 6/36 = ⅙.

The probability of not getting a doublet = 1- (⅙) = ⅚.

Therefore,

The probability of no doublet, P(X=0) = (⅚)(⅚)(⅚) = 125/216.

The probability of one doublet and two non-doublet, P(X=1)

= (⅙)(⅚)(⅚) +(⅚)(⅙)(⅚)+(⅚)(⅚)(⅙)

= 75/216.

The probability of two doublets and one non-doublet, P(x=2)

=(⅙)(⅙)(⅚) + (⅙)(⅚)(⅙) + (⅚)(⅙)(⅙)

= 15/216

The probability of three doublets, P(X=3)

=(⅙)(⅙)(⅙)

= 1/216.

Therefore, the required probability distribution is:

X

0

1

2

3

P(X)

125/216

75/216

15/216

1/216

Verification:

We know that the sum of all the probabilities in the probability distribution is 1.

= (125/216)+(75/216)+(15/216)+(1/216)

= 216/216

=1

Example 2:

Assume that the pair of dice is thrown and the random variable X is the sum of numbers that appears on two dice. Find the mean or the expectation of the random variable X

Solution:

If two dice are thrown, then the total number of sample spaces obtained is 36.

Given that, the random variable X is the sum of numbers that appear on two dice, such as 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 or 12.

Therefore,

P(X= 2) = 1/36

P(X= 3) = 2/36

P(X= 4) = 3/36

P(X= 5) = 4/36

P(X= 6) = 5/36

P(X= 7) = 6/36

P(X= 8) = 5/36

P(X= 9) = 4/36

P(X= 10) = 3/36

P(X= 11) = 2/36

P(X= 12) = 1/36

Hence, the probability distribution of the random variable X is:

X

2

3

4

5

6

7

8

9

10

11

12

P(X)

1/36

2/36

3/36

4/36

5/36

6/36

5/36

4/36

3/36

2/36

1/36

Therefore,

The mean or the expectation of the random variable X is: $$E(X) = \mu = \sum_{i=1}^{n}x_{i}p_{i}$$

= 2(1/36) + 3(2/36) + 4(3/36) + 5(4/36) + 6(5/36) + 7(6/36) + 8(5/36) + 9(4/36) + 10(3/36) + 11(2/36) + 12(1/36)

= (2+6+12+20+30+42+40+36+30+22+12)/36

=7

Therefore, the mean of the random variable X is 7.

### Practice Problems

1. Let the random variable X represent the sum of numbers obtained when two dice are rolled. Find the variance and standard deviation of the random variable X.
2. Determine the mean number of heads in the three tosses of a coin.
3. Assume that X represents the difference between the number of heads and the number of tails obtained when a coin is tossed 6 times. Find all the possible values of X.

Stay tuned with BYJU’S – The Learning App and download the app to learn all Maths-related concepts by exploring more exciting videos.