Nothing Special   »   [go: up one dir, main page]

Lecture 23

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

INTRODUCTION TO CALCULUS

MATH 1A

Unit 23: PDF and CDF

Lecture
23.1. In probability theory one considers functions too:

Definition: A non-negative
R∞ piece-wise continuous function f (x) which
has the property that −∞ f (x) dx = 1 is called a probability density
function. For every interval A = [a, b], the number
Z b
P[A] = f (x) dx
a
is the probability of the event.

23.2. An important case is the function f (x) which is 1 on the interval [0, 1] and 0 else.
It is the uniform distribution on [0, 1]. Random number generators in computers
first of all generate random numbers with that distribution. In Mathematica, you get
such numbers by evaluating Random[]. InR Python you get it with import random;
0.7
random.uniform(0,1). The probability 0.3 f (x) dx for example is 0.4. Here is the
function f (x):

a b

23.3. An other important probability density is the standard normal distribution,


also called Gaussian distribution.
MATH 1A

Definition: The normal distribution has the density


1 2
f (x) = √ e−x /2 .

23.4. It is the distribution which appears most often if data can take both positive
and negative values. One reason why it appears so often is that if one observes dif-
ferent unrelated quantities then their sum, suitably normalized is close to the normal
distribution. Errors for example often have normal distribution. Astronomers like
Galileo noticed this already in 1630ies. Laplace in 1774 first defined probability distri-
butions and Gauss in 1801 first looked at the normal distribution, also in the context
of analyzing astronomical data when searching for the dwarf planet Ceres.

a b

Example: The probability density function of the exponential distribution is


defined as f (x) = e−x for x ≥ 0 and f (x) = 0 for x < 0. It is used to used measure
lengths of arrival times like the time until you get the next email. The density is zero
for negative x because there is no way we can travel back in time.
What is the probability
R2 that you get an email between times x = 1 and times x = 2?
Answer: it is 1 f (x) dx = e−1 − e−2 = 1/e − 1/e2 .

a b
INTRODUCTION TO CALCULUS

Definition: Assume R x f is a probability density function (PDF). The anti-


derivative F (x) = −∞ f (t) dt is called the cumulative distribution
function (CDF).

Example: For the exponential function the cumulative distribution function is


Z x Z x
f (x) dx = f (x) dx = −e−x |x0 = 1 − e−x .
−∞ 0

1 1
Definition: The probability density function f (x) = π 1+x2
is called the
Cauchy distribution.

Example: Find the cumulative distribution function of the Cauchy distribution.


Solution:
Z x
1 1 1
F (x) = f (t) dt = arctan(x)|x−∞ = ( arctan(x) + ) .
−∞ π π 2

Definition: The mean of a distribution is the number


Z ∞
m= xf (x) dx .
−∞

Example: The mean of the distribution f (x) = e−x on [0, ∞) is


Z ∞
xe−x dx .
0

We do not know yet how to compute this but learn a technique later. For now, we
have to guess the anti derivative or being told that it is (−1 − x)e−x . We can check
that the derivative of this function is indeed e−x . So,
Z ∞
xe−x dx = lim (−1 − x)e−x |t0 = lim (−1 − t)e−t + 1 = 1 .
0 t→∞ t→∞

23.5. The distribution looks similar to the Gaussian distribution, but it has more risk.
The variance of this distribution
Z ∞ Z ∞
2 x2
x f (x) dx = (1/π) 2
dx
∞ −∞ 1 + x

x2
is infinite. The function 1+x2
is asymptotically 1 and has a divergent integral from −∞
to ∞.
MATH 1A

a b

Homework

Problem 23.1: Assume the probability density for the time you have to
wait for your next text message you get is f (x) = 5e−5x where x is time
in hours.
What is the probability that you get your next text message in the next
4 hours but not before 1 hour?

Problem 23.2: Assume the probability distribution for the waiting time
to the next warm day is f (x) = (1/4)e−x/4 , where x has days as unit.
What is the probability to get a warm day between tomorrow and after
tomorrow that is between x = 1 and x = 2?

Problem 23.3: Verify that the function f (x) which is defined to be zero
1
outside the interval [−1, 1] and given as π√1−x 2 inside the interval [−1, 1]

is a probability distribution.
What is the cumulative distribution function?

Problem 23.4: Assume some risky experiment leads to discrepancies


(errors) which are distributed according to the Cauchy distribution.
a) Find the probability that the error is in absolute value
√ larger than 1.
b) Find the probability that the error is smaller than − 3/2.

R∞
Problem 23.5: If f (x) is a probability distribution, then −∞ xf (x) dx
is called the mean of the distribution.
a) Compute the mean for the standard normal distribution.
b) Compute the mean for the Cauchy distribution f (x) = π1 1+x1
2.
1√ 1
c) Compute the mean for the arc-sin distribution f (x) = π 1−x2 on [−1, 1].

Oliver Knill, knill@math.harvard.edu, Math 1a, Harvard College, Spring 2020

You might also like