Twitter response:
Free Math Worksheets

Continuous random variable

Random variable $X$ is a continuous random variable if there is a function $f: \mathbb{R} \rightarrow [0, \infty>$ such that $$P(X \leq a) =\int_{-\infty}^{a} f(t) dt, \quad \forall a \in \mathbb{R}$$

Function $f$ is called the probability density function or PDF.

Continuous random variable can take on an uncountably infinite number of possible outcomes, therefor its name.

Proposition. Let $X$ be a continuous random variable with density $f$.

(a) $\forall a,b \in \mathbb{R}, a\leq b$ we have

$$P(a < X \leq b)=P( \{X\leq b\} \setminus  \{X\leq a\})=P(x \leq b)-P(X \leq a) = \int_{a}^{b} f(t) dt$$

(b) All probabilities in measured space and up to $1$. In continuous variables integral is interpreted as sum.$$\int_{-\infty}^{+\infty} f(t)dt =P(X \in \mathbb{R}) =1$$

(c) Notice that for all $a \in \mathbb{R}$ $$P(X=a)=\int_{a}^{a} f(t)dt=0$$ Consequently, $$P(X \leq a)=P(X <a)+P(X=a)= P(X<a)$$ Moreover, $$P(a <X \leq b)=P(a <X<b)=P(a \leq X < b) =P(a \leq X \leq b)$$ i.e. it’s not important if the edge is included or not.


(a) Expected value of continuous random variable is defined as $$E[X]:= \int_{-\infty}^{+\infty} tf(t)dt$$
Generally, if $g:\mathbb{R} \rightarrow \mathbb{R}$ $$E[g(X)]:= \int_{-\infty}^{+\infty} g(t)f(t)dt$$

(b) Variance is the same as for discrete random variable, $$Var(X)=E[X^{2}]-(E[X])^{2}$$

Example 1

Let $X$ be continuous random variable with PDF:

$$f(t)=\begin{cases} c\cdot t^{4}, & \text{if $0<t<1$}.\\ 0, & \text{otherwise}.\end{cases}$$

(a) Find constant $c$
(b) Calculate $P(X>\frac{1}{2})$
(c) Find  $E[X]$ and $Var(X)$.


(a) We know that $\int_{-\infty}^{+\infty} f(t)dt =1$. Since the function has value $0$ for every $t$ outside of the interval $(0,1)$ the integral is equal to $$\int_{0}^{1} c\cdot t^{4} dt =1$$

Further, lets solve this integral by using the polynomial rule

$$\displaystyle{\frac{c}{5}\cdot t^{5} \Big|_0^1=1 \Rightarrow c=5}$$
Consequently, PDF looks like this

$$f(t)=\begin{cases} 5\cdot t^{4}, & \text{if $0<t<1$}.\\ 0, & \text{otherwise}.\end{cases}$$

(b) Probability of $X>\frac{1}{2}$ can be calculated in two ways.

First way, $$P(X > \frac{1}{2})= \int_{-\infty}^{+\infty} 5\cdot t^{4}dt – \int_{-\infty}^{\frac{1}{2}} 5\cdot t^{4}dt =$$
$$=1 – \int_{-\infty}^{\frac{1}{2}} 5\cdot t^{4}dt= 1-\frac{5}{5} \cdot t^{5} \Big|_0^\frac{1}{2}=1-(\frac{1}{2})^5=0.96875$$

Second way, $$P(X > \frac{1}{2})=P(\frac{1}{2}<X < +\infty)$$ In this case $a=\frac{1}{2}$ and $b=+\infty$. Consequently, integral is equal to $$\int_{\frac{1}{2}}^{+\infty} 5\cdot t^{4}dt$$ Moreover, our function is zero outside of the interval $<0,1>$. Because of that we can rewrite our integral as $$\int_{\frac{1}{2}}^{1} 5\cdot t^{4}dt$$ Finally, we solve the given integral

$$\int_{\frac{1}{2}}^{1} 5\cdot t^{4}dt=\frac{5}{5} \cdot t^{5} \Big|_\frac{1}{2}^{1}=1-\Big(\frac{1}{2}\Big)^5=0.96875$$

(c) We’ve learned before that expected value is equal to $$E[X]:= \int_{-\infty}^{+\infty} tf(t)dt$$

We simply put our PDF and it’s edges into the given formula and solve the integral. It looks like this: $$E[X]:= \int_{0}^{1} t\cdot 5\cdot t^4 dt=5\cdot\int_{0}^{1}t^5 dt = \frac{5}{6}$$

Variance is calculated the same way as before, $Var(X)=E[X^{2}]-(E[X])^{2}$.

Since we already have $E[X]$, we need to find $E[X^{2}]$ and subtract them. $E[X^{2}]$ is calculated the same way as $E[X]$ but instead of putting $t\cdot f(t)$ in integral, we put $t^{2} f(t)$. Let’s do that. $$E[X^{2}]:= 5\int_{0}^{1} t^2 \cdot t^4 dt=5\cdot\int_{0}^{1}t^6 dt = \frac{5}{7}$$ Finally, $$Var(X)=E[X^{2}]-(E[X])^{2}=\frac{5}{7}-\Big(\frac{5}{6} \Big)^{2}=0.0198413$$

Uniform distribution 

We’ve already mentioned probability distribution function, but lets extend our knowledge to continuous random variables.

Proposition. Probability distribution function also known as cumulative distribution function (CDF) of a random variable $X$ is $$F(x) =P(X \leq x), \quad  \forall x \in \mathbb{R}$$

Specially, if $X$ is continuous with density $f$, its probability distribution function looks like this: $$F(x) =\int_{-\infty}^{x} f(t) dt, \quad \forall x \in \mathbb{R}$$

Proposition. Lets take a look at previous propositions and extend them in terms of probability distribution function.

(a) $$P(a < X \leq b) = P(X \leq b) – P(X \leq a)= F(b) – F(a)$$

(b) $$P(X>x) =1-P(X \leq x)=1-F(x)$$

Proposition. We say random variable $X$ has uniform distribution on interval $<a,b>$ if its distribution function looks like this $$f(t)=\begin{cases} \frac{1}{b-a}, & \text{if $a<t<b$}.\\ 0, & \text{otherwise}.\end{cases}$$ Additionally, we write it as $X \sim U(a,b)$

Normal distribution 

Random variable $X$ has normal distribution with parameters $\mu \in \mathbb{R}$ and $\sigma^{2}>0$ if its distribution function looks like this $$f(t)=\frac{1}{\sigma \sqrt{2\pi}}e^{-\frac{(t-\mu)^{2}}{2\sigma^{2}}},\quad \forall t \in \mathbb{R}$$ Additionally, we note it as $X \sim N(\mu, \sigma^{2})$.


(a) If $X \sim N(\mu, \sigma^{2})$, its expected value is $\mu$. Moreover, its variance is $\sigma^{2}$. Consequently, $\sigma=\sqrt{Var(X)}$is standard variance of $X$.

(b) For $X \sim N(\mu, \sigma^{2})$ we can define random variable $$Z:=\frac{X-\mu}{\sigma} \sim N(0,1)$$ Variable $Z\sim N(0,1)$ is called standard normal random variable and its distribution function is noted as $\Phi$. The graph of $\Phi$ looks like this:

Normal distribution is sometimes called bell curve.

The graph is symmetric around zero. Consequently, $\Phi(x)=1-\Phi(-x)$.

However, $\Phi$ can’t be explicitly calculated. We use the table below to find its value.

How to read the table? 

Lets say we need to find $\Phi(1.14)$. Firstly, we separate the number $1.14$ into two parts:

  • integer part and first decimal
  • second decimal


We look for the first summand in the table’s rows and for the second summand in the columns.

Consequently, $\Phi(1.14)=0.8729$.

Example 3

Let $X\sim N(1,4)$. Find $P(1 < X < \frac{3}{2})$.


From $X\sim N(1,4)$ we know that the expected value of $X$ is $\mu=1$ and its variance is $\sigma^{2}=4$. Using the previous proposition we can introduce standard normal random variable $Z$. $$Z\sim \frac{X-\mu}{\sigma}=\frac{X-1}{2}\sim N(0,1)$$ Be careful, we are given variance ($\sigma^{2}$), but for $Z$ we need standard deviation ($\sigma$). Now we want to extend the expression $P(1 < X < \frac{3}{2})$ to something like $P(a<Z<b)$. We do that by subtracting $1$ and dividing the whole expression inside of of brackets with $2$.$$P(1 < X < \frac{3}{2})=P(\frac{1-1}{2}<\frac{X-1}{2}<\frac{\frac{3}{2}-1}{2})=P(0<Z<\frac{1}{4})$$ In terms of $\Phi$ the above expression is equal to $$\Phi(\frac{1}{4})-\Phi(0)=\Phi(0.25)-\Phi(0.00)=0.5987-0.5=0.0987$$ The values of $\Phi(0.25)$ and $\Phi(0.00)$ were read from the table the same way we described.

Example 4

Lets say that the required time for a student to get to the college is distributed with expected value of $40$ minutes and standard deviation of $7$ minutes. His class starts at $12:15$.

(a) If he gets going at $11:40$, what is the probability he will make it on time.
(b) At what time should the student leave the house for the probability of making it in on time be at least $0.95$.


Let $X$ be random variable that represents the time of the travel. We were given the expected value and standard deviation:

$\bullet$ $\mu =40$ minutes
$\bullet$ $\sigma=7$ minutes

(a) For him to make it on time he needs to travel less than $35$ minutes. Consequently, we need $P(X<35)$. Once again, we extend it to normal standard random variable. $$P(\frac{X-40}{7}<\frac{35-40}{7})=P(\frac{X-40}{7}<-0.71429)$$ Now we can write this expression in terms of $\Phi$. $$P(\frac{X-40}{7}<-0.71429)=\Phi(-0.714)=1-\Phi(0.714)=1-0.7611=0.2389$$
The probability the student will make it to college on time is $23.89\%$.

(b) In this example we know the wanted probability, however we need to find the value of $X$ that gives us that probability.  $$P(X\leq a)\geq 0.95$$ We extend the expressions similarly as before. $$P(\frac{X-40}{7}\leq \frac{a-40}{7})\geq 0.95$$ Further, $$\Phi(\frac{a-40}{7})\geq 0.95$$ In contrast to previous examples, we go the other way around. Firstly, we look for the first value of $Z$ greater than $0.95$ and then find the original $Z$ through right column and row. $$\Phi(1.65)\geq 0.95$$ Further, because $\Phi \geq 0.95$ for every number greater than $1.65$ (see the table), we have $$\frac{a-40}{7}\geq 1.65$$ When we solve this equation, we get $$a\geq 51.55$$ Finally, for the probability greater than $0.95$ students needs to start going to class at least $52$ min prior.