Limited Time Offer: Save 10% on all 2022 Premium Study Packages with promo code: BLOG10

# Explain and calculate expected value, mode, median, percentile and higher moments

## Expected Value of a Discrete Random Variable

The expected value of a discrete random variable is the sum of all the values the variable can take times the probability of that value occurring.

$${E} \left( {X} \right)=\sum { {x}. {p} \left( {x} \right)}$$

The expected value of random variable $$X$$ is often written as $${E} \left( {X} \right)$$ or $${ \mu }$$ or $${ \mu }\text{X}$$.

#### Example: Expected Return of a Discrete Random Variable

Given the experiment of rolling a single die, calculate the expected value.

Solution

Using the result:

$${E} \left( {X} \right)=\sum { {x}.{p} \left( {x} \right)}$$

We have:

$${E} \left( {X} \right) =1\times \left(\cfrac{1}{6}\right)+2\times \left(\cfrac{1}{6}\right)+3\times \left(\cfrac{1}{6}\right)+4\times \left(\cfrac{1}{6}\right)+5\times \left(\cfrac{1}{6}\right)+6\times \left(\cfrac{1}{6}\right)= 3.5$$

## Expected Value of a Continuous Random Variable

If $$\alpha$$ and $$\beta$$ are constants, then:

$$E(\alpha X)=a\bullet E(X)=a\bullet \sum{x\bullet P(x)}$$

And

$$E(\alpha X+\beta)=\alpha E(X)+\beta$$

If $$X$$ is a continuous random variable with a probability density function $${f}\left( {x} \right)$$, then the expected value (or mean) of $$X$$ is given by

$$E\left( X \right) =\int _{ -\infty }^{ \infty }{ xf\left( x \right)dx }$$

Where $$f(x)$$ is the probability density function of $$x$$.

#### Example: Expected Return of Continuous Random Variable

Given the following probability density function of a continuous random variable:

$$f\left( x \right) =\begin{cases} \cfrac { x }{ 2 } , & 0< x < 2 \\ 0, & otherwise \end{cases}$$

Calculate $$E(X)$$.

$$E\left( X \right) =\int _{ -\infty }^{ \infty }{ xf\left( x \right) dx } =\int _{ 0 }^{ 2 }{ x\bullet \frac { x }{ 2 } \bullet dx={ \left[ \frac { { x }^{ 3 } }{ 6 } \right] }_{ x=0 }^{ x=2 }=\frac { 8 }{ 6 } =\frac { 4 }{ 3 } }$$

### The Mode of a Discrete Random Variable

The mode of a discrete random variable is the value that is most likely to occur.

#### Example: Calculating the Mode of Discrete Random Variable

Given the experiment of rolling two dice simultaneously, what is the mode of the probability distribution of the sum of the two dice?

Solution

As shown in the table below, the most likely value is 7 with a probability of $$\frac{6}{36}$$ so the mode is 7.

$$\begin{array}{c|c} {\bf x} & {\bf p(x)} \\ \hline 2 & {1}/{36} \\ \hline 3 & {2}/{36} \\ \hline 4 & {3}/{36} \\ \hline 5 & {4}/{36} \\ \hline 6 & {5}/{36} \\ \hline 7 & {6}/{36} \\ \hline 8 & {5}/{36} \\ \hline 9 & {4}/{36} \\ \hline 10 & {3}/{36} \\ \hline 11 & {2}/{36} \\ \hline 12 & {1}/{36} \\ \end{array}$$

As shown in the table below, the most likely value is 7 with a probability of $$\cfrac{6}{36}$$, so the mode = 7.

### The Mode of a Continuous Random Variable

The mode of a continuous random variable is the value at which the probability density function, $$f(x)$$, is at a maximum.

It is a value that is most likely to lie within the same interval as the outcome.

Consequently, often we will find the mode(s) of a continuous random variable by solving the equation:

$${f}^{\prime} \left( \text{x} \right)=0$$

Remember: For the case of continuous random variables, the probability of a specific value occurring is 0, $$P(X=k)=0$$, and the mode is a specific value.

#### Example: Calculating the Mode of a Distribution

Given the following probability density function of a continuous random variable, find the mode of the distribution. $$f\left( x \right) =\begin{cases} -{ x }^{ 2 }+2x-\cfrac { 1 }{ 6 } , & 0 < x < 2 \\ 0, & otherwise \end{cases}$$ To find the maximum of $$f(x)$$, find the first derivative and set that value equal to zero as shown below:

$${f}^{\prime} (x)= -2x+2=0$$

Then solve for $$x$$.

$$-2x = -2$$

$$x = 1$$

So, the mode of the distribution is 1.

### Median of a Discrete Random Distribution

The median of a discrete distribution is the value of $$X$$ for which $$P(X \le x)$$ is greater than or equal to 0.5 and $$P(X \ge x)$$ is greater than or equal to 0.5.

#### Example: Calculating the Median of Discrete Random Distribution

Given the following probability density function of a discrete random variable, calculate the median of the distribution:

$${f}\left( {x} \right) =\begin{cases} 0.2,{x}=1,4 & \\ 0.3,{x}=2,3, & \end{cases}$$

Solution

The median of the distribution above is 2 because:

$$P(X \le 2) = P(X=1)+P(X=2) = .2+.3 = .5$$

and,

$$P(X \ge 2) = P(X=2)+P(X=3)+P(X=4) = .3+.3+.2 = .8.$$

### Median of a Continuous Distribution

