0% found this document useful (0 votes)
18 views64 pages

STA 120-All Lectures

The document outlines the course STA 120 on Probability and Statistics II, covering topics such as random variables, probability functions, expectations, variance, and various probability distributions including Bernoulli, Binomial, Poisson, Normal, and Exponential. It includes definitions, examples, and exercises related to discrete and continuous random variables, as well as cumulative distribution functions and moment generating functions. Additionally, it discusses theorems on expectation and variance, providing a comprehensive overview of fundamental concepts in probability and statistics.

Uploaded by

bonvicky119
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views64 pages

STA 120-All Lectures

The document outlines the course STA 120 on Probability and Statistics II, covering topics such as random variables, probability functions, expectations, variance, and various probability distributions including Bernoulli, Binomial, Poisson, Normal, and Exponential. It includes definitions, examples, and exercises related to discrete and continuous random variables, as well as cumulative distribution functions and moment generating functions. Additionally, it discusses theorems on expectation and variance, providing a comprehensive overview of fundamental concepts in probability and statistics.

Uploaded by

bonvicky119
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 64

STA 120-PROBABILITY AND STATISTICS II

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.

STA 120 BY LYDIAH KWAMBOKA


Lecture 1: Random Variables
✓ A random variable is a rule/function that assigns a numerical
value to the outcome of a random experiment.
✓ It is usually denoted by a capital letter such as X or Y
✓ There are two types of random variables:
❖ Discrete random variable- A discrete random variable is
function whose range is finite and/or countable, i.e it
can only assume values in a finite or countably infinite
set of values.
❖Continuous random variable- A continuous random
variable is one that can take any value in an interval of
real numbers.

STA 120 BY LYDIAH KWAMBOKA


Probability distribution of Discrete Random Variables
✓ Let X be a discrete random variable and suppose that the
possible values it can assume are given by x1, x2, x3, …, xn
arranged in some order. Suppose also that these values are
assumed with probabilities given by
P(X=xi) =f(xi), i=1,2,…
✓ Then its probability distribution (also called a probability mass
function (pmf)) is given by P(X=x) = f(x). . In general, f(x) is a
probability mass function if:

where the sum in (ii) is taken over all possible values of x.


STA 120 BY LYDIAH KWAMBOKA
Example 1
A coin is tossed twice. Let X be the random variable that gives the
number of tails that can come up. Find the probability function.
Solution
Assuming that the coin is fair, we have p(HH)= ¼ , p(HT)= ¼ , p(TH)= ¼ ,
p(TT)= ¼
Then
p(x = 0) = p(TT) = ¼
p(x = 1) = p(HT ∪ TH) = p(HT) + p(TH) = ¼ + ¼ = ½
p(x = 2) = p(HH) = ¼
Hence the probability function is as given by:

STA 120 BY LYDIAH KWAMBOKA


Example 2
Find the probability distribution of boys and girls in families with 3
children, assuming equal probabilities for boys and girls. Let X be
the random variable that gives the number of boys in the family.
Solution
In a family of 3 children, the sample points for the sex of the
children are:
S={BBB, BBG, BGB, BGG, GBB, GBG, GGB, GGG}
If X be the random variable that gives the number of boys in the
family. Then X= {0,1,2,3}, we have that:

STA 120 BY LYDIAH KWAMBOKA


Hence the probability function becomes:

Practice Exercise
A die is thrown twice. Let the random variable X denote the sum
of its points. Obtain the probability distribution for X.

STA 120 BY LYDIAH KWAMBOKA


Probability distribution of Continuous Random
Variables

Example 1
Find the constant C such that the function

Cx 2 0 < x < 3


f ( x) = 
0, otherwise

is a density function. Hence compute p(1<x<2).

STA 120 BY LYDIAH KWAMBOKA


Solution

✓ Since f(x)≥0 if C≥0, it must satisfy ‫׬‬−∞ 𝑓 𝑥 𝑑𝑥 = 1
✓ Now  3

 f ( x ) dx =  dx
Cx 2

− 0

✓ = 9C, and since it must be equal to 1, we have that

✓ To obtain p(1<x<2) we proceed as follows:


2
1
p(1  x  2) =  x 2 dx
1
9
2
 1 3
= x 
 27 1
=8/27 -1/27 = 7/27
STA 120 BY LYDIAH KWAMBOKA
Lecture 2: The Cumulative Density Function/Distribution Function

The distribution function F(x) has the following properties:

i. F(x) is non decreasing [ i.e. F(x) ≤ F(y) if x<y]

ii. lim 𝐹 𝑥 = 0; lim 𝐹 𝑥 = 1


𝑥→−∞ 𝑥→∞

iii. F(x) is continuous from the right [ i.e. lim+ 𝐹 𝑥 + ℎ = 𝐹 𝑥 for all x]
ℎ→0

STA 120 BY LYDIAH KWAMBOKA


Example PMF to CDF

Lets us the probability function when tossing a coin twice

The distribution function or CDF can also be written as:

0, -<x<0
1
 4 , 0  x<1
F ( x) = 
 3 4 , 1  x<2

1, 2  x<

STA 120 BY LYDIAH KWAMBOKA


