Mathematical Expectation and random variable | Its 5 Important Properties

Mathematical Expectation and random variable    

     The mathematical expectation plays very important role in the probability theory, the basic definition and basic properties of mathematical expectation already we discussed in previous some articles now after discussing the various distributions and types of distributions, in the following article we will get familiar with some more advanced properties of mathematical expectation.

Expectation of sum of random variables | Expectation of function of random variables | Expectation of Joint probability distribution

     We know the mathematical expectation of random variable of discrete nature is

E[X]=\sum_{x} xp(x)

and for the continuous one is

E[X]=\int_{-\infty}^{\infty} xf(x)dx

now for the random variable X and Y if discrete then with the joint probability mass function p(x,y)

expectation of function of random variable X and Y will be

E\left [ g(X,Y) \right ]=\sum_{y}\sum_{x}g(x,y)p(x,y)

and if continuous then with the joint probability density function f(x, y) the expectation of function of random variable X and Y will be

E\left [ g(X,Y) \right ]=\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} g(x,y)f(x,y) dxdy

if g is addition of these two random variables in continuous form the

E\left [ X +Y \right ]=\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} (x + y)f(x,y) dxdy

=\int_{-\infty}^{\infty} \int_{-\infty}^{\infty} x f(x,y) dydx + \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} y f(x,y) dxdy

=\int_{-\infty}^{\infty} x f_{X}(x) dx + \int_{-\infty}^{\infty} yf_{Y}(y) dy

=E[X] + E[Y]

and if for the random variables X and Y we have

X \geq Y

then the expectation also

E[X] \geq E[Y]


A Covid-19 hospital is uniformly distributed on the road of the length L at a point X, a vehicle carrying oxygen for the patients is at a location Y which is also uniformly distributed on the road, Find the expected distance between Covid-19 hospital and oxygen carrying vehicle if they are independent.


To find the expected distance between X and Y we have to calculate E { | X-Y | }

Now the joint density function of X and Y will be

f(x,y)=\frac{1}{L^{2}} , \ \ 0 < x < L, \ \ 0 < y < L


E\left [ g(X,Y) \right ] =\int_{-\infty}^{\infty}\int_{-\infty}^{\infty} g(x,y)f(x,y)dxdy

by following this we have

E\left [ \left | X -Y \right | \right ]=\frac{1}{L^{2}} \int_{0}^{L} \int_{0}^{L} \left | x-y \right | dy dx

now the value of integral will be

\int_{0}^{L} \left | x-y \right | dy =\int_{0}^{x} (x-y)dy +\int_{x}^{L} (y-x)dy

=\frac{x^{2}}{2} + \frac{L^{2}}{2} -\frac{x^{2}}{2} -x(L-x)

= \frac{L^{2}}{2} +x^{2} -xL

Thus the expected distance between these two points will be

E \left [ \left | X -Y \right | \right ] =\frac{1}{L^{2}}\int_{0}^{L}\left ( \frac{L^{2}}{2} +x^{2} -xL \right )dx =\frac{L}{3}

Expectation of Sample mean

  As the sample mean of the sequence of random variables X1, X2, ………, Xn with distribution function F and expected value of each as μ is

\overline{X} =\sum_{i=1}^{n}\frac{X_{i}}{n}

so the expectation of this sample mean will be

E \left [ \overline{X} \right ]=E \left [ \sum_{i=1}^{n}\frac{X_{i}}{n} \right ]

=\frac{1}{n} E \left [ \sum_{i=1}^{n} X_{i} \right ]

=\frac{1}{n} \sum_{i=1}^{n} E [X_{i}]

=\mu \ \ since \ \ E [X_{i}] \equiv \mu

which shows the expected value of sample mean is also μ.

Boole’s Inequality

                Boole’s inequality can be obtained with the help of properties of expectations, suppose the random variable X defined as

X=\sum_{i=1}^{n} X_{i}


