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 :
X(HH) = 2, X (HT) = 1, X (TH) = 1, X (TT) = 0