You are on page 1of 21

Continuous probability distributions

Tan Do

Vietnamese-German University

Lecture 13

Tan Do (VGU) Introduction to Probability Lecture 13 1 / 21


Content

In this lecture

The uniform distribution


The exponential distribution

Tan Do (VGU) Introduction to Probability Lecture 13 2 / 21


The uniform distribution

Denition of the uniform distribution


The simplest continuous probability distribution has a at probability density function
between 2 points a and b.
This is called a uniform distribution between a and
b, which is denoted by

X ∼ U (a, b).

Since we want the area under the p.d.f of X to be


1, we must have
1
f (x) =
b−a
for a ≤ x ≤ b and f (x) = 0 otherwise.
The cumulative distribution function is
Z x
1 x−a
F (x) = dt =
a b−a b−a
for a ≤ x ≤ b.
Tan Do (VGU) Introduction to Probability Lecture 13 3 / 21
The uniform distribution
A random variable X ∼ U (a, b) has a simple interpretation that it is equally likely to
take any value in [a, b].

A U (0, 1) is considered a standard uniform distribution.


Given X ∼ U (a, b), we can standardize X by using the linear transformation
X −a
Y = ,
b−a
i.e., Y ∼ U (0, 1).

Since a uniform distribution is symmetric, its expectation is its middle value


a+b
E(X) = .
2
Also,
b
b3 − a3 a2 + ab + b2
Z
1
E(X 2 ) = x2 dx = = .
a b−a 3(b − a) 3
Therefore
a2 + ab + b2 (a + b)2 (b − a)2
Var(X) = E(X 2 ) − (E(X))2 = − = .
3 4 12
Tan Do (VGU) Introduction to Probability Lecture 13 4 / 21
The uniform distribution

In summary, we have the following.

The uniform distribution

A random variable X has a uniform distribution between a and b, written

X ∼ U (a, b) if its probability density function is

1
f (x) =
b−a
for a≤x≤b and f (x) = 0 otherwise.

The cumulative distribution function of X is


x−a
F (x) = .
b−a
The expectation is
a+b
E(X) = .
2
The variance is
(b − a)2
Var(X) = .
12
Tan Do (VGU) Introduction to Probability Lecture 13 5 / 21
The uniform distribution
Example (Pearl oyster farming) When pearl oysters are opened, pearls of various
sizes are found. Suppose that each oyster contains a pearl with a diameter in mm that
has a U (0, 10) distribution.
Let X be the random variable that gives the diameter of a pearl. Then
E(X) = 5
and
(10 − 0)2
Var(X) = = 8.33.
√ 12
So the standard deviation is σ = 8.33 = 2.89.

Tan Do (VGU) Introduction to Probability Lecture 13 6 / 21


The uniform distribution

Pearls with a diameter of at least 4 mm have commercial value. The probability

that an oyster contains a pearl of commercial value is therefore

P (X ≥ 4) = 1 − F (4) = 1 − 0.4 = 0.6.

Suppose that a farmer retrieves 10 oysters out of the water and that the random

variable Y represents the number of them containing pearls of commercial value.

If the oysters grow pearls independently of one another, Y ∼ B(10, 0.6).


So the probability that at least 8 of the oysters contain pearls of commercial value

is

P (Y ≥ 8) = P (Y = 8) + P (Y = 9) + P (Y = 10)
     
10 10 10
= × 0.68 × 0.42 + × 0.69 × 0.41 + × 0.610 × 0.40
8 9 10
= 0.121 + 0.04 + 0.006 = 0.167.

Tan Do (VGU) Introduction to Probability Lecture 13 7 / 21


The uniform distribution

Games of chance
Dial spinning game Recall that in a dial-spinning game we dene θ to be
the angle spun (0 ≤ θ ≤ 180) and
θ
X = $1000 × ,
180
which is a player's winning amount of money (0 ≤ X ≤ 1000).

Both the angle θ and the winnings X have uniform distributions.


Specically, θ ∼ U (0, 180) and X ∼ U (0, 1000).
Tan Do (VGU) Introduction to Probability Lecture 13 8 / 21
The uniform distribution

We have
E(θ) = 90 and E(X) = 500.

The variances are


(180 − 0)2
Var(θ) = = 2700
12
and
(1000 − 0)2
Var(X) = = 83333.
12

So the standard deviations are



σθ = 2700 = 51.96

and

σX = 83333 = 288.7.
Tan Do (VGU) Introduction to Probability Lecture 13 9 / 21
The exponential distribution

Denition of the exponential distribution


We usually use the so-called exponential distribution to model failure times or waiting times.

It has a probability density function

f (x) = λ e−λx

for x≥0 and f (x) = 0 for x < 0, where λ > 0.


The cumulative distribution function is
Z x
F (x) = λe−λy dy = 1 − e−λx
0

for x ≥ 0. The expectation can be calculated using integration by parts:

Z ∞ 1
E(X) = x λ e−λx dx = .
0 λ
Also, Z ∞ 2
E(X 2 ) = x2 λ e−λx dx = .
0 λ2
Therefore,
2 1 1
Var(X) = E(X 2 ) − (E(X))2 = − 2 = 2.
λ2 λ λ
1
It follows that the standard deviation is σ= λ
. Note that σ = E(X).
Tan Do (VGU) Introduction to Probability Lecture 13 10 / 21
The exponential distribution