The graph of F(x) is given as:

STA 120 BY LYDIAH KWAMBOKA


Example for P.D.F to C.D.F

1 2
𝑥 0<x<3
If 𝑓(𝑥) = ൝9
0, otherwise
Find the CDF

STA 120 BY LYDIAH KWAMBOKA


Continuation

STA 120 BY LYDIAH KWAMBOKA


Example 2
The Distribution Function of a Random Variable is given by:

1 − e−2 x , x0
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

STA 120 BY LYDIAH KWAMBOKA


Continuation

Therefore the pdf is given by:

2e−2 x , x>0

0, otherwise

STA 120 BY LYDIAH KWAMBOKA


 

b)
p( x  2) =  f (u)du =  2e−2u dx
2 2
Solution
By definition

P(x≤2) =F(2) = 1-e-4

∴ 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

STA 120 BY LYDIAH KWAMBOKA


Continuation

0 4

  du
−2u
0 du + 2e
−3 0

4
0 + −e −2u
 = −e−8 + e0
0

= 1 − e−8

STA 120 BY LYDIAH KWAMBOKA


Lecture 3: Expectation and Variance of a
random variable
Expectation of a random variable
✓ One of the most important things we'd like to know about a random variable
is: what value does it take on average? What is the average price of a
computer?

STA 120 BY LYDIAH KWAMBOKA


Theorems on Expectation

Variance and Standard Deviation of a Random Variable

STA 120 BY LYDIAH KWAMBOKA


Theorems on Variance

STA 120 BY LYDIAH KWAMBOKA


Example for a discrete random variable

STA 120 BY LYDIAH KWAMBOKA


Example for a continuous random variable

STA 120 BY LYDIAH KWAMBOKA


Lecture 4. Moment generating functions
✓ Moments are expected values of random variables. Let X be a random
variable then:
✓ The nth moment of X about the origin, also called the nth raw

moment, is given by n
'
= E ( X n
) where n=0,1,2,….
✓ The nth moment of a random variable X about the mean μ, also called
the nth central moment, is defined as 𝜇𝑛 = 𝐸(𝑋 − 𝜇) 𝑛 where
n=0,1,2,…. We therefore have
Moment Generating Function

Theorem 1
Proof

Starting with the Taylor’s Expansion Series

We know that the

✓ We therefore introduce expectations to the Taylor’s series expansion.


Continuation…
We will therefore have:
Theorem 2

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

The Moment Generating Function of a Bernoulli Distribution.


Continuation
The Mean of the Bernoulli Distribution
The Variance of the Bernoulli Distribution
Binomial distribution
✓ It is the distribution of the number of success in n independent trials
✓ The binomial distribution model allows us to compute the probability of
observing a specified number of "successes" when the process is
repeated a specific number of times
✓ If p is the probability that any event will occur in any single Bernoulli
trial (i.e. the probability of success) and q = 1 - p is the probability
that it will fail to occur in a single Bernoulli trial (i.e. the probability
of failure), then the probability that the event will occur exactly x
times in n trials ( i.e. x successes and n-x failures) is given by:
 n  x
  p (1 − p ) ,
n− x
x=0, 1, 2, ..., n
p( X = x) =  x 
0,
 elsewhere
The pmf of a binomial distribution can also be written as:
Example
What is the probability that at least 9 out of a group of 10 people who
have been infected by a serious disease will survive, if the survival
probability for the disease is 70%?
 n  x
  ( ) ,
n− x
p 1 − p x=0, 1, 2, ..., n
p( X = x) =  x 
0,
 elsewhere
The MGF of the Binomial distribution
Continuation
The Mean of the Binomial Distribution
The Variance of the Binomial Distribution
Continuation
Continuation
The Negative Binomial Distribution
✓ A binomial distribution helps us to determine the number of successes
in a fixed number of trials, whereas, a negative binomial answers
number of trials needed for a given number of successes.
✓ The pmf of a negative binomial distribution is given by:

✓ Where
Example

Solution
Geometric Distribution
✓ It is the distribution of the number of trials needed to get the first
success.

The Moment Generating Function of a Geometric Distribution


Continuation
The Mean of a Geometric Distribution
The Variance of the Geometric Distribution
Continuation
Poisson Distribution
✓ The poisson distribution is used to model the number of events, (such
as the number of telephone calls at a business, number of customers
in waiting lines, number of defects in a given surface area, airplane
arrivals, or the number of accidents at an intersection), occurring
within a given time interval.
✓ Let X be a discrete random variable that can take on the values 0, 1,
2,…, then the pmf of a poisson distribution is given by:
e − x
f ( x) = P( X = x) =
x!

MGF Mean and Variance

M (t ) = e  ( et −1)  =2 = 
Example

Consider a computer system with Poisson job-arrival stream at an


average of 2 per minute. Determine the probability that in any
one-minute interval there will be a) 0 jobs; b) exactly 3jobs
Solution

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:

Determine the probability that the battery; a) Falls before 25 hours.


b) life is between 35 and 50 hours.
Solution
Gamma Distribution

Mean, Variance and mgf of a gamma distribution.


Beta Distribution

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:

You might also like