0:00 / 0:00

Random Variables, PDFs, CDFs

A random variable is a variable whose values depend on the outcomes of a random experiment – we don’t know for sure the probability of a certain outcome occuring, but we can determine the probability for the occurrence of any particular outcome

A continuous random variable can only take on any values within a certain range
  • Example: height of a randomly selected student at UBC
  • Example: time it takes for a randomly chosen student to write their MATH exam
Probability Density Function (PDF) p(x)\color{orange}p\left(x\right)
Suppose that we have a random variable XX that can take on any value x[a,b]x\in\left[a,b\right]
Then the criteria for the probability density function are
  • p(x)0p(x)\ge0 for all xx
  • abp(x)dx=1\int_a^bp\left(x\right)dx=1 (total area under the curve is 1)
\toProbability that X takes on a value between a1a_1 and a2a_2 is a1a2p(x)dx\int_{a_1}^{a_2}p\left(x\right)dx

Wize Tip
If the PDF is defined on the interval (,)\left(-\infty,\infty\right) then p(x)dx=1\int_{-\infty}^{\infty}p\left(x\right)dx=1

Cumulative Distribution Function (CDF) F(x)\color{orange}F\left(x\right)
The cumulative function represents the probability that the random variable takes on a value in the range (a,x)(a,x)
  • F(x)=axp(s)dsF(x)=\int_a^xp\left(s\right)ds
  • F(x)F\left(x\right) is an increasing, continuous function
  • By the Fundamental Theorem of Calculus I, F(x)=p(x)F'\left(x\right)=p\left(x\right)
  • By the Fundamental Theorem of Calculus II, F(a2)F(a1)=a1a2p(x)dxF\left(a_2\right)-F\left(a_1\right)=\int_{a_1}^{a_2}p\left(x\right)dx
  • Important properties: F(b)=1F\left(b\right)=1 and F(a)=0F\left(a\right)=0

Wize Tip
If the PDF is defined on the interval (,)\left(-\infty,\infty\right), then F()=0F\left(-\infty\right)=0 and F()=1F\left(\infty\right)=1

Practice: PDF

Given the probability density function p(t)=k(1t2)p\left(t\right)=k\left(1-t^2\right) for 0t10\le t\le1,
a. determine the value of kk such that p(t)p\left(t\right) is a proper probability density function.
b. what is the probability that t<0.5t<0.5?
c. find the cumulative distribution function F(t)F\left(t\right).

Practice: CDF

Find a, b, and k such that this is a valid cumulative distribution function
F(x)={ax<0k arctanx0x<1bx1F\left(x\right)= \begin{cases} a&x<0\\ k\ \arctan x&0\le x<1\\ b&x\ge1 \end{cases}
0:00 / 0:00

Mean, Median, and Variance

Suppose we have a probability density function p(x)p\left(x\right) defined for a random variable on the interval axba\le x\le b

Mean (Expected value)
μ=x=abx p(x)dx\displaystyle \mu=\overline{x}=\int_a^bx\ p\left(x\right)dx
*This is like the weighted average

Median
The median xmedx_{med} is a value in the interval axmedba\le x_{med}\le b such that
axmedp(x)dx=xmedbp(x)dx=12\displaystyle \int_a^{x_{med}}p\left(x\right)dx=\int_{x_{med}}^bp\left(x\right)dx=\frac{1}{2}
(i.e. F(xmed)=12F\left(x_{med}\right)=\frac{1}{2})

Wize Tip
In a symmetric distribution, the mean and median will be the same, but will likely be different in a non-symmetric distribution.

Variance
The variance VV is the "average square distance between the mean and the whole distribution"
V=ab(xμ)2p(x)dx\displaystyle V=\int_a^b(x-\mu)^2p(x)dx

Standard deviation
The standard deviation σ\sigma is the "average distance between the mean and the whole distribution". It is just the square root of the variance
σ=V\sigma=\sqrt V
Moments


Practice

The flight altitude xx of a certain bird (measured from the ground) is given by the probability density function p(x)=5e3xp(x)=5e^{-3x} for x0x\ge0.
a) What is the average altitute HavgH_{avg}?
b) What is the probability that a bird's flight altitude is higher than 3?

Practice: Median

Which of the following PDFs has the largest median?


Extra Practice