The median of a continuous distribution can be defined by the value $$c$$ in the formula shown below:

$$\int _{ -\infty }^{ c }{ f\left( x \right)dx=0.5 }$$

That is, it is the value for which the area under the curve from negative infinity to $$c$$ is equal to 0.5. The median is also referred to as the 50th percentile.

#### Example: Calculating the Median of a Continuous Distribution

Given the following probability density function of a continuous random variable, find the median of the distribution.

$${f}\left( {x} \right)=\begin{cases} -{x}^{ 2 }+2 {X}-\frac {1}{6}, & 0 < x < 2\\ 0, & \text{otherwise}\\ \end{cases}$$

Solution

We need,

\begin{align*} & {P}\left({x}\le{{m}}\right)=0.5 \\ &\Rightarrow \int _{ -\infty }^{ {m} }{ \left(-{ {x} }^{2}+2{x}-\cfrac{1}{6}\right){dx}=0.5}\\ &=\left[-\cfrac{{ {x} }^{3}}{3}+{ {x} }^{2}-\cfrac{1}{6} { {x} }\right]_{{ {x} }=0}^{ { {x} }={ {m} }}=0.5 \\ &=-\cfrac{{ {m} }^{3}}{3}+{ {m} }^{2}-\cfrac{1}{6}\times {c}=0.5 \\ &\Rightarrow { {m} }=1 \end{align*}

## pth Percentile of a Discrete Distribution

In general, the pth percentile of a discrete distribution is the value of $$x$$ for which $$P(X \le x)$$ is greater than or equal to $$\frac {p}{100}$$ and $$P(X \ge x)$$ is greater than or equal to $$1-\frac {p}{100}$$.

#### Example: Calculating the 75th Percentile from Discrete Random Variables

Given the following probability density function of a discrete random variable, calculate the 75th percentile of the distribution:

$${f}\left( {x} \right) =\begin{cases} 0.2,{x}=1,4 & \\ 0.3,{x}=3,4 & \end{cases}$$

Solution

We need:

$${P}\left({X} \le {{p} }_{0.75} \right) = .75$$

So,

\begin{align*} {P}\left({X} \le {3} \right) & = {P}\left({X} = {1} \right) + {P}\left({X} = {2} \right) + {P}\left({X} = {3} \right)=0.2 + 0.3 + 0.2 \\ & = 0.7 < 0.75 \\ {P}\left({X} \le {4} \right) & = {P}\left({X} = {1} \right) + {P}\left({X} = {2} \right) + {P}\left({X} = {3} \right) + {P}\left({X} = {4} \right) \\ & = 0.2 +0.3 + 0.2 + 0.3 = 1.0 > 0.75 \\ {P}\left({X} \le {4} \right) & =({P}\left({X} = {4} \right)=0.2 < 0.25 = 1 – \left( \cfrac{75}{100} \right) \end{align*}

So, the 75th percentile of the distribution is 4.

In general, the pth percentile of a continuous distribution can be defined as the value of $$C$$ for which:

$$\int _{ -\infty }^{ \infty }{ {f}\left( {x} \right) {dx} }=\cfrac{ {p} }{100}$$

#### Example: Calculating the 25th Percentile from Continuous Random Variables

Given the following probability density function of a continuous random variable, find the 25th percentile:

$${f}\left( {x} \right)=\begin{cases} -\text{x}^2+2\text{x}-\frac {1}{6}, & 0 < \text{x} < 2\\ 0, & \text{elsewhere}\\ \end{cases}$$

Solution

We need:

\begin{align*} &{P}\left({x}\le{{c}}\right)=0.25 \\ &\Rightarrow \int _{ 0 }^{ {c} }{ \left(-{ {x} }^{2}+2{x}-\cfrac{1}{6}\right){dx}=\cfrac{25}{100}=0.25}\\ &\int _{ 0 }^{ c}{ \left(-{ {x} }^{2}+2{x}-\cfrac{1}{6}\right) {dx}=0.25} \\ &\left[-\cfrac{ { {x} }^{3} }{3}+2 {x}-\cfrac{1}{6} {x} \right]_{{{x}}=0}^{{x}={c}}=0.25 \\ &-\cfrac{ { {c} }^{3} }{3}+{ {c} }^{2}-\cfrac{1}{6}\times{ {c} }=0.25 \\ &{ {c} }=0.69 \end{align*}

Learning Outcome

Topic 2.c: Univariate Random Variables – Explain and calculate expected value, mode, median, percentile, and higher moments.

Shop CFA® Exam Prep

Offered by AnalystPrep

Featured Shop FRM® Exam Prep Learn with Us

Subscribe to our newsletter and keep up with the latest and greatest tips for success
Shop Actuarial Exams Prep Shop GMAT® Exam Prep

Daniel Glyn
2021-03-24
I have finished my FRM1 thanks to AnalystPrep. And now using AnalystPrep for my FRM2 preparation. Professor Forjan is brilliant. He gives such good explanations and analogies. And more than anything makes learning fun. A big thank you to Analystprep and Professor Forjan. 5 stars all the way!
michael walshe
2021-03-18
Professor James' videos are excellent for understanding the underlying theories behind financial engineering / financial analysis. The AnalystPrep videos were better than any of the others that I searched through on YouTube for providing a clear explanation of some concepts, such as Portfolio theory, CAPM, and Arbitrage Pricing theory. Watching these cleared up many of the unclarities I had in my head. Highly recommended.
Nyka Smith
2021-02-18
Every concept is very well explained by Nilay Arun. kudos to you man!