In summary, we have the following.

The exponential distribution

An exponential distribution with parameter λ>0 has a probability density

function

f (x) = λ e−λx
for x≥0 and f (x) = 0 for x < 0.
Its cumulative distribution function is

F (x) = 1 − e−λx

for x ≥ 0.
The expectation is
1
E(X) = .
λ
The variance is
1
Var(X) = .
λ2
Tan Do (VGU) Introduction to Probability Lecture 13 11 / 21
The exponential distribution

Tan Do (VGU) Introduction to Probability Lecture 13 12 / 21


The exponential distribution

The memoryless property of the exponential distribution


Memoryless property If X has an exponential distribution with parameter
λ, then conditional on X ≥ x0 for some xed value x0 , the quantity
X − x0 also has an exponential distribution with parameter λ.

Graphically, this means that the section beyond a certain point x0 is just a
scaled version of the whole probability density function.

Tan Do (VGU) Introduction to Probability Lecture 13 13 / 21


The exponential distribution

Implication of the memoryless property Suppose that you are waiting at a


bus stop and that the time in minutes until the arrival of the bus has an
exponential distribution with λ = 0.2.
The expected time that you will wait is λ1 = 5 minutes.
If after 1 minute the bus has not arrived yet, what is the expectation of the
additional time what you must wait?

Answer Unfortunately, the additional waiting time is not reduced to 4


minutes, but remains the same as before, which is 5 minutes.
This is because the additional waiting time until the bus arrives beyond the
rst minute (during which you know the bus did not arrive) still has an
exponential distribution with λ = 0.2.

Tan Do (VGU) Introduction to Probability Lecture 13 14 / 21


The exponential distribution

Example (Shipwreck hunts) A team of underwater salvage experts sets


sail to search the ocean oor for the wreckage of a ship that is thought to
have sunk within a certain area.

The captain's experience is that in similar situations it has taken an


average of 20 days to locate the wreck.
Consequently, the captain summarizes that the time in days taken to locate
the wreck can be modeled by an exponential distribution with parameter
1 1
λ= = = 0.05.
E(X) 20

Due to the vast searching area, the unfruitful searching of certain areas
does not alter the chance of nding the wreck in the future.
Therefore, the memoryless property of the exponential distribution is
suitable in this case.
Tan Do (VGU) Introduction to Probability Lecture 13 15 / 21
The exponential distribution
It is highly demanded that the wreck is found within the rst week. The probability of
this is
P (X ≤ 7) = F (7) = 1 − e−0.05×7 = 0.3.

After 4 weeks, the search will be called o. The probability that the captain has to call
o the search without success is
P (X ≥ 28) = 1 − F (28) = e−0.05×28 = 0.25.

Tan Do (VGU) Introduction to Probability Lecture 13 16 / 21


MATLAB

Generating random numbers in MATLAB

To generate a random number between 0 and 1 with uniform distribution, type


>> rand

To generate an array, a of random numbers between 0 and 1 with uniform


distribution, type
>> rand(2,3) % A 2x3 matrix of random numbers

To generate a random integer between 1 and 10 with uniform distribution, type


>> randi(10)

To generate an array of random integers between 1 and 10 with uniform


distribution, type
>> randi(10,2,3) % A 2x3 matrix of random integers

Tan Do (VGU) Introduction to Probability Lecture 13 17 / 21


MATLAB

randn generates a random real number with normal distribution, i.e., distribution
with density
1 x2
f (x) = √ e− 2 .

As a consequence, random numbers close to 0 are more likely to appear.

randn(2,3) generates a 2 × 3 matrix of random real numbers with normal


distribution.

Tan Do (VGU) Introduction to Probability Lecture 13 18 / 21


MATLAB

Exponential distribution in MATLAB


exprnd(m,a,b) generates a a×b array of random numbers with exponential distribution of mean m.
>> x = exprnd(7,10,1)
x =
24.1308
8.9881
21.5278
16.3218
1.3597
2.5486
8.0398
0.3574
23.5785
5.7669

fitdist(x,’exponential’) ts an exponential distribution to a set of data x.


>> fitdist(x,’exponential’)
ans =

ExponentialDistribution

Exponential distribution
mu = 11.2619 [6.59179, 23.4849]

Tan Do (VGU) Introduction to Probability Lecture 13 19 / 21


MATLAB

exppdf(x,m) computes the p.d.f value of the exponential distribution with mean
m at x.
Plotting p.d.f of the exponential function with mean 2:
x = 0:0.1:10;
y = exppdf(x,2);
plot(x,y)
xlabel(’Observation’)
ylabel(’Probability Density’)

Tan Do (VGU) Introduction to Probability Lecture 13 20 / 21


MATLAB

expcdf(x,m) computes the c.d.f value of the exponential distribution with mean
m at x.
Plotting c.d.f of the exponential function with mean 2:
x = 0:0.1:10;
y = expcdf(x,2);
plot(x,y)
xlabel(’Observation’)
ylabel(’Cumulative Probability’)

Tan Do (VGU) Introduction to Probability Lecture 13 21 / 21

You might also like