X_{i}= \begin{cases} 1 \ \ if \ \ A_{i} \ \ occurs \\ 0 \ \ \ \ otherwise \end{cases}

here Ai ‘s are the random events, this means random variable X represents the occurrence of the number of events Ai and another random variable Y as

Y= \begin{cases} 1 \ \ if \ \ X\geq 1 \ \ \\ 0 \ \ \ otherwise \end{cases}


X\geq Y

and so is

E[X] \geq E[Y]

now if we take the value of random variable X and Y these expectation will be

E[X] = \sum_{i=1}^{n} E\left [ X_{i} \right ] =\sum_{i=1}^{n} P(A_{i})


E[Y] = P \left ( \ \ at \ \ least \ \ one \ \ of \ \ the \ \ A_{i} \ \ occurs \right )=P\left ( \bigcup_{i=1}^{n} A_{i} \right )

substituting these expectation in the above inequality we will get Boole’s inequality as

P\left ( \bigcup_{i=1}^{n} A_{i} \right ) \leq \sum_{i=1}^{n} P\left ( A_{i} \right )

Expectation of Binomial random variable | Mean of Binomial random variable

  We know that the binomial random variable is the random variable which shows number of successes in n independent trials with probability of success as p and failure as q=1-p, so if

X=X1 + X2+ …….+ Xn


X_{i}= \begin{cases} 1 \ \ if \ \ the \ \ ith \ \ trail \ \ is \ \ a \ \ success  \\  0   \ \   if \ \ the \ \ ith \ \ trail \ \ is \ \ a \ \ failure \end{cases}

here these Xi ‘s are the Bernoulli and the expectation will be

E(X_{i}) =1(p) +0(1-p)=p

so the expectation of X will be

E[X] =E[X_{1}] + E[X_{2}] + \cdot \cdot \cdot + E[X_{n}]

Expectation of Negative binomial random variable | Mean of Negative binomial random variable

  Let a random variable X which represents the number of trials needed to collect r successes, then such a random variable is known as negative binomial random variable and it can be expressed as

X =X_{1} + X_{2} + \cdot \cdot \cdot + X_{r}

here each Xi denote the number of trials required after the (i-1)st success  to obtain the total of i successes.

Since each of these Xi represent the geometric random variable and we know the expectation for the geometric random variable is

E[X_{i}] =\frac{1}{p}


E[X] =E[X_{1}] + \cdot \cdot \cdot \cdot \cdot + E[X_{r}]=\frac{r}{p}

which is the expectation of negative binomial random variable.

Expectation of hypergeometric random variable | Mean of hypergeometric random variable

The expectation or mean of the hypergeometric random variable we will obtain with the help of a simple real life example, if n number of books are randomly selected from a shelf containing N books of which m are of mathematics, then to find the expected number of mathematics books let X denote the number of mathematics books selected then we can write X as

X =X_{1} + X_{2} + \cdot \cdot \cdot + X_{m}


X_{i}= \begin{cases} 1, \ \ if \ \ ith \ \ mathematics \ \ book \ \ is \ \ selected \\  0, \ \ \ \ othewise \end{cases}


E[X_{i}] = P\left \{ X_{i}=1 \right.\left. \right \}



which gives

E[X]=E[X_{1}] + \cdot \cdot \cdot \cdot +E[X_{m}]=\frac{mn}{N}

which is the mean of such a hypergeometric random variable.

Expected number of matches

   This is very popular problem related to expectation, suppose that in a room there are N number of people who throw their hats in the middle of the room  and all the hats are mixed  after that each person randomly choose one hat then the expected number of people who select their own hat we can obtain by letting X to be the number of matches so

X=X_{1}+ X_{2} + \cdot \cdot \cdot \cdot +X_{N}


X_{i}= \begin{cases} 1, \ \ if \ \ the \ \ ith \ \ person \ \ selects \ \ his \ \ own \ \ hat  \\  0, \ \ \ \ othewise \end{cases}

since each person has equal opportunity to select any of the hat from N hats then

