Lecture Notes Probability and Statistics - 1
Lecture Notes Probability and Statistics - 1
Ignatius Nyendah
Set Operations
Set Algebra
Probability Theory
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 2 / 135
Basic Set Theory
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 3 / 135
Definition
A set is a “collection" of well-defined objects called elements or members
of that set.
Sets are usually denoted with capital letters A, B, C , X , Y , etc. while
elements of the set are denoted with lower case letters
a, b, c, x , y , etc.. If x is an element or a member of set A, this can be
written by using set builder notation as x ∈ A otherwise x ∈/ A.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 4 / 135
Example
1. The set of natural numbers N = {0, 1, 2, . . . } whose members or
elements are 0, 1, 2, . . .
2. In set theory, there is a set known as the “empty" set, which means a
set with no elements and it is denoted by ∅. It is formally and logically
used in set operations. Hence, if x is any object then the statement x ∈ ∅
is logically false.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 5 / 135
Set Representation
Basically, a set can be represented in two different forms:
i. The “roster or list form" in which members of such a set are listed
without replacement between curly brackets and separated by
commas or semicolons.
ii. The “statement form" where elements of the set are represented by a
rule or a statement that is defined between curly brackets.
Example
i. A := {0, 2, 4, 6}
ii. A := { n ∈ N: n is even and n ≤ 6}
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 6 / 135
(Graphical Representation of sets)
A set can also be graphically represented by diagrams called the Venn
diagram as it has been shown below for some set A, B and C with their
correspondences.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 7 / 135
Definition
Let A be any set. We say the cardinality or size of A is defined as the
number of elements or members in A. This number is denoted by Card(A)
, #A or |A|. Also, we say that the set A is finite if its size is finite, thus if
#A ∈ N otherwise it is said to be infinite and we write it as #A = ∞.
Example
1. Since the empty set ∅ has no element, then clearly #∅ = 0.
2. The set of numbers on a six-sided dice in a roster form is
Ω = {1, 2, 3, 4, 5, 6}. Obviously #Ω = 6 ∈ N and hence Ω is finite.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 8 / 135
Definition
Let A and B be two sets. We say that A is a subset of B (or that A is
included in B) if every member of A is also a member of B. This is
denoted by A ⊂ B and on the contrary A ̸⊂ B.
Remark
For any set E , one always have the ∅ ⊂ E and E ⊂ E .
Exercise
If A and B are two set such that A ⊂ B, then show by contradiction that
#A ≤ #B.
Definition
Let A and B be two sets. We say that A and B are equal if and only if
A ⊂ B and B ⊂ A and it is denoted by A = B otherwise A ̸= B.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 9 / 135
Definition
A set is said countable if it is infinite and if one can enumerate its
members (without repetition) using an infinite subset of natural numbers.
Otherwise it is said uncountable. A set is said to be most countable if it is
finite or countable as above.
Example
1) The set Z := {. . . , −2, −1, 0, 1, 2, . . . } of integers is countable but this
is not so obvious to prove!
2) But clearly N is countable by definition.
Exercise
Consider the following sets: R, N, C, Z, D and Q.
1) Name and range them in the order of inclusion from the tiniest to the
biggest.
2) Tell which ones are countable or uncountable.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 10 / 135
The complement of a set A, with respect to the universal set Ω, is
the set {x ∈ Ω|x ∈
/ A} of all the elements of Ω that do not belong to
A and is denoted by Ac .
Note that Ωc = ∅.
The union of two sets A and B is the set of all elements that belong
to A or B (or both) and is denoted by A ∪ B. The intersection of
two sets A and B is the set of all elements that belong to both A and
B and it is denoted by A ∩ B.
Thus
A ∪ B = {x |x ∈ A or x ∈ B},
A ∩ B = {x |x ∈ A and x ∈ B}.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 11 / 135
In some cases, we will have to consider the union or the intersection
of several, even infinitely many sets, defined in the obvious way. For
example, if for every positive integer n, we are given a set An , then
∞
[
An = A1 ∪ A2 ∪ · · · = {x |x ∈ An for some n}
n=1
and
∞
\
An = A1 ∩ A2 ∩ · · · = {x |x ∈ An for some n}.
n=1
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 12 / 135
Set Algebra
A∪B =B∪A
A ∩ (B ∪ C ) = (A ∩ B) ∪ (A ∩ C )
(Ac )c = A
A∪Ω=Ω
A ∪ (B ∪ C ) = (A ∪ B) ∪ C
A ∪ (B ∩ C ) = (A ∪ B) ∩ (A ∪ C )
A ∩ Ac = ∅
A∩Ω=A
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 13 / 135
Two particularly useful properties are given by de Morgan’s Law which
states that
∞
[ c ∞
\
An = Acn
n=1 n=1
and
∞
\ c ∞
[
An = Acn .
n=1 n=1
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 14 / 135
Probability Theory
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 15 / 135
Basic Concepts of Probability
The most pertinent fundamental concepts applied in structural reliability
include:
Experiment
Random Experiment
Sample Space
Event
Definition
An experiment in the theory of probability is understood as the realization
of a certain set of conditions.
Definition
A random experiment is any real-life situation whereby one performs an
experiment or phenomenon and cannot predict the outcome(s) with
certainty.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 16 / 135
Definition
The sample space (or the outcome space) for a random experiment is the
set, usually denoted by S or Ω , of all its possible outcomes.
Definition
An event is simply a collection of certain sample points, that is, a subset
of the sample space. Mathematically, if we consider any random
experiment with sample space Ω.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 17 / 135
Class Activity
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 18 / 135
Probabilistic Models
A probabilistic model is a mathematical description of an uncertain
situation. The two main elements of probabilistic model include:
The sample space
Probability law
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 19 / 135
Sequential Models
Many experiments have an inherently sequential character, such as for
example tossing a coin three times, or observing the value of a stock
on five successive days, or receiving eight successive digits at a
communication receiver. Therefore, it is often useful to describe the
experiment and the associated sample space by means of a tree-based
sequential description, as shown below in
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 21 / 135
Discrete Models
There are many instances when we are faced with the analysis of discrete
data rather than continuous data.
Discrete Probability Law
Given a finite number of possible outcomes, the probability law is specified
by the probabilities of the events that consist of a single element. The
probability of any event {s1 , s2 , . . . , sn } is the sum of the individual
probabilities of its elements and it is given as
P({s1 , s2 , . . . , sn }) = P(s1 ) + P(s2 ) + · · · + P(sn )
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 22 / 135
Discrete Models Cont.
Example
Consider the experiment of rolling a pair of 4-sided dice . We assume the
dice are fair, and we interpret this assumption to mean that each of the
sixteen possible outcomes [pairs(i, j), withi.j = 1, 2.3, 4] has the same
1
probability of 16 . To calculate the probability of an event , we must count
the number of elements of the event and divide by 16 (the total number of
possible outcomes). Find the following
1. Write all elements of Ω
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 23 / 135
Continuous Models
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 24 / 135
The Fundamental Counting Principle
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 25 / 135
Example
A representation of all possible Choice. This tree diagram shows that there
are 6 different outfits from 2 pairs of jeans and three T-shirts.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 26 / 135
Example
Trial The Greasy Spoon Restaurant offers 6 appetizers and 14 main
courses. In how many ways can a person order a two-course meal?
Example
Draw a tree diagram to represent the number of possible outfits from 2
pairs of jeans, 3 T-shirts and 2 pairs of sneakers.
Example
Next semester, you are planning to take three courses: math, English and
humanities. There are 8 sections of math, 5 of English, and 4 of
humanities that you find suitable. Assuming no scheduling conflicts, how
many different three-course schedules are possible
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 26 / 135
Permutations
Definition
Permutation is an ordered arrangement of items that occurs when:
No item is used more than once.
The order of arrangement makes a difference.
Example
1. You need to arrange seven of your favourite books along a small shelf.
How many different ways can you arrange the books, assuming that
the order of the books makes a difference to you?
2. Suppose a business owner has a choice of 5 locations in which to
establish her business. She decides to rank each location according to
certain criteria, such as price of the store and parking facilities. How
many different ways can she rank the 5 locations?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 27 / 135
A Formula for Permutations
The number of possible permutations of r items are taken from n items is:
n!
n Pr = (3)
(n − r )!
Worked Example
You and 19 of your friends have decided to form a business. The group
needs to choose three officers– a CEO, an operating manager, and a
treasurer. In how many ways can those offices be filled?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 28 / 135
Solution:
Your group is choosing r = 3 officers from a group of n = 20 people. The
order matters because each officer has different responsibilities. We use
the formula (3)
to have
20!
20 P3 =
(20 − 3)!
20!
=
17!
20 × 19 × 18 × 17!
=
17!
= 6840.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 29 / 135
Permutation of Duplicate Items
Worked Example
In how many distinct ways can the letters of the word MISSISSIPPI be
arranged?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 30 / 135
Solution:
The word contains 11 letters (n = 11) where four Is are identical (p = 4),
four Ss are identical (q = 4) and 2 Ps are identical (r = 2). The number
of distinct permutations are:
n! 11!
=
p!q!r ! 4!4!2!
11 · 10 · 9 · 8 · 7 · 6 · 5 · 4!
=
4! · 4 · 3 · 2 · 1 · 2 · 1
= 34, 650
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 31 / 135
Combinations
Definition
A selection of distinct objects without regard to order is called a
combination.
Notably, Permutation problems involve situations in which order matters
while Combination problems involve situations in which the order of items
makes no difference.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 32 / 135
A Formula for Combinations
The number of possible combinations if r items are taken from n items is:
!
n n!
n Cr = = , for 0 ≤ r ≤ n. (5)
r r !(n − r )!
Examples
1. How many three-person committees could be formed from 8 people?
2. Suppose a committee of 5 students is to be selected from 25
students. In how many ways can this be done?
3. A newspaper editor has received 8 books to review. He decides that
he can use 3 reviews in his newspaper. How many different ways can
these 3 reviews be selected?
4. How many combinations of 4 objects are there, taken 2 at a time?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 33 / 135
Quiz (20 mins)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 34 / 135
Conditional Probability
P(A ∩ B)
P(A|B) = , P(B) > 0. (7)
P(B)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 35 / 135
P(Ω ∩ B)
P(Ω|B) =
P(B)
P(B)
=
P(B)
= 1 (Nonnegativity and Normalization)
For any two events A1 and A2 such that the event B has occurred, the
conditional probability is given as
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 36 / 135
P(A1 ∪ A2 |B)
P A1 ∪ A2 =
P B
P(A1 ∪ A2 ∩ B)
=
P B
P (A1 ∩ B) ∪ (A2 ∩ B)
=
P B
P (A1 ∩ B) + (A2 ∩ B)
=
P B
P (A1 ∩ B) P (A2 ∩ B)
= +
P B P B
= P A1 |B + P A2 |B (Additivity)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 37 / 135
Properties of Conditional Probability
P(A ∩ B)
P(A|B) = (8)
P(B)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 38 / 135
Modeling Using Conditional Probability
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 39 / 135
A sequential representation of the sample space is appropriate here, as
shown below:
P(B|A) = 0.99
Aircraft Present
P(A) = 0.05
P(Ac ) = 0.95
Aircraft not Present
Figure: Sequential description of the sample space for the radar detection problem.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 40 / 135
Let A and B be the events
A = { an aircraft is present },
B = { the radar registers an aircraft presence },
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 41 / 135
Example
I roll a fair dice twice and obtain two numbers α1 = result of the first roll
and α2 = result of the second roll. Given that I know α1 + α2 = 7, what is
the probability that α1 = 4 or α2 = 4 ?
n
\ n−1
\
P Ai = P(A1 )P(A2 |A1 )P(A2 )P(A3 |A1 ∩ A2 ) · · · P An | Ai
i=1 i=1
(9)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 43 / 135
Example
Three cards are drawn from an ordinary 52-card deck without replacement
(drawn cards are not placed back in the deck ) . Find the probability that
none of the three cards is a heart.
Solution:
First, we define the events Ai = { the ith card is not a heart }i = 1, 2, 3
We will calculate P(A1 ∩ A2 ∩ A3 ), the probability that none of the three
card is a heart, using the multiplication rule
We have
39
P(A1 ) =
52
Since there are 39 card that are not heart in the 52-card deck. Given that
the first card is not a heart, we are left with 51 cards. 38 of which are not
hearts, and
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 44 / 135
38
P(A2 |A1 ) = .
51
Finally, given that the first two cards drawn are not hearts. there are 37
cards which are not hearts in the remaining 50 card deck. and
37
P(A3 |A1 ∩ A2 ) =
50
Therefore,
39 38 37
P(A1 ∩ A2 ∩ A3 ) = · ·
52 51 50
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 45 / 135
Example
A class consisting of 4 graduate and 12 undergraduate students is
randomly divided into four groups of 4. What is the probability that each
group includes a graduate student?
Solution:
We will calculate P(A3 ) using the multiplication rule
We have
12
P(A1 ) =
15
Since there are 12 student slots in groups other than the one of student 1,
and there are 15 students slots overall, excluding student 1. Similarly,
8
P(A2 |A1 ) =
14
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 46 / 135
since there are 8 student slots in groups other than those of students 1
and 2, and there are 14 student slots, excluding students 1 and 2. Also
4
P(A3 |A1 ∩ A2 ) =
13
since there are 4 student in groups other than those of students 1, 2 and
3, and there are 13 students slots, excluding student 1, 2 and 3. Thus, the
desired probability is
12 8 4
× × .
15 14 13
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 47 / 135
Total Probability Theorem
Total Probability Theorem
Let A1 , . . . , An be disjoint events that form a partition of the sample
space (each possible outcome is included in exactly one of the events
A1 , . . . , An ) and assume that P(Ai ) > 0, for all i. Then, for any
event B, we have
Example
You enter a chess tournament where your probability of winning a game is
0.3 against half the players (call them type 1). 0.4 against a quarter of the
players (call them type 2), and 0.5 against the remaining quarter of the
players (call them type 3). You play a game against a randomly chosen
opponent. What is the probability of winning?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 48 / 135
Solution:
Let Ai be the event of playing with an opponent of type i. We have
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 49 / 135
Example
Alice is taking a probability class and at the end of each week she can be
either up-to-date or she may have fallen behind. If she is up-to-date in a
given week, the probability that she will be up-to-date (or behind) in the
next week is 0.8 (or 0.2, respectively). If she is behind in a given week, the
probability that she will be up-to-date (or behind) in the next week is 0.6
(or 0.4, respectively). Alice is (by default) up-to-date when she starts the
class. What is the probability that she is up-to-date after three weeks?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 50 / 135
Bayes’ Rule
Bayes’ Rule
Let A1 , . . . , An be disjoint events that form a partition of the sample
space and assume that P(Ai ) > 0, for all i. Then, for any event B
such that P(B) > 0, we have
P(Ai )P(B|Ai )
P(Ai |B) =
P(B)
P(Ai )P(B|Ai )
=
P(A1 )P(B|A1 ) + · · · + P(An )P(B|An )
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 51 / 135
Example
A test of a certain rare disease is assumed to be correct 95% of the time:
if a person has the disease, the test results are positive with probability
0.95, and if the person does not have the disease, the test results are
negative of probability 0.95. A random person drawn from a certain
population has probability 0.001 of having the disease. Given that the
person just test positive, what is the probability of having the disease?
Solution:
If A is the event that the person has the disease, and B is the event that
the test results are positive, the desire probability, P(A|B), is
P(A)P(B|A)
P(A|B) =
P(A)P(B|A) + P(Ac )P(B|Ac )
0.001 × 0.95
=
(0.001 × 0.95) + (0.999 × 0.05)
= 0.0187
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 52 / 135
Assignment
Suppose 1 in 100 persons has a certain disease. A test detects the disease
in 99% of diseased person. The test also “detect" the disease in 5% of
healthy persons. With what probability does a positive test diagnose the
disease?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 53 / 135
Independent Events
Independent Events
As we have introduced conditional probability to capture the partial
information that event B provides about event A. An interesting and
important special case arises when the occurrence of B provides no
such information and does not alter the probability that A has oc-
curred
P(A|B) = P(A)
P(A ∩ B)
P(A|B) =
P(B)
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 54 / 135
The above relation is equivalent to
Example
Two numbers are drawn at random from the set {1, 2, 3, 4}. If order is not
important then what is the sample space Ω? Define the following
functions on Ω:
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 55 / 135
Conditional Independence Two events A and B are said to be con-
ditionally independent, given another event C with P(C ) > 0, if
\
P Ai = Πi ∈ SP(Ai ), for every subset S of {1,2,3,. . . , n}
i∈S
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 56 / 135
For the case of three events A1 , A2 and A3 , independence amounts to
satisfying the four conditions
The first three conditions simply asserts that any two events are
independent, a property know as pairwise independence. But the fourth
condition is also important and does not follow from the first three.
Conversely, the fourth condition does not imply the first three.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 57 / 135
Section Exercises
1 You purchase a certain product. The manual states that the lifetime
T of the product, defined as the amount of time (in years) the
product works properly until it breaks down, satisfies
t
P(T > t) = e − 5 , ∀t ≥ 0.
You purchase the product and use it for two years without any
problems. What is the probability that it breaks down in the third
year?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 58 / 135
Section Exercises Cont’d
1 In my town, it’s rainy one third of the days. Given that it is rainy,
there will be heavy traffic with probability 12 , and given that it is not
rainy, there will be heavy traffic with probability 41 . If it’s rainy and
there is heavy traffic, I arrive late for work with probability 12 . On the
other hand, the probability of being late is reduced to 18 if it is not
rainy and there is no heavy traffic. In other situations (rainy and no
traffic, not rainy and traffic) the probability of being late is 0.25. You
pick a random day.
a. What is the probability that it’s not raining and there is heavy traffic
and I am not late?
b. What is the probability that I am late?
c. Given that I arrived late at work, what is the probability that it rained
that day?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 59 / 135
Discrete Random Variables
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 60 / 135
Definition
A discrete random variable is a function X (s) from a finite or countably
infinite sample space Ω to the real numbers:
X (.) : Ω → R.
with
the value X (s) = 2 corresponds to the event {HHT , HTH, THH}, and the
values 1 < X (s) ≤ 3, corresponds to {HHH, HHT , HTH, THH}.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 62 / 135
Probability Mass Function PMF The most important way to char-
acterize a random variable is through the probabilities of the values
that it can take. For a discrete random variable X , these are cap-
tured by the probability mass function of X . In particular, if x is
any possible value of X , the probability mass of x denoted by pX (x )
is the probability of the event {X = x } consisting of all outcomes the
gives rise to a value of X equal to x:
pX (x ) = P({X = x })
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 63 / 135
Example
Let the experiment consist of tow independent tosses of a fair coin and let
X be the number of heads obtained. Then, the PMF of X is
1
4 if x = 0 or x = 2
pX (x ) = 1
, if x = 1,
2
0, otherwise
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 64 / 135
Value-Ranges of a random variable correspond to events in Ω have a
probability. Thus Value-ranges have a probability.
Example
For the sample space
with
we have
6
P(0 < X ≤ 2) = .
8
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 64 / 135
Trial: What are the values of
Note: We will use upper case characters to denote random variables, and
lower case characters to denote real numbers such as the numerical values
of a random variable.
X
pX (x ) = 1
x
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 65 / 135
Note: We also write pX (x ) to denote P(X = x ).
Example
For the sample space
with
we have
1
pX (0) = P({TTT }) =
8
3
pX (1) = P({HTT , THT , TTH}) =
8
3
pX (2) = P({HHT , HTH, THH}) =
8
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 66 / 135
1
pX (3) = P({HHH}) =
8
where
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 67 / 135
Example
Toss a coin until “Heads" occurs. The sample space Ω is countably
infinite, namely
Then
1 1 1
pX (1) = , pX (2) = , pX (3) = , . . . (why ?)
2 4 8
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 68 / 135
and, as should be the case,
∞ n
1
X X
p(k) = lim p(k) = lim 1− =1
k=1
n→∞
k=1
n→∞ 2n
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 69 / 135
Expectation
We define the expected value (also called the expectation or the mean)
of a random variable X , with PMF pX by
X
E[x ] = x pX x .
x
Example
Consider two independent coin tosses, each with a 34 probability of a head,
and let X be the number of heads obtained. This is a binomial random
variable with parameters n = 2 and p = 43 . Its PMF is
2
1
, if k = 0
4
pX (k) = 2 41 3
4 , if k = 1
2
3
4 , if k = 2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 70 / 135
So the mean is
2 2
1 1 3 3 24 3
E=0· +1· 2· · +2· = =
4 4 4 4 16 2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 71 / 135
Variance
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 72 / 135
Properties of Mean and Variance
Given a random variable of the form
Y = aX + b
where a and b are scalars. Let us derive the mean and the variance of the
linear function Y . We have
X X X
E[Y ] = (ax + b)pX (x ) = a xpx (x ) + b pX (x ) = aE[X ] + b.
x x x
Furthermore,
X
var (Y ) = (ax + b − E[aX + b])2 pX (x )
x
X
= (ax + b − aE[X ] − b)2 pX (x )
x
X
2
=a (x − E[X ])2 pX (x )
x
2
= a var (X ).
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 73 / 135
Variance in Terms of Moments Expression
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 74 / 135
Example
If the weather is good (which happens with probability 0.6). Alice walks
the 2 miles to class at a speed of V = 5 miles per hour, and otherwise
rides her motorcycle at a speed of V = 30 miles per hour. What is the
mean of the time T to get to class?
Solution:
To solve this problem we first derive the PMF of T
(
2
0.6 if t = 5 hours
pT (t) = 2
0.4 if t = 30 hours
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 75 / 135
Exercises
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 76 / 135
Joint Distribution
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 77 / 135
Consider two discrete random variables X and Y associated with the same
experiment. The probabilities of the values that X and Y can take are
captured by joint PMF of X and Y denoted by pX ,Y (x , y ) i.e. it describes
how much probability mass is placed on each possible pair of values (x , y ).
In particular, if (x , y ) is a pair of possible values of X and Y , the
probability mass of (x , y ) is the probability of the event
pX ,Y (x , y ) = P(X = x , Y = y ).
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 78 / 135
We can define the range from X and Y as
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 79 / 135
We can use the joint PMF to find P((X , Y ) ∈ A) for any set A ∈ R2 i.e.
the set of all pairs (x , y ). Specifically, we have
X
P ((X , Y ) ∈ A) = P(X ,Y ) (xi , yj )
(x ,y )∈A
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 80 / 135
Example
An insurance company has customers with both home and auto policy. For
each type of policy, a deductible amount must be specified.
For auto policy, choices are 100 and 250 ghc.
For home policy, choices are 0, 100, and 200 ghc.
Suppose a customer is selected at random. Let
X be his deductible on the auto policy
Y his deductible on the home policy.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 81 / 135
p(x , y ) [y /x ] 0 100 200
100 0.20 0.10 0.20
250 0.05 0.15 0.30
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 82 / 135
Example
Toss a coin 3 times in sequence. For the sample space
We let
X (s) = number of Heads, Y (s) = index of the first H(0 for TTT ).
p(X ,Y ) (x , y ) = P(X = x , Y = y ).
For example
pX ,Y (2, 1) = P(X = x , Y = y )
= P(2 Heads, 1st toss is Heads)
1
=
4
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 83 / 135
Independent Random Variable
pX ,Y (x , y ) = pX (x )pY (y ).
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 83 / 135
EXERCISE: Are these random variables X and Y independent?
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 84 / 135
Expected Value of a Function
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 85 / 135
Example
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 86 / 135
The expected value of a function of two random variables is
XX
E[g(X , Y )] ≡ g (xk , yℓ ) p(X ,Y ) (xk , yℓ ) .
k ℓ
1 1 1 5
E[X ] = 1 · +2· +3· =
2 3 6 3
2 1 1 3
E[Y ] = 1 · + 2 · + 3 · =
3 6 6 2
1 1 1
E[XY ] = 1 · + 2 · +3·
3 12 12
2 1 1
+2· +4· +6·
9 18 18
1 1 1 5
+3· +6· +9· =
9 36 36 2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 87 / 135
Conditional Distribution
P(Y = 0 ∩ X = 100)
P(Y = 0|X = 100) = = ............
P(X = 100)
P(Y = 100|X = 100) =...............................
P(Y = 200|X = 100) =......................................
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 88 / 135
Variance and Standard Deviation
Let X have mean
µ = E[X ]
Then the variance of X is
h i
(xk − µ)2 p (xk )
X
Var(X ) ≡ E (X − µ)2 ≡
k
which is the average weighted square distance from the mean. We have
h i
Var(X ) = E X 2 − 2µX + µ2
h i
= E X 2 − 2µE[X ] + µ2
h i
= E X 2 − 2µ2 + µ2
h i
= E X 2 − µ2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 89 / 135
The standard deviation of X is
q q q
σ(X ) ≡ var(X ) = E [(X − µ)2 ] = E [X 2 ] − µ2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 90 / 135
Covariance Between Two Discrete Random Variables
Suppose X and Y are discrete and defined on the same sample space.
Then the covariance Cov (X , Y ) between X and Y is defined by
Remark
Cov (X , X ) = E((X − µx )2 ) = Var (X )
Cov (X , Y ) = E(XY ) − µx µy
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 91 / 135
Example
Suppose X and Y are discrete with joint pmf given by
y =0 y =1 y =2 y =3
1 2 1
x =0 8 8 8 0
1 2 1
x =1 0 8 8 8
Compute Cov (X , Y ).
Cov (X , Y ) =E(XY ) − µx µy
1
2, x = 0
PX (x ) = 1
2 , x =1
0, otherwise
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 92 / 135
1
8 , y = 0, y = 3
PY (y ) = 3
8 , y = 1, 2
0, otherwise
1
E(X ) =
2
3
E(Y ) =
2
Students are required to complete the solution.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 93 / 135
Exercise
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 94 / 135
Covariance of Independent Variables
Definition
The covariance of two random variables X and Y is
Show that
E[X ] = 2
E[Y ] = 8
E[X , Y ] = 16
Cov(X , Y ) = 0
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 96 / 135
Trial
Compute h i h i
E[X ], E[Y ], E X2 , E Y 2
E[XY ], var(X ), var(Y )
for
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 97 / 135
Special Discrete Random Variables
P(X = 1) = p
P(X = 0) = 1 − p
E[X ] = 1 · p + 0 · (1 − p) = p
h i
E X 2 = 12 · p + 02 · (1 − p) = p
h i
var(X ) = E X 2 − E[X ]2 = p − p 2 = p(1 − p).
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 98 / 135
Examples of Bernoulli Trials
1
- When p = 2 (e.g., for tossing a coin), we have
1 1
E[X ] = p = , Var(X ) = p(1 − p) = .
2 4
- When rolling a die, with outcome k, (1 ≤ k ≤ 6), let X (k) = 1 if the roll
resulted in a six, and X (k) = 0 if the roll did not result in a six. Then
1 5
E[X ] = p = , Var(X ) = p(1 − p) = .
6 36
- When p = 0.01, then
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 99 / 135
The Binomial Random Variable
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 100 / 135
The Binomial Random Variable
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 100 / 135
Hence, the solution to our problem becomes;
X (100011001010) = 5.
!
12
P(X = 5) = · p 5 · (1 − p)7 .
5
In general, for k successes in a sequence of n trials, we have
!
n
P(X = k) = · p k · (1 − p)n−k , (0 ≤ k ≤ n)
k
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 101 / 135
Assignment
and !
n
P(X = k + 1) = · p k+1 · (1 − p)n−k−1 ,
k +1
it follows that
P(X = k + 1) = ck · P(X = k),
where
n−k p
ck = · .
k +1 1−p
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 102 / 135
NOTE : This recurrence formula is an efficient and stable algorithm to
compute the binomial probabilities :
P(X = 0) = (1 − p)n
P(X = k + 1) = ck · P(X = k), k = 0, 1, · · · , n − 1
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 103 / 135
Mean and Variance of the Binomial Random Variable
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 104 / 135
X ≡ X1 + X2 + · · · + Xn
We know that
E[Xk ] = p (11)
So
E[X ] = E [X1 ] + E [X2 ] + · · · + E [Xn ] = np.
We already know that
h i
Var (Xk ) = E Xk2 − (E [Xk ])2 = p − p 2 = p(1 − p),
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 106 / 135
Poisson Random Variable
when we take
This approximation is accurate if n is large and p small. Recall that for the
Binomial random variable E[X ] = np, and Var(X ) = np(1 − p) ∼ = np when
p is small. Indeed, for the Poisson random variable we will show that
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 107 / 135
A stable and efficient way to compute the Poisson probability
λk
P(X = k) = e −λ · , k = 0, 1, 2, · · · ,
k!
λk+1
P(X = k + 1) = e −λ · ,
(k + 1)!
is to use the recurrence relation
P(X = 0) = e −λ ,
λ
P(X = k + 1) = · P(X = k), k = 0, 1, 2, · · · .
k +1
NOTE : Unlike the Binomial random variable, the Poisson random variable
can have an arbitrarily large integer value k.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 108 / 135
The Poisson random variable
λk
P(X = k) = e −λ · , k = 0, 1, 2, · · · ,
k!
has (as shown later) : E[X ] = λ and Var(X ) = λ. The Poisson
distribution function is
k k
λℓ λℓ
e −λ = e −λ
X X
F (k) = P(X ≤ k) =
ℓ=0
ℓ! ℓ=0
ℓ!
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 109 / 135
The Poisson random variable
λk
P(X = k) = e −λ · , k = 0, 1, 2, · · · ,
k!
models the probability of k "successes" in a given "time" interval, when
the average number of successes is λ.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 110 / 135
Example
Suppose customers arrive at the rate of six per hour. The probability that
k customers arrive in a one-hour period is
60 ∼
P(k = 0) = e −6 · = 0.0024
0!
6 1
P(k = 1) = e −6 · ∼
= 0.0148
1!
6 2
P(k = 2) = e −6 · ∼
= 0.0446
2!
The probability that more than 2 customers arrive is
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 111 / 135
In Class Exercise
Question 1
Defects in a certain wire occur at the rate of one per 10 meter. Assume
the defects have a Poisson distribution.
What is the probability that:
- a 20-meter wire has no defects?
- a 20-meter wire has at most 2 defects?
Question 2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 112 / 135
Group Project
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 113 / 135
Transforms (Moment Generating Function)
MX (s) = E[e sX ]
X
MX (s) = e sx pX (x )
x
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 114 / 135
By Taylor expansion of e tX about t = 0, we have
" #
h
tX
i t 2X 2 t 3X 3
ψ(t) ≡ E e = E 1 + tX + + + ···
2! 3!
t 2 h 2i t 3 h 3i
= 1 + tE[X ] + E X + E X + ···
2! 3!
It follows that
h i
ψ ′ (0) = E[X ] , ψ ′′ (0) = E X 2 ( Why ? )
This sometimes facilitates computing the mean and the variance µ = E[X ],
h i
Var(X ) = E X 2 − µ2
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 115 / 135
Application of Transforms
The Poisson mean and variance:
∞ ∞
h i λk
e tk e −λ
X X
tX tk
ψ(t) ≡ E e = e P(X = k) =
k=0 k=0
k!
∞
−λ (λe t )k t t −1)
= e −λ e λe = e λ(e
X
=e .
k=0
k!
Here t −1)
ψ ′ (t) = λe t e λ(e
h 2 i t −1)
ψ ′′ (t) = λ λ e t + e t e λ(e ( Check !)
so that
E[X ] = ψ ′ (0) = λ
h i
E X 2 = ψ ′′ (0) = λ(λ + 1) = λ2 + λ
h i
Var(X ) = E X 2 − E[X ]2 = λ
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 116 / 135
Continuous Random Variable
A random variable X is called continuous if there is a nonnegative function
fX , called the probability density function of X , or PDF for short, such that
Z
P(X ∈ B) = fX (x )dx ,
B
for every subset B of the real line. † In particular, the probability that the
value of X falls within an interval is
Z b
P(a ≤ X ≤ b) = fX (x )dx ,
a
and can be interpreted as the area under the graphR of the PDF (see Fig.
3.1). For any single value a, we have P(X = a) = aa fX (x )dx = 0. For
this reason, including or excluding the endpoints of an interval has no
effect on its probability:
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 118 / 135
Expectation of C.R.V and its Properties
Let X be a continuous random variable with PDF fX . The expectation of
X is defined by Z ∞
E[X ] = xfX (x )dx
−∞
- The expected value rule for a function g(X ) has the form
Z ∞
E[g(X )] = g(x )fX (x )dx
−∞
- The variance of X is defined by
h i Z ∞
2
var(X ) = E (X − E[X ]) = (x − E[X ])2 fX (x )dx
−∞
- We have h i
0 ≤ var(X ) = E X 2 − (E[X ])2 .
- If Y = aX + b, where a and b are given scalars, then
E[Y ] = aE[X ] + b, var(Y ) = a2 var(X )
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 119 / 135
Cumulative Distribution Function
FX (x ) ≡ P(X ≤ x ).
Thus
FX (b) − FX (a) ≡ P(a < X ≤ b).
We must have
FX (−∞) = 0 and FX (∞) = 1
i.e., and
lim FX (x ) = 0,
x →−∞
lim FX (x ) = 1.
x →∞
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 121 / 135
In general, from with
f (x ) ≡ F ′ (x ),
F (−∞) = 0 and F (∞) = 1,
we have from Calculus the following basic identities:
Z ∞ Z ∞
f (x )dx = F ′ (x )dx = F (∞) − F (−∞) = 1
−∞ −∞
Z x
f (x )dx = F (x ) − F (−∞) = F (x ) = P(X ≤ x )
−∞
Z b
f (x )dx = F (b) − F (a) = P(a < X ≤ b)
a
Z a
f (x )dx = F (a) − F (a) = 0 = P(X = a)
a
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 122 / 135
Continuous Random Variable
The probability density function is the derivative of the probability
distribution function :
d
fX (x ) ≡ FX′ (x ) ≡ FX (x ).
dx
Examples
In the "pointer example"
x ≤0
0,
0,
x ≤0
′
FX (x ) = x , 0 < x ≤ 1 and fX (x ) = FX (x ) = 1, 0<x ≤1
1, 1 < x 0, 1<x
Given that
( (
0, x ≤0 0, x ≤0
F (x ) = , f (x ) = ,
1 − e −x , x > 0 e −x , x > 0
verify that
P(0 < X ≤ 1) = F (1) − F (0) = F (1) = 1 − e −1 ∼
= 0.63,
P(X > 1) = 1 − F (1) = e −1 ∼
= 0.37,
P(1 < X ≤ 2) = F (2) − F (1) = e −1 − e −2 ∼
= 0.23.
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 124 / 135
In Class Exercise 2
For positive integer n, consider the density functions
(
cx n (1 − x n ) , 0 ≤ x ≤ 1
fn (x ) =
0, otherwise
∂ 2 FX ,Y (x ,y )
By Calculus we have ∂x ∂y = fX ,Y (x , y ). Also,
Z dZ b
P(a < X ≤ b, c < Y ≤ d) = fX ,Y (x , y )dxdy
c a
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 126 / 135
Joint Distribution
Example
If (
1 for x ∈ (0, 1] and y ∈ (0, 1],
fX ,Y (x , y ) =
0 otherwise
then, for x ∈ (0, 1] and y ∈ (0, 1],
Z yZ x
FX ,Y (x , y ) = P(X ≤ x , Y ≤ y ) = 1dxdy = xy .
0 0
Thus
FX ,Y (x , y ) = xy , for x ∈ (0, 1] and y ∈ (0, 1].
For example
1 1 1 1 1
P X ≤ ,Y ≤ = FX ,Y , = .
3 2 3 2 6
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 127 / 135
Joint Distribution
EXERCISE : (
(1 − e −x ) (1 − e −y ) for x ≥ 0
Let FX ,Y (x , y ) = and y ≥ 0,, -
0 otherwise
Verify that
(
∂2F e −x −y for x ≥ 0
fX ,Y (x , y ) = = and y ≥ 0
∂x ∂y 0 otherwise
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 128 / 135
Joint Distribution
FX ,Y (x , y ) = 1 − e −x 1 − e −y fX ,Y (x , y ) = e −x −y ,
, for x , y ≥ 0
fY (y ) = 0∞ e −x −y dx = e −y .
R
fX ,Y (x , y ) = fX (x ) · fY (y ).
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 129 / 135
Joint Distribution
P(1 < x < ∞) = FX (∞) − FX (1) = 1 − 1 − e −1 = e −1 ∼
= 0.37
Z 1Z 2
P(1 < x ≤ 2, 0 < y ≤ 1) = e −x −y dxdy
0 1
= e −1
− e −2 1 − e −1 ∼
= 0.15
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 130 / 135
Independent Continuous Random Variable
Recall that two events E and F are independent if
P (X ∈ IX , Y ∈ IY ) = P (X ∈ IX ) · P (Y ∈ IY ) ,
X −1 (IX ) ≡ {s ∈ S : X (s) ∈ IX }
NOTE :
Y −1 (IY ) ≡ {s ∈ S : Y (s) ∈ IY }
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 131 / 135
FACT : X (s) and Y (s) are independent if for all x and y
fX ,Y (x , y ) = fX (x ) · fY (y ).
Example:The random variables with density function
(
e −x −y for x ≥ 0
fX ,Y (x , y ) = and y ≥ 0,
0 otherwise ,
Example
For the pointer experiment
0,
x ≤0
fX (x ) = 1, 0<x ≤1
0, 1<x
we have
1
x2
Z ∞ Z 1
1
E [X ] = xfX (x )dx = xdx = =
−∞ 0 2 0
2
and
1
x3
Z ∞ Z 1
h
2
i
2 2 1
E X = x fX (x )dx = x dx = = .
−∞ 0 3 0
3
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 134 / 135
Joint Distribution
Ignatius Nyendah Probability, Statistics and Reliability (with MATLAB) March 14, 2024 135 / 135