Suppose you and your friends are playing hide and seek. In this game, you can randomly search any of your friends. This can be treated as a random experiment. Also, you can assign some points to each of your friends. This is like giving a value to each of the outcomes of an experiment. The more points you have the more is your chance of winning. This is like a random variable. Further, you can also categories your friends on some of their traits say slim or healthy or boy or girl etc. This is like a Binomial variable. In this section, we will study about random variable and its distribution and the Bernoulli trials and binomial distribution.

**Table of content**

### Suggested Videos

## Random Variable

A variable is something which can change its value. It may vary with different outcomes of an experiment. If the value of a variable depends upon the outcome of a random experiment it is a random variable. A random variable can take up any real value.

Mathematically, a random variable is a real-valued function whose domain is a sample space S of a random experiment. A random variable is always denoted by capital letter like X, Y, M etc. The lowercase letters like x, y, z, m etc. represent the value of the random variable.

Consider a random experiment of throwing of two dice. Let the sum of the numbers on the faces of dice be any random variable. This random variable can take up to the values from 2 to 12. We can define more than one random variable on the same sample space. What are the other random variables you can think of?

**Browse more Topics under Probability**

- Introduction to Probability
- Probability of an Event
- Events and its Types
- Events and Its Algebra
- Independent Events
- Conditional Probability
- Basic Theorems of Probability
- Multiplication Theorem on Probability
- Baye’s Theorem
- Random Variable and Its Probability Distribution
- Mean and Variance of Random Distribution

### Types of Random Variables

Random Variables are of two types:

- Discrete Random Variable: A variable which can assume only a countable number of the real values i.e., the value of a discrete random sample.
- Continuous Random Variable: A variable which assumes infinite values of the sample space.

## Probability Distribution of a Random Variable

For any event of a random experiment, we can find its corresponding probability. For different values of the random variable, we can find its respective probability. The values of random variables along with the corresponding probabilities are the probability distribution of the random variable.

The probability distribution is: P(X = x_{i}) = p_{i} for all x = x_{i} and P(X = x_{i}) = 0 for x ≠ x_{i}. The sum of the probability distribution for all possible values of a random variable is always 1. With the help of probability distribution, we can calculate the mean and the variance of a random variable.

### Mean of a Random Variable

Mean of a random variable shows the location or the central tendency of the random variable. The mean shows the average value of a random variable. It is also known as the expectation of a random variable. It is calculated as, E(X) = μ = ∑ x_{i}p_{i}, i = 1, 2, …, n.

or, E(X) = x_{1}p_{1} + x_{2}p_{2} + … + x_{n}p_{n}.

### The Variance of a Random Variable

A variance of a random variable shows the variability of the random variables. It shows the distance of a random variable from its mean. It is calculated as σ_{x}^{2} = Var (X) = ∑ (x_{i }− μ)^{2} p(x_{i}) = E(X − μ)^{2} or, Var(X) = E(X^{2}) − [E(X)]^{2}.

## Bernoulli Trials

A random experiment whose outcomes are only of two types, say success S and failure F, is a Bernoulli trial. The probability of success is taken as p while that of failure is q = 1 − p. Consider a random experiment of items in a sale, they are either sold or not sold. A manufactured item can be defective or non-defective. An egg is either boiled or not boiled.

A random variable X will have Bernoulli distribution with probability p if its probability distribution is

P(X = x) = p^{x} (1 – p)^{1−x}, for x = 0, 1 and P(X = x) = 0 for other values of x.

Here, 0 is failure and 1 is the success.

### Conditions for Bernoulli Trials

- A finite number of trials.
- Each trial should have exactly two outcomes: success or failure.
- Trials should be independent.
- The probability of success or failure should be the same in each trial.

## Binomial Distribution

Suppose a random experiment with exactly two outcomes is repeated n times independently. The probability of success is p and that of failure is q. Assume that out of these n times, we get success for x times and failure for the remaining i.e., n−x times. The total number of ways in which we can have success is ^{n}C_{x}. A random variable X will have a binomial distribution if

P(X = x) = p(x) = ^{n}C_{x} p^{x} q^{n-x},

for x = 0, 1, … , n and P(X = x) = 0 otherwise. Here, q = 1 – p. Any such random variable X is binomial variate. A binomial trial is a set of n independent Bernoullian trials. Conditions for Binomial Distribution:

- Each trial results in only two outcomes i.e., success and failure.
- The number of trials ‘n’ is finite.
- The trials are independent of each other.
- The probability of success, p or that of failure, q is constant for each trial.

## Solved Examples for You

Question: A random variable X has the following probability function:

- Find a.
- Calculate P(0 < X< 4).
- Calculate the mean of the random variable X.

Solution:

- Since ∑ p(x) = 1, ⇒ a+ 2a + 3a + 2a + 2a
^{2}+ 2a^{2}+ 6a^{2}+ 2a = 10a^{2}+ 9a = 1 or, 10a^{2}+ 9a − 1 = 0 or, (k + 1) (10k – 1) = 0 or, k = 1⁄10 or −1. Since, p(x) cannot be negative. So, k = 1⁄10 - We need to calculate the probability for the value of X= x lying in between 0 and 4. So, P(0 < X < 4) = P(X = 1) + P(X = 2) +P(X = 3) = a + 2a+ 3a = 6a = 6⁄10 = 3⁄5
- Mean of X, E(X) = ∑ x
_{i}P(x_{i}) { i =0, 1, … , 7}

⇒ E(X) = (1 × a) + (2 × 2a) + (3 × 3a) + (4 × 2a) + (5 × 2a^{2}) + (6 × 2a^{2}) + (7 × 6a^{2}) + 2a = 64 a^{2}+ 36a = 64⁄100 + 36⁄10

⇒ E(X) = 4.24

Question: P and R play a game and their chances of winning are in the ratio 3:5. Find R’s chance of winning at least four games out of six games played.

Solution: Let p be the probability that R wins the game. We are given, n= 6, p = 5/8 and q = 1 – p = 3/8. By using Binomial Distribution, the probability that out of 6 games, R wins x games is

P(X = x) = p(x) = ^{6}C_{x} P^{x} q^{6 – x}, x = 0, 1, 2, … , 6

The required probability, P(X≥ 4) = ^{6}C_{4} (5⁄8)^{4 }(3⁄8)^{2} + ^{6}C_{5} (5⁄8)^{5} (3⁄8) + ^{6}C_{6} (5⁄8)^{6}

p(x) = 0.5960

**Question: Explain Binomial distribution?**

**Answer:** It is a common distinct distribution that we use in statistics, as opposed to a continuous distribution, such as a normal distribution. In addition, the binomial distribution represents the probability for ‘x’ successes in ‘n’ trials given a success probability ‘p’ for each trial.

**Question: Mention the 4 requirements needed to be a binomial distribution?**

**Answer:** The four requirements for being a binomial distribution are:

- Firstly, the number of observation ‘n’ should be fixed.
- Secondly, every observation should be independent.
- Thirdly, every observation must represent one of the two outcomes i.e. success and failure.
- Lastly, the possibility of ‘success’ p is the same for each outcome.

**Question: Why we use binomial distribution?**

**Answer:** We use it because this model allows us to compute the probability of observing a specified number of ‘successes’ when the process is repetitive at a definite number of times. Besides, it uses factorials.

**Question: What is the main difference between binomial PDF and CDF?**

**Answer:** The main difference between binomial PDF and binomial CDF is that binomial PDF is for single numbers (example: 3 tosses of a coin). On the other hand, binomial CDF is a cumulative probability (example 0 to 3 tosses of a coin).