2 Probability and Statistics
2 Probability and Statistics
A sample is the specific group that you will collect data from using random
sampling. The size of the sample is always less than the total size of the population.
Sampling
Inference
Link: Quora
I.I.D
Independent and identically distributed (or IID) random variables are mutually
independent of each other and are identically distributed in the sense that they are drawn
from the same probability distribution.
Example: Coin flips, Rolling a fair six-sided die, survey responses are assumed to be IID
Who is best? X vs. Y
Exams 1 2 3 4 5 6 7 8 9 10
Student Scores (50)
X 28 32 44 33 43 30 41 36 42 27
Y 48 19 22 45 26 50 31 28 38 49
Student X Student Y
SUM 356 356
MEAN 35.6 35.6
MEDIAN 34.5 34.5
STANDARD 6.4 11.9
DEVIATION
Probability
In a random experiment, probability of an event is a number indicating how likely that
event will occur.
The sample space associated with a random experiment is the set of all
possible outcomes. An event is a subset of the sample space.
e.g., Ω = {1,2,3,4,5,6}
This number P(A) is always between 0 and 1, where 0 indicates impossibility and
1 indicates certainty.
Probability
To qualify as a probability, P must satisfy three axioms:
Uniform Distribution: Represents a situation where all values in an interval are equally
likely. e.g.: Rolling of a fair six-sided die, generating random numbers between 0 and 1
One is that events X and Y must happen at the same time. Example: Throwing two dice
simultaneously.
The other is that events X and Y must be independent of each other. That means the
outcome of event X does not influence the outcome of event Y.
Example: Rolling two Dice.
Find the joint probability of getting heads on the coin toss and rolling a 5 on the die?
The joint probability of two dependent events then becomes P(A and B) = P(A)P(B|A)
Note:
Two events A and B are conditionally independent given C if they are independent after
conditioning on C
What percent of students passed the Midterm given they passed the Final?
It tells us: how often A happens given that B happens: P(A|B) – Posterior Probability
When we know:
how often B happens given that A happens, P(B|A) – Likelihood
how likely A is on its own, P(A) – Prior Probability
how likely B is on its own, P(B) – Evidence
Bayes Theorem [Example]
A rare disease affect 0.1% of the population. A test proposed for this disease is 99% accurate
for people who have the disease. What is the probability that a person actually has the disease
if they test positive?
The PMF gives the probability that a specific value of the random variable occurs in
case of discrete distributions
The PDF in case of continuous distributions, gives the relative likelihood of the random
variable taking on a particular value.
The area under the PDF curve over an interval represents the probability of the variable
falling within that interval
Probability Mass Function
𝟏 𝟏 𝟏 𝟏 𝟏 𝟏
𝑬 𝑿 =𝟏 +𝟐 +𝟑 +𝟒 +𝟓 +𝟔
𝟔 𝟔 𝟔 𝟔 𝟔 𝟔
= 𝟑. 𝟓
PMF-Example
Consider a biased coin with P(H) = 0.7 and P(T) = 0.3
X: The number of times the coin lands heads up in two consecutive flips.
X: The number of times the coin lands heads up in two consecutive flips.
Variance, Var(X)
+
Types of PMFs – Bernoulli Distribution
The Bernoulli distribution models a single binary trial with two possible outcomes:
success (S) with probability "p" and failure (F) with probability "q" (where q = 1 - p).
Each trial in the Bernoulli distribution has only two possible outcomes, often labeled as 1
(success) and 0 (failure).
Types of PMFs – Binomial Distribution
It is a discrete probability distribution that models the number of successes in a fixed
number of independent Bernoulli trials
It summarizes the probability that a value will take one of two independent values
under a given set of parameters or assumptions
N = 20 trials with p=q=1/2
The binomial distribution of obtaining exactly n
successes out of N Bernoulli trials is given by:
Types of PMFs – Poisson Distribution (
It is a discrete probability distribution that models the number of events occurring in a
fixed interval of time or space, given the average rate of occurrence.
The distribution is used to model rare events that occur randomly and independently
over a specified time or space interval
It defines the likelihood of the variable falling within a particular range of values.
Uniform Distribution
It describes a situation where all values within a specific interval [a, b] are equally
likely to occur, i.e., have the same probability of occurring
a b
PDF - Normal/Gaussian Distribution
It is a continuous probability distribution that is
characterized by its bell-shaped curve. The curve
tails off towards the extremes.
( )
( )
Normal Distribution - Empirical (68-95-99.7)Rule
It is a statistical guideline that describes the approximate
distribution of data in a normal distribution
3σ of µ
Example
Consider a dataset of exam scores that follows a normal distribution with a mean of 80 and
a standard deviation of 10.
It states that as the sample size increases, the distribution of sample means
approaches a normal distribution, regardless of the original population's distribution.
Provided we have a population with μ and σ and take large random samples (n ≥ 30)
from the population with replacement, the distribution of the sample means will be
approximately normally distributed with: