**Random variables**

We have already learnt about random experiments and formation of sample spaces. In most of these experiments, we were not only interested in the particular outcome that occurs but rather in some number associated with that outcomes as shown in following examples/experiments.

(i) In tossing two dice, we may be interested in the sum of the numbers on the two dice.

(ii) In tossing a coin 50 times, we may want the number of heads obtained.

(iii) In the experiment of taking out four articles (one after the other) at random from a lot of 20 articles in which 6 are defective, we want to know the number of defectives in the sample of four and not in the particular sequence of defective and nondefective articles.

In all of the above experiments, we have a rule which assigns to each outcome of the experiment a single real number. This single real number may vary with different outcomes of the experiment. Hence, it is a variable. Also its value depends upon the outcome of a random experiment and, hence, is called **random variable**. A random variable is usually denoted by X.

If you recall the definition of a function, you will realise that the random variable X is really speaking a function whose domain is the set of outcomes (or sample space) of a random experiment. A random variable can take any real value, therefore, its co-domain is the set of real numbers. Hence, a random variable can be defined as follows :

**Definition 4 : A random variable** is a real valued function whose domain is the sample space of a random experiment.

For example, let us consider the experiment of tossing a coin two times in succession.

The sample space of the experiment is S = {HH, HT, TH, TT}.

If X denotes the number of heads obtained, then X is a random variable and for each outcome, its value is as given below :

More than one random variables can be defined on the same sample space. For example, let Y denote the number of heads minus the number of tails for each outcome of the above sample space S. Then

Thus, X and Y are two different random variables defined on the same sample space S.

**Example** A person plays a game of tossing a coin thrice. For each head, he is given Rs 2 by the organiser of the game and for each tail, he has to give Rs 1.50 to the organiser. Let X denote the amount gained or lost by the person. Show that X is a random variable and exhibit it as a function on the sample space of the experiment.

**Solution** X is a number whose values are defined on the outcomes of a random experiment. Therefore, X is a random variable. Now, sample space of the experiment is

Then and where, minus sign shows the loss to the player. Thus, for each element of the sample space, X takes a unique value, hence, X is a function on the sample space whose range is

**Example** A bag contains 2 white and 1 red balls. One ball is drawn at random and then put back in the box after noting its colour. The process is repeated again. If X denotes the number of red balls recorded in the two draws, describe X.

**Solution** Let the balls in the bag be denoted by w_{1}, w_{2}, r. Then the sample space isThereforeThus, X is a random variable which can take values 0, 1 or 2.

**Probability distribution of a random variable**

Let us look at the experiment of selecting one family out of ten families f_{1}, f_{2} ,…, f_{10} in such a manner that each family is equally likely to be selected. Let the families f_{1}, f_{2}, … , f_{10} have 3, 4, 3, 2, 5, 4, 3, 6, 4, 5 members, respectively.

Let us select a family and note down the number of members in the family denoting X. Clearly, X is a random variable defined as below :Thus, X can take any value 2,3,4,5 or 6 depending upon which family is selected.

Now, X will take the value 2 when the family f_{4} is selected. X can take the value 3 when any one of the families f_{1}, f_{3}, f_{7} is selected.

Similarly,andSince we had assumed that each family is equally likely to be selected, the probability that family f_{4} is selected is 1 /10.

Thus, the probability that X can take the value 2 is 1 /10. We write P(X = 2) = 1 /10

Also, the probability that any one of the families f_{1}, f_{3} or f_{7} is selected isThus, the probability that X can take the value 3 = 3 /10

We writeSimilarly, we obtainandSuch a description giving the values of the random variable along with the corresponding probabilities is called the **probability distribution of the random variable** X.

In general, the probability distribution of a random variable X is defined as follows:

**Definition 5** The probability distribution of a random variable X is the system of numberswhere,The real numbers x_{1}, x_{2},…, x_{n} are the possible values of the random variable X and p_{i} (i = 1,2,…, n) is the probability of the random variable X taking the value x_{i} i.e., P(X = x_{i}) = p_{i}

**NOTE:** If x_{i} is one of the possible values of a random variable X, the statement X = x_{i} is true only at some point (s) of the sample space. Hence, the probability that X takes value x_{i} is always nonzero, i.e. P(X = x_{i}) ≠ 0.

Also for all possible values of the random variable X, all elements of the sample space are covered. Hence, the sum of all the probabilities in a probability distribution must be one.

**Example** Two cards are drawn successively with replacement from a well-shuffled deck of 52 cards. Find the probability distribution of the number of aces.

**Solution** The number of aces is a random variable. Let it be denoted by X. Clearly, X can take the values 0, 1, or 2.

Now, since the draws are done with replacement, therefore, the two draws form independent experiments.

Therefore,andThus, the required probability distribution is