STA 120-All Lectures
STA 120-All Lectures
Course Outline
➢ Random variables; discrete and continuous,
➢ probability functions of random variables,
➢ Expectations and Variance; moments and moment
generating functions.
➢ Probability distributions and distribution functions;
Bernoulli, Binomial Poisson, Normal Exponential,
Hypergeometric, Beta, Gamma, etc.
Practice Exercise
A die is thrown twice. Let the random variable X denote the sum
of its points. Obtain the probability distribution for X.
Example 1
Find the constant C such that the function
f ( x ) dx = dx
Cx 2
− 0
iii. F(x) is continuous from the right [ i.e. lim+ 𝐹 𝑥 + ℎ = 𝐹 𝑥 for all x]
ℎ→0
0, -<x<0
1
4 , 0 x<1
F ( x) =
3 4 , 1 x<2
1, 2 x<
1 2
𝑥 0<x<3
If 𝑓(𝑥) = ൝9
0, otherwise
Find the CDF
1 − e−2 x , x0
F ( x) =
0, x<0
Find
a) The density function
b) The probability that x>2
c) The probability that -3<x≤4
Solution
d d
f ( x) = F ( x) = 1 − e−2 x
dx dx
2e−2 x , x>0
0, otherwise
b)
p( x 2) = f (u)du = 2e−2u dx
2 2
Solution
By definition
∴ p(x>) = 1-(1-e-4)
=e-4
C) p(−3 x 4) = f (u )du
−3
0 4
f (u)du + f (u)du
−3 0
0 4
du
−2u
0 du + 2e
−3 0
4
0 + −e −2u
= −e−8 + e0
0
= 1 − e−8
Theorem 1
Proof
Where
✓ That is, the n-th moment is equal to the n-th derivative of the
mgf evaluated at t = 0.
Proof
Example 1
Example 2
Find the mgf of 𝑿~𝑬𝑿𝑷(𝝀) and hence find it’s mean and Variance.
Solution
✓ This is an exponential distribution whose 𝑓 𝑥 is given by:
✓ To get the mean of the exponential distribution, we find the first derivative
of it’s moment generating function, then set t=0
✓ To get the variance we have that
✓ Now that we have the mean which is 𝑬 𝑿 , we need to find 𝑬(𝑿𝟐 ) which is
the second derivative of the MFG, when t=0
✓ Therefore the variance of the exponential distribution will be equal to
Probability Distributions
Discrete Distributions
Among the discrete distributions that we will look at includes the Bernoulli,
binomial, Negative binomial, Poisson, geometric and hyper-geometric.
1) Bernoulli Distribution
✓ The Bernoulli distribution deals with data which only has 1 trial and only 2
possible outcomes.- success and failure.
✓ A real life example is the situation of passing or failing and an exam and
considering passing as success and failing as failure. Or tossing a coin and
considering heads as a success and tails as a failure
✓ Therefore a Bernoulli is distribution is a discrete distribution with two
possible outcomes labeled as x=0 and x=1; in which x=1 (“success”) occurs
with probability p and x=0 (“failure”) occurs with probability q = 1-p,
where 0 < p < 1. It therefore has a probability mass function given by:
The pmf of a Bernoulli distribution
✓ Where
Example
Solution
Geometric Distribution
✓ It is the distribution of the number of trials needed to get the first
success.
M (t ) = e ( et −1) =2 =
Example
e − x
f ( x) = P( X = x) =
x!
Hypergeometric distribution
✓ It is the distribution of the number of successes when drawing without
replacement from a source that contains certain successes and failures.
✓ The pmf of a hypergeometric distribution is given by:
Where
Example
Suppose that a shipment contains 5 defective items and 10
non defective items. If 7 items are selected randomly
without replacement, what is the probability that at least 3
defective items will be selected.
Solution
Continuous Distributions
Uniform Distribution
Mean
Variance
Exponential distribution
The exponential distribution is often concerned with the amount of time
until some specific event occurs.
Example
Torch batteries have a lifespan T years with pdf:
Normal Distribution
The density function for this distribution is given by:
MGF
1 x−
2
1 −
M (t ) = E (e ) = e f ( x)dx = etx
tx tx
e 2
dx
− −
2
1 x−
2
1 −
= e e e tx t −t
e 2
dx
−
2
1 x−
2
t −
e
t ( x− ) 2
= e e dx
2 −
e t
−
1
( x− ) −2 t ( x− )
2 2
= 2 2
e dx
2 −
On completing the square of the exponent we obtain: