Probability and Statistics Basics
Probability and Statistics Basics
Mohit Kumar
VIT Chennai
Basics of Probability Theory
Probability
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
Probability
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
▶ It is the measure of chance that a particular event will occur.
Probability
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
▶ It is the measure of chance that a particular event will occur.
▶ The probability of an event can be calculated by dividing the
number of favourable outcomes by the total number of possible
outcomes.
Probability
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
▶ It is the measure of chance that a particular event will occur.
▶ The probability of an event can be calculated by dividing the
number of favourable outcomes by the total number of possible
outcomes.
Probability
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
▶ It is the measure of chance that a particular event will occur.
▶ The probability of an event can be calculated by dividing the
number of favourable outcomes by the total number of possible
outcomes.
What is Probability?
▶ Probability is a branch of mathematics that deals with the study
of random events or experiments.
▶ It is the measure of chance that a particular event will occur.
▶ The probability of an event can be calculated by dividing the
number of favourable outcomes by the total number of possible
outcomes.
Experiment
An experiment is a systematic and controlled process or activity carried out
to gather data or information about a particular phenomenon or system.
Elements of Probability
Experiment
An experiment is a systematic and controlled process or activity carried out
to gather data or information about a particular phenomenon or system.
Deterministic Experiment
▶ An experiment or a process in which the outcome can be predicted
with certainty before it is actually observed or performed.
Random Experiment
Elements of Probability
Experiment
An experiment is a systematic and controlled process or activity carried out
to gather data or information about a particular phenomenon or system.
Deterministic Experiment
▶ An experiment or a process in which the outcome can be predicted
with certainty before it is actually observed or performed.
▶ For instance, if we add 5 and 3, we know the outcome will always be 8,
and there is no randomness involved.
Random Experiment
Elements of Probability
Experiment
An experiment is a systematic and controlled process or activity carried out
to gather data or information about a particular phenomenon or system.
Deterministic Experiment
▶ An experiment or a process in which the outcome can be predicted
with certainty before it is actually observed or performed.
▶ For instance, if we add 5 and 3, we know the outcome will always be 8,
and there is no randomness involved.
Random Experiment
▶ An experiment or a process in which the outcome cannot be predicted
with certainty.
Elements of Probability
Experiment
An experiment is a systematic and controlled process or activity carried out
to gather data or information about a particular phenomenon or system.
Deterministic Experiment
▶ An experiment or a process in which the outcome can be predicted
with certainty before it is actually observed or performed.
▶ For instance, if we add 5 and 3, we know the outcome will always be 8,
and there is no randomness involved.
Random Experiment
▶ An experiment or a process in which the outcome cannot be predicted
with certainty.
▶ For example, tossing a coin is a random experiment because we cannot
predict the outcome of the coin toss with certainty.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Event
▶ An event is a subset of a sample space.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Event
▶ An event is a subset of a sample space.
▶ For example, the event of getting heads in a coin toss is {H}.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Event
▶ An event is a subset of a sample space.
▶ For example, the event of getting heads in a coin toss is {H}.
Elements of Probability
Sample Space
▶ The set of all possible outcomes of a random experiment is called the
sample space and is represented by the symbol S.
▶ For example, the sample space of a coin toss is S = {H, T}, where H
represents the outcome of getting heads and T represents the outcome
of getting tails.
▶ Each outcome in a sample space is called an element or a member of
the sample space, or simply a sample point.
Event
▶ An event is a subset of a sample space.
▶ For example, the event of getting heads in a coin toss is {H}.
Equally Likely Events
▶ Equally likely events are events that have the same theoretical
probability (or likelihood) of occurring.
Elements of Probability
#A
P(A) = ,
#S
#A
P(A) = ,
#S
#A
P(A) = ,
#S
#A
P(A) = ,
#S
Complement of an Event
▶ The complement of an event A with respect to S is the subset of
all elements of S that are not in A.
Set Theory
Complement of an Event
▶ The complement of an event A with respect to S is the subset of
all elements of S that are not in A.
▶ We denote the complement of A by the symbol Ac .
Set Theory
Complement of an Event
▶ The complement of an event A with respect to S is the subset of
all elements of S that are not in A.
▶ We denote the complement of A by the symbol Ac .
▶ For example, if A = {1, 2, 3} and S = {1, 2, 3, 4, 5, 6}, then
Ac = {4, 5, 6}.
Set Theory
Complement of an Event
▶ The complement of an event A with respect to S is the subset of
all elements of S that are not in A.
▶ We denote the complement of A by the symbol Ac .
▶ For example, if A = {1, 2, 3} and S = {1, 2, 3, 4, 5, 6}, then
Ac = {4, 5, 6}.
Set Theory
Complement of an Event
▶ The complement of an event A with respect to S is the subset of
all elements of S that are not in A.
▶ We denote the complement of A by the symbol Ac .
▶ For example, if A = {1, 2, 3} and S = {1, 2, 3, 4, 5, 6}, then
Ac = {4, 5, 6}.
A ∩ B = ∅,
Permutation
▶ A permutation is an arrangement of a set of objects in a specific
order.
Counting Principles
Permutation
▶ A permutation is an arrangement of a set of objects in a specific
order.
▶ In other words, it is a way of selecting and arranging a subset of
elements from a larger set, where the order of selection matters.
Counting Principles
Permutation
▶ A permutation is an arrangement of a set of objects in a specific
order.
▶ In other words, it is a way of selecting and arranging a subset of
elements from a larger set, where the order of selection matters.
▶ The total number of permutations of a set of n distinct objects
can be calculated using the formula n! (pronounced as “n
factorial”), where n! = n × (n − 1) × (n − 2) × · · · × 2 × 1, with
special case 0! = 1.
Counting Principles
Permutation
▶ A permutation is an arrangement of a set of objects in a specific
order.
▶ In other words, it is a way of selecting and arranging a subset of
elements from a larger set, where the order of selection matters.
▶ The total number of permutations of a set of n distinct objects
can be calculated using the formula n! (pronounced as “n
factorial”), where n! = n × (n − 1) × (n − 2) × · · · × 2 × 1, with
special case 0! = 1.
▶ The number of permutations of n objects arranged in a circle is
(n − 1)!.
Counting Principles
▶ The number of permutations of n distinct objects taken r at a
time is
n n!
Pr = .
(n − r)!
Counting Principles
▶ The number of permutations of n distinct objects taken r at a
time is
n n!
Pr = .
(n − r)!
▶ For example, the number of ways to select a committee of 3
members from a group of 6 people is
6 6!
P3 = = 6 × 5 × 4 = 120.
(6 − 3)!
Counting Principles
▶ The number of permutations of n distinct objects taken r at a
time is
n n!
Pr = .
(n − r)!
▶ For example, the number of ways to select a committee of 3
members from a group of 6 people is
6 6!
P3 = = 6 × 5 × 4 = 120.
(6 − 3)!
n!
.
n1 !n2 ! . . . nk !
Counting Principles
Combination
▶ A combination is a way of selecting a subset of objects from a
larger set, where the order of the selection does not matter.
Counting Principles
Combination
▶ A combination is a way of selecting a subset of objects from a
larger set, where the order of the selection does not matter.
▶ The number of combinations of k objects chosen from a set of n
distinct objects is
n n n!
Ck = = .
k k!(n − k)!
Counting Principles
Combination
▶ A combination is a way of selecting a subset of objects from a
larger set, where the order of the selection does not matter.
▶ The number of combinations of k objects chosen from a set of n
distinct objects is
n n n!
Ck = = .
k k!(n − k)!
5 5! 5×4
C3 = = = 10.
3!(5 − 3)! 2×1
Counting Principles
Partitioning
▶ Partitioning refers to the process of dividing a larger set into
smaller subsets or partitions.
Counting Principles
Partitioning
▶ Partitioning refers to the process of dividing a larger set into
smaller subsets or partitions.
▶ Each partition is a subset of the original set, and the union of all
partitions is equal to the original set.
Counting Principles
Partitioning
▶ Partitioning refers to the process of dividing a larger set into
smaller subsets or partitions.
▶ Each partition is a subset of the original set, and the union of all
partitions is equal to the original set.
▶ The number of ways of partitioning a set of n objects into k cells
with n1 elements in the first cell, n2 elements in the second, and
so forth is
n n!
= ,
n1 , n2 , . . . , nk n1 !n2 ! . . . nk !
where n1 + n2 + . . . + nk = n.
Probability of an Event
Classical Definition
▶ If a random experiment can result in any one of N different
equally likely outcomes, and if exactly n of these outcomes
correspond to event A, then the probability of event A is
n
P(A) = .
N
Probability of an Event
Classical Definition
▶ If a random experiment can result in any one of N different
equally likely outcomes, and if exactly n of these outcomes
correspond to event A, then the probability of event A is
n
P(A) = .
N
Probability of an Event
Classical Definition
▶ If a random experiment can result in any one of N different
equally likely outcomes, and if exactly n of these outcomes
correspond to event A, then the probability of event A is
n
P(A) = .
N
Relative Frequency Definition
▶ If there is no basis to assume the outcomes are equally likely,
then we can repeat the experiment n times, record the outcomes
favourable to event A, say na and then take the likelihood of the
event A with sample space S, as
na
P(A) = .
n
Probability of an Event
Axiomatic Definition
The axiomatic definition of probability includes three axioms:
1. For any event A,
P(A) ≥ 0
Probability of an Event
Axiomatic Definition
The axiomatic definition of probability includes three axioms:
1. For any event A,
P(A) ≥ 0
P(S) = 1
Probability of an Event
Axiomatic Definition
The axiomatic definition of probability includes three axioms:
1. For any event A,
P(A) ≥ 0
P(S) = 1
P(A∪B∪C) = P(A)+P(B)+P(C)−P(A∩B)−P(A∩C)−P(B∩C)+P(A∩B∩C).
Properties of Probability
▶ If A and B are two events, then
P(A∪B∪C) = P(A)+P(B)+P(C)−P(A∩B)−P(A∩C)−P(B∩C)+P(A∩B∩C).
Conditional Probability
▶ The conditional probability of event B given that A has occurred
is, denoted by P(B|A), and defined as
P(B ∩ A)
P(B|A) = ,
P(A)
Product Rule
Conditional Probability and Product Rule
Conditional Probability
▶ The conditional probability of event B given that A has occurred
is, denoted by P(B|A), and defined as
P(B ∩ A)
P(B|A) = ,
P(A)
Product Rule
▶ For any two events A and B,
P(A ∩ B) = P(A)P(B|A),
P(A ∩ B) = P(A)P(B).
Independence of Events
P(A ∩ B) = P(A)P(B).
▶ Example: The probability that A hits the target is 1/4 and the
probability B hits is 2/5. What is the probability the target will be
hit if A and B each shoot at the target?
Independence of Events
P(A ∩ B) = P(A)P(B).
▶ Example: The probability that A hits the target is 1/4 and the
probability B hits is 2/5. What is the probability the target will be
hit if A and B each shoot at the target?
▶ Ans: 11/20.
Generalized Product Rule
P(A1 ∩A2 ∩. . .∩Ak ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩A2 ) · · · P(Ak |A1 ∩A2 ∩· · ·∩Ak−1 ).
Generalized Product Rule
P(A1 ∩A2 ∩. . .∩Ak ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩A2 ) · · · P(Ak |A1 ∩A2 ∩· · ·∩Ak−1 ).
P(A1 ∩A2 ∩. . .∩Ak ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩A2 ) · · · P(Ak |A1 ∩A2 ∩· · ·∩Ak−1 ).
P(A1 ∩A2 ∩. . .∩Ak ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩A2 ) · · · P(Ak |A1 ∩A2 ∩· · ·∩Ak−1 ).
P(A1 ∩A2 ∩. . .∩Ak ) = P(A1 )P(A2 |A1 )P(A3 |A1 ∩A2 ) · · · P(Ak |A1 ∩A2 ∩· · ·∩Ak−1 ).
k
X k
X
P(A) = P(A ∩ Bi ) = P(Bi )P(A|Bi ).
i=1 i=1
Bayes’ Rule
▶ If the events B1 , B2 , · · · , Bk constitute a partition of the sample
space S such that P(Bi ) ̸= 0 for i = 1, 2, . . . , k, then for any
event A in S such that P(A) ̸= 0,
P(Br ∩ A)
P(Br |A) = Pk
i=1 P(Bi ∩ A)
P(Br )P(A|Br )
= Pk ,
i=1 P(Bi )P(A|Bi )
for r = 1, 2, . . . , k.
Bayes’ Rule
▶ If the events B1 , B2 , · · · , Bk constitute a partition of the sample
space S such that P(Bi ) ̸= 0 for i = 1, 2, . . . , k, then for any
event A in S such that P(A) ̸= 0,
P(Br ∩ A)
P(Br |A) = Pk
i=1 P(Bi ∩ A)
P(Br )P(A|Br )
= Pk ,
i=1 P(Bi )P(A|Bi )
for r = 1, 2, . . . , k.
▶ Example: A box contains 3 blue, 2 red marbles while another
box contains 2 blue, 5 red. A marble drawn at random from one
of the boxes terns out to be blue. What is the probability that it
come from the first box?
Bayes’ Rule
▶ If the events B1 , B2 , · · · , Bk constitute a partition of the sample
space S such that P(Bi ) ̸= 0 for i = 1, 2, . . . , k, then for any
event A in S such that P(A) ̸= 0,
P(Br ∩ A)
P(Br |A) = Pk
i=1 P(Bi ∩ A)
P(Br )P(A|Br )
= Pk ,
i=1 P(Bi )P(A|Bi )
for r = 1, 2, . . . , k.
▶ Example: A box contains 3 blue, 2 red marbles while another
box contains 2 blue, 5 red. A marble drawn at random from one
of the boxes terns out to be blue. What is the probability that it
come from the first box?
▶ Ans: 21/31.
Random Variables
Random Variable
Example:
▶ Suppose a coin is tossed twice so the sample space is
Example:
▶ Suppose a coin is tossed twice so the sample space is
▶ Ans: k = 1
2
and CDF is
0, x<0
2
x
0≤x≤1
,
4
x
F(x) = 2 − 4 ,1
1≤x≤2
−x2
3x 5
+ 2 − 4, 2 ≤ x ≤ 3
4
1, x > 3.
Joint Distributions
Joint Probability Distributions
Discrete Case
▶ For discrete random variables X and Y,
Marginal Distributions
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) =
P
y f (x, y),
Marginal Distributions
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = y f (x, y),
P
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = y f (x, y),
P
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = y f (x, y),
P
Continuous Case
▶ For Continuous random variables X and Y,
Marginal Distributions
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = y f (x, y),
P
Continuous Case
▶ For Continuous random variables X and Y,
R∞
▶ The marginal distribution of X is g(x) = fX (x) = f (x, y)dy,
−∞
Marginal Distributions
Discrete Case
▶ For discrete random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = y f (x, y),
P
Continuous Case
▶ For Continuous random variables X and Y,
▶ The marginal distribution of X is g(x) = fX (x) = ∞ f (x, y)dy,
R
R −∞
▶ The marginal distribution of Y is h(y) = fY (y) = ∞ f (x, y)dx.
−∞
Conditional Distributions
f (x, y)
f (x|y) = fX|Y (x|y) = ,
h(y)
Two ballpoint pens are selected at random from a box that contains 3
blue pens, 2 red pens, and 3 green pens. If X is the number of blue
pens selected and Y is the number of red pens selected.
(a) Find the joint probability function f (x, y).
(b) Find P[(X, Y) ∈ A], where A is the region {(x, y)|x + y ≤ 1}.
(c) Find the marginal distributions of X and Y.
(d) Find the conditional distribution of X, given that Y = 1, and use
it to determine P(X = 0|Y = 1).
(e) Show that the random variables X and Y are not statistically
independent.
Example 2:
R∞ R∞
(a) Show that −∞ −∞ f (x, y)dxdy = 1.
(b) Find P[(X, Y) ∈ A], where A = {(x, y)|0 < x < 21 , 14 < y < 12 }.
(c) Find the marginal distributions of X and Y.
(d) Find the conditional densities f (y|x), f (x|y), and then evaluate
P( 14 < X < 21 |Y = 13 ).
(e) Show that X and Y are not statistically independent.
Example 3:
R∞
▶ If g(X) = X 2 , then µX 2 = E(X 2 ) = x2 f (x).
−∞
Mean of a function of two Random Variables
2
Var[g(X)] = σg(X) = E[(g(X) − µg(X) )2 ]
X
= (g(x) − µg(X) )2 f (x).
x
Variance of a Function of a Random Variable
2
Var[g(X)] = σg(X) = E[(g(X) − µg(X) )2 ]
X
= (g(x) − µg(X) )2 f (x).
x
2
Var[g(X)] = σg(X) = E[(g(X) − µg(X) )2 ]
Z ∞
= (g(x) − µg(X) )2 f (x)dx.
−∞
Covariance of Random Variables
σXY = E(XY) − µX µY .
Covariance of Random Variables
σXY = E(XY) − µX µY .
σXY = E(XY) − µX µY .
σXY
ρXY = .
σX σY
The Correlation Coefficient
σXY
ρXY = .
σX σY
E(XY) = E(X)E(Y).
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ If b = 0, then σaX+c
2
= a2 σX2
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ If b = 0, then σaX+c
2
= a2 σX2
▶ If a = 1 and b = 0, then σX+c
2
= σX2 .
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ If b = 0, then σaX+c
2
= a2 σX2
▶ If a = 1 and b = 0, then σX+c
2
= σX2 .
▶ If b = c = 0, then σaX
2
= a2 σX2 .
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ 2
If b = 0, then σaX+c = a2 σX2
▶ 2
If a = 1 and b = 0, then σX+c = σX2 .
▶ 2
If b = c = 0, then σaX = a2 σX2 .
▶ If a = b = 0, then σc2 = 0.
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ 2
If b = 0, then σaX+c = a2 σX2
▶ 2
If a = 1 and b = 0, then σX+c = σX2 .
▶ 2
If b = c = 0, then σaX = a2 σX2 .
▶ If a = b = 0, then σc2 = 0.
▶ For independent random variables X and Y,
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ 2
If b = 0, then σaX+c = a2 σX2
▶ 2
If a = 1 and b = 0, then σX+c = σX2 .
▶ 2
If b = c = 0, then σaX = a2 σX2 .
▶ If a = b = 0, then σc2 = 0.
▶ For independent random variables X and Y,
▶ σaX+bY
2
= a2 σX2 + b2 σY2 .
Properties of Mean and Variance
2
σaX+bY+c = a2 σX2 + b2 σY2 + 2abσXY .
▶ 2
If b = 0, then σaX+c = a2 σX2
▶ 2
If a = 1 and b = 0, then σX+c = σX2 .
▶ 2
If b = c = 0, then σaX = a2 σX2 .
▶ If a = b = 0, then σc2 = 0.
▶ For independent random variables X and Y,
▶ σaX+bY
2
= a2 σX2 + b2 σY2 .
▶ σaX−bY = a2 σX2 + b2 σY2 .
2
Moment Generating Function
Moments
dr MX (t)
= µ′r .
dtr t=0
Properties of MGF