# 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.

Proposition.

(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)$.

Solution

(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})$.

Proposition.

(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