E[X_{i}]=P\left { X_{i}=1 \right.\left. \right }=\frac{1}{N}


E[X]=E[X_{1}] + \cdot \cdot \cdot \cdot \cdot + E[X_{n}] = \left (\frac{1}{N} \right ) N =1

which means exactly one person on average choose his own hat.

The probability of a union of events

     Let us obtain the probability of the union of the events with the help of expectation so for the events Ai

X_{i}= \begin{cases} 1, \ \ if \ \ A_{i} \ \ occurs \\   0, \ \  othewise \end{cases}

with this we take

1- \prod_{i=1}^{n} (1-X_{i})= \begin{cases} 1, \ \ if \ \ A_{i} \ \ occurs \\  0, \ \ othewise \end{cases}

so the expectation of this will be

E\left [ 1- \prod_{i=1}^{n} (1-X_{i}) \right ]= P\left ( \bigcup_{i=1}^{n} A_{i} \right )

and expanding using expectation property as

P\left ( \bigcup_{i=1}^{n} A_{i} \right ) =E\left [ \sum_{i=1}^{n} X_{i} - \sum \sum_{i< j} X_{i}X_{j} + \sum \sum_{i< j< k}\sum X_{i}X_{j}X_{k} - \cdot \cdot \cdot \cdot \cdot \cdot \cdot + (-)^{n+1}X_{1} \cdot \cdot \cdot X_{n} \right ]

since we have

Mathematical Expectation
Mathematical Expectation: The probability of a union of events


X_{i_{1}} X_{i_{2}} \cdot \cdot \cdot \cdot X_{i_{k}}= \begin{cases} 1, \ \ if \ \ A_{i_{1}} A_{i_{2}} \cdot \cdot \cdot A_{i_{k}} \ \ occurs  \\  0, \ \ othewise \end{cases}


E \left [ X_{i_{1}} X_{i_{2}} \cdot \cdot \cdot \cdot X_{i_{k}} \right ]= P\left ( A_{i_{1}} A_{i_{2}} \cdot \cdot \cdot A_{i_{k}} \right )

this implies the probability of union as

P\left ( \cup A_{i} \right )=\sum_{i}P(A_{i}) -\sum \sum_{i< j}P \left ( A_{i}A_{j} \right ) + \sum \sum_{i< j< k}\sum P\left ( A_{i}A_{j}A_{k} \right ) - \cdot \cdot \cdot + (-1)^{n+1} P\left ( A_{1} \cdot \cdot \cdot A_{n} \right )

Bounds from Expectation using Probabilistic method

    Suppose S be a finite set and f is the function on the elements of S and

m=\underset{s \in \mathfrak{s} }{max} f(s)

here we can obtain the lower bound for this m by expectation of f(s) where “s” is any random element of S whose expectation we can calculate so

m \geq f(S)

m \geq E\left [ f(S) \right ]

here we get expectation as the lower bound for the maximum value

Maximum-Minimum identity

 Maximum Minimum identity is the maximum of the set of numbers to the minimums of the subsets of these numbers that is for any numbers xi

\underset{i}{max} \ \ x_{i}=\sum_{i}x_{i} -\sum_{i< j} min(x_{i},x_{j}) + \sum_{i< j< k} min(x_{i},x_{j},x_{k}) + \cdot \cdot \cdot + (-1)^{n+1} min\left ( x_{1}, \cdot \cdot \cdot ,x_{n} \right )

To show this let us restrict the xi within the interval [0,1], suppose a uniform random variable U on the interval (0,1) and the events Ai as the uniform variable U is less than xi that is

A_{i}=\left { U< x_{i} \right.\left. \right }

since at least one of the above event occur as U is less than one the value of xi

U_{i}A_{i}=\left { U< \underset{i}{max} \ \ x_{i} \right.\left. \right }


P\left ( U_{i}A_{i} \right )= P\left ( U< \underset{i}{max} x_{i} \right ) =\underset{i}{max} x_{i}

Clearly we know

<a href="\left&space;(&space;U_{i}A_{i}&space;\right&space;)=&space;P\left&space;\{&space;U<a href="\left&space;(&space;U_{i}A_{i}&space;\right&space;)=&space;P\left&space;\{&space;U

P(A_{i}) =P\left ( U < x_{i} \right ) =x_{i}

and all the events will occur if U is less than all the variables and

A_{i_{1}} \cdot \cdot \cdot A_{i_{r}} =\left ( U< \underset{j=1 \cdot \cdot \cdot r}{min} x_{i_{j}} \right )

the probability gives

P\left ( A_{i_{1}} \cdot \cdot \cdot A_{i_{r}} \right )=P \left ( U< \underset{j=1 \cdot \cdot \cdot r}{min} x_{i_{j}} \right ) = \underset{j=1 \cdot \cdot \cdot r}{min} x_{i_{j}}

we have the result of probability of union as

P\left ( U_{i} A_{i}\right ) \sum_{i} P\left ( A_{i} \right ) -\sum_{i< j} P(A_{i}A_{j}) +\sum_{i< j< k} P(A_{i}A_{j}A_{k}) + \cdot \cdot \cdot \cdot + (-1)^{n+1} P(A_{1} \cdot \cdot \cdot \cdot A_{n})

following this inclusion exclusion formula for the probability

\underset{i}{max} (x_{i} +b) =\sum_{i} (x_{i} +b) -\sum_{i< j} min (x_{i} +b, x_{j} +b) + \cdot \cdot \cdot \cdot + (-1)^{n+1} min (x_{1} +b, \cdot \cdot \cdot , x_{n} +b)


M =\sum_{i} x_{i} -\sum_{i< j} min (x_{i},x_{j}) + \cdot \cdot \cdot \cdot + (-1)^{n+1} min (x_{1}, \cdot \cdot \cdot \cdot x_{n})

this gives

\underset{i}{max} \ \ x_{i} + b= M+ b\left ( n-\binom{n}{2} + \cdot \cdot \cdot + (-1)^{n+1} \binom{n}{n} \right )


0= (1-n)^{n}=1-n +\binom{n}{2} + \cdot \cdot \cdot + (-1)^{n+1} \binom{n}{n}

which means

\underset{i}{max} \ \ x_{i} =M

  • hence we can write it as

\underset{i}{max} \ \ x_{i} =\sum_{i} x_{i} - \sum_{i< j} min (x_{i}, x_{j}) \sum_{i< j< k} min (x_{i}, x_{j}, x_{k}) + \cdot \cdot \cdot + (-1)^{n+1} min (x_{1}, \cdot \cdot \cdot, x_{n})

taking expectation we can find expected values of maximum and partial minimums as

E \left [ \underset{i}{max} \ \ X_{i} \right ] =\sum_{i} E\left [ X_{i} \right ] - \sum_{i< j} E\left [ min (X_{i}, X_{j}) \right ] + \cdot \cdot \cdot + (-1)^{n+1} E\left [ min\left ( X_{1} , \cdot \cdot \cdot \cdot \cdot , X_{n} \right ) \right ])


The Expectation in terms of various distribution and correlation of expectation with some of the probability theory concepts were the focus of this article which shows the use of expectation as a tool to get expected values of different kind of random variables, if you require further reading go through below books.

For more articles on Mathematics, please see our Mathematics page.

A first course in probability by Sheldon Ross

Schaum’s Outlines of Probability and Statistics

An introduction to probability and statistics by ROHATGI and SALEH


I am DR. Mohammed Mazhar Ul Haque , Assistant professor in Mathematics. Having 12 years of experience in teaching. Having vast knowledge in Pure Mathematics , precisely on Algebra. Having the immense ability of problem designing and solving. Capable of Motivating candidates to enhance their performance.
I love to contribute to Lambdageeks to make Mathematics Simple , Interesting & Self Explanatory for beginners as well as experts.
Let's connect through LinkedIn -