# Random Variable

A*random variable*is a function defined on a sample space associated with a random experiment that assigns a real number to each element in the sample space.

A random variable can be discrete or continuous.

A random variable described on a discrete sample space such as that of tossing coins, throwing dice, deck of cards, etc. is known as a *discrete random variable*. Here the values are clearly defined and are finite in number.

A random variable described on a continuous sample space such as that of height, weight, etc. is known as a *continuous random variable*. Here the values are not clearly defined as the variable may take up any value in the continuous sample space.

# Mathematical Expectations

Let a random variable*X*assume the values

*x*

_{1},

*x*

_{2},

*x*

_{3}, ...

*x*with probabilities

_{n}*p*

_{1},

*p*

_{2},

*p*

_{3}, ...

*p*respectively. Then the

_{n }*mathematical expectation E(X)*will be the sum of the product of the variable values and their corresponding probabilities.

*i.e.*, *E*(*X*) = *p*_{1 }*x*_{1} + *p*_{2 }*x*_{2} + *p*_{3} *x*_{3} + â€¦ *p _{n }x_{n}*

Mathematical expectation of a function of random variable *x* is given by

The *variance* of the random variable *x* in terms of its expectation is given by *V*(*x*) = *E*(*x*^{2}) â€“ [*E*(*x*)]^{2}

*X*denote the number of heads obtained.

The sample space

*S*= {

*TT*,

*HT*,

*TH*,

*HH*}

Then,

*X*is a random variable which takes the value 0, 1 and 2 with respective probabilities,

The mathematical expectation of the number of heads is

*V*(

*x*) =

*E*(

*x*

^{2}) â€“ [

*E*(

*x*)]

^{2}

^{}

# Important properties of expectation:

- Expectation of a constant is a constant.
*i.e.*,*E*(*k*) =*k* - Expectation of the sum of two random variables is the sum of their expectations
*i.e.*,*E*(*x*+*y*) =*E*(*x*) +*E*(*y*) - Expectation of the product of two independent random variables is the product of their expectations
*i.e.*,*E*(*x*Ã—*y*) =*E*(*x*) Ã—*E*(*y*) - Expectation of the product of a constant and a random variable is the product of the constant and the expectation of the random variable
*i.e.*,*E*(*kx*) =*kE*(*x*)