Lect - 08 A Bernoulli Distributions
Lect - 08 A Bernoulli Distributions
EEF 271e
Ibraheem Shayea
Electronics and Communication Engineering Department,
Faculty of Electrical and Electronics Engineering
İstanbul Teknik Üniversitesi - İTÜ
Syllabus 08
❑ Understanding :
o Concept of Bernoulli Distributions
o PDF of Bernoulli Distribution Function
o CDF of Bernoulli Distribution Function
o Mean
o Median
o Variance
o Standard Deviation
o Practice some Examples
Outline
❖ Discrete Probability Distributions
❖ Concept of Bernoulli Distribution
❖ PMF of Bernoulli Distribution
❖ CDF of Bernoulli Distribution
❖ Mean of Bernoulli Distribution
❖ Median of Bernoulli Distribution
❖ Variance of Bernoulli Distribution
❖ Standard Deviation of Bernoulli Distribution
❖ Properties
❖ Examples
Discrete Distributions Functions
Discrete Distributions Functions
Discrete Random Variable
6
Discrete Distributions Functions
Discrete Random Variable
Example 01
❖ Discrete RandomVariable
During a given time interval, the number of telephone calls received is
an example of a discrete random variable.
❖ Continuous RandomVariable
The duration of a call is an example of a continuous random variable.
7
Discrete Distributions Functions
Discrete Random Variable
Example 02
8
Discrete Distributions Functions
Discrete Random Variable
9
Discrete Distributions Functions
Discrete Random Variable
10
Discrete Distributions Functions
Discrete Distribution Function
12
Discrete Distributions Functions
Discrete Distribution Function
13
Discrete Distributions Functions
Types of Discrete Probability Distribution Functions
1. Bernoulli Distribution
2. Binomial Distribution
3. Negative Binomial Distribution (Pascal Distribution)
4. Geometric Distribution
5. Poisson Distribution
6. Hypergeometric Distribution
7. …etc
Concept of Bernoulli Distribution
Concept of Bernoulli Distribution
Definition
16
Concept of Bernoulli Distribution
Definition
17
Concept of Bernoulli Distribution
Application of Bernoulli Distribution
18
Concept of Bernoulli Distribution
Application of Bernoulli Distribution
Some of the most common applications include:
❖ Binary Classification Problems ❖ Insurance
20
Concept of Bernoulli Distribution
Application of Bernoulli Distribution
21
Concept of Bernoulli Distribution
Application of Bernoulli Distribution
Quality Control
22
Concept of Bernoulli Distribution
Application of Bernoulli Distribution
Marketing Research
23
PMF of Bernoulli Distribution
PMF of Bernoulli Distribution
PMF for a Bernoulli Distribution
Probability Mass Function (PMF) of the Bernoulli distribution is
defined as follows:
𝟏 − 𝒑 𝒙=𝟎
𝒑𝑿 𝒙 = 𝒑 𝒙=𝟏
𝟎 𝑶𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆
where
o 𝒑 Represents the probability of success
➢ Probability of getting a 1, if we assign 1 to success and 0 to failure.
➢ where 0 < 𝑝 < 1
❖ Probability of Success
o Range of 𝑝: 0 < 𝑝 < 1
o A discrete random variable with the range {0, 1} 26
PMF of Bernoulli Distribution
Bernoulli Trial
❖ Bernoulli Trial is corresponds to sampling from the Bernoulli
distribution, it is a random experiment with exactly two possible
outcomes, in which the probability of each of the two outcomes
remains the same every time the experiment is conducted.
28
PMF of Bernoulli Distribution
Matlab for the PMF of Bernoulli Distribution
PDF of a Bernoulli Distribution is defined in Matlab by the following
function:
𝒑𝑿 𝒙 = binopdf(x,n,p);
𝑥 : RandomVariable
𝑛 : Bernoulli Trial , 𝑛 = 1
p : Probability of Success
29
PMF of Bernoulli Distribution
Example 01:
Matlab : PMF
clc
clear all
close all
p = 0.65;
x = 0:1;
n = 1';
y = binopdf(x,n,p);
figure
stem(x,y,'filled','LineWidth',3)
xlabel('Observation')
ylabel('Probability')
xlim([-1 2])
figure
bar(x,y,1)
xlabel('Observation')
ylabel('Probability') 30
CDF of Bernoulli Distribution
CDF of Bernoulli Distribution
CDF for a Bernoulli Distribution
???
32
CDF of Bernoulli Distribution
CDF for a Bernoulli Distribution
Cumulative Distribution Function (CDF) of the Bernoulli
distribution is a step function that gives the probability that the random
variable X is less than or equal to a given value x:
𝑭(𝒙) = 𝑷(𝑿 ≤ 𝒙)
𝐹(𝑥) = 𝑝𝑋 𝑥
𝑥=−∞
𝑃𝑋 𝑥 = 𝑃 𝑋 = 𝑥𝑘 , 𝑘 = 1,2 3, … ∞ 33
CDF of Bernoulli Distribution
CDF for a Bernoulli Distribution
For the Bernoulli Distribution, where the random variable X can only
take on the values of 0 or 1, the CDF is:
0 𝑥<0
𝐹𝑋 𝑥 = 1 − 𝑝 0 ≤𝑥 < 1
1 𝑥≥1
where
o 𝒑 represents the probability of success.
➢ probability of getting a 1, if we assign 1 to success and 0 to failure.
➢ where 0 < 𝑝 < 1
o 1 − 𝑝 represents probability of failure (getting a 0). 34
CDF of Bernoulli Distribution
CDF for a Bernoulli Distribution
PMF CDF
Bernoulli Distribution. 36
CDF of Bernoulli Distribution
Matlab for the CDF of Bernoulli Distribution
The CDF of a Bernoulli Distribution is defined in Matlab by the following
function:
𝒑𝑿 𝒙 = binocdf(x,n,p);
𝑥 : RandomVariable
𝑛 : Bernoulli Trial , 𝑛 = 1
p : Probability of Success 37
CDF of Bernoulli Distribution
Matlab
clc
clear all
close all
p = 0.65;
x = 0:1;
n = 1';
Z = binocdf(x,n,p);
figure
stairs(x, Z,'LineWidth',3)
xlabel('Observation')
ylabel('Cumulative Probability’)
38
Mean of Bernoulli Distribution
Mean of Bernoulli Distribution
How to obtain Mean of Bernoulli Distribution ?
The mean 𝝁𝑿 of the Bernoulli random variable X, which cannot be
independently set as it is function of p only is as follows:
𝑀𝑒𝑎𝑛 = 𝐸 𝑋 = 𝑥 𝑝𝑋 𝑥
𝑥=−∞
1 − 𝑝 𝑥=0
where, 𝑝𝑋 𝑥 = 𝑝 𝑥=1
0 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒 40
Mean of Bernoulli Distribution
How to obtain Mean of Bernoulli Distribution ?
The mean 𝝁𝑿 of the Bernoulli random variable X, which cannot be
independently set as it is function of p only is as follows:
𝑀𝑒𝑎𝑛 = 𝐸 𝑋 = 1 × 𝑝 + 0 × (1 − 𝑝)
𝑴𝒆𝒂𝒏 = 𝑬 𝑿 = 𝒑
𝑴𝒆𝒂𝒏 = 𝑬 𝑿 = 𝝁𝑿 = 𝒑
41
Median
Median
Median
43
Median
Median
The median of a Bernoulli distribution depends on the probability of success,
denoted by p.
𝟏
𝟎 𝒊𝒇 𝒑 <
𝟐
𝟏
𝑴𝒆𝒅𝒊𝒂𝒏 = [𝟎, 𝟏] 𝒊𝒇 𝒑 =
𝟐
𝟏
𝟏 𝒊𝒇 𝒑 >
𝟐
45
Variance
Variance
Variance
The variance of a r.v. X, denoted by 𝜎𝑋2 or 𝑉𝑎𝑟(𝑋),is defined by:
Thus
48
Variance
Variance
Variance = 𝝈𝟐𝑿 = 𝒑 𝟏 − 𝒑
49
Standard Deviation
Standard Deviation
Standard Deviation
𝝈𝑿 = 𝝈𝟐𝑿 = 𝒑 𝟏 − 𝒑
51
Properties
Properties
Properties
The Bernoulli distribution has several important properties that are worth
knowing:
❖ OnlyTwo Outcomes
❖ Symmetric Bernoulli
53
Properties
Discrete Probability Distribution
𝟏 − 𝒑 𝒙=𝟎
𝒑𝑿 𝒙 = 𝒑 𝒙=𝟏
𝟎 𝑶𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆
54
Properties
Bernoulli Distribution has a Single Parameter
𝟏 − 𝒑 𝒙=𝟎
𝒑𝑿 𝒙 = 𝒑 𝒙=𝟏
𝟎 𝑶𝒕𝒉𝒆𝒓𝒘𝒊𝒔𝒆
55
Properties
Special Case of the binomial distribution
𝑁𝑢𝑚𝑏𝑒𝑟 𝑜𝑓 𝑇𝑟𝑖𝑎𝑙𝑠 = 𝑛 = 1
56
Properties
Only Two Outcomes
o Bernoulli Distribution only has two outcomes
57
Properties
Symmetric Bernoulli
❖ Symmetric Bernoulli Random variable has outcomes {−1, 1}.
❖ This Figure shows the PMF for the symmetric Bernoulli example.
Solution
60
Examples
Example 01
1. Write the mathematical expression for 𝑭𝑿 (𝒙).
Solution
61
Examples
Example 01
2. Calculate 𝑭𝑿 (−𝟏), 𝑭𝑿 (𝟎), 𝑭𝑿 (𝟎. 𝟓), and 𝑭𝑿 (𝟏)
Solution
62
Examples
Example 01
3. Plot the CDF for this Bernoulli random variable.
Solution
63
Examples
Example 02
A factory produces light bulbs, and each bulb has a 95% chance of passing
quality control. Let 𝑋 be a random variable that represents the result of
inspecting a single bulb, where:
𝑋 = 1 if the bulb passes inspection
𝑋 = 0 if the bulb fails inspection
Assuming the result follows a Bernoulli distribution, calculate:
1) The probability that a randomly selected bulb passes inspection.
2) The probability that a randomly selected bulb fails inspection.
Solution
Examples
Example 02
Solution
Given:
o Success probability 𝑝 = 0.95
o Failure probability 1 − 𝑝 = 0.05
The End
Thank You
References 1
1) Yates, R. D. ve Goodman, D. (2005). Probability and Stochastic Processes: A Friendly Introduction for
Electrical and Computer Engineers. JohnWiley and Sons.
2) Hsu, H. (2010). Probability, RandomVariables, and Random Processes (Second Edition). McGraw- Hill
(Schaum's Outline Series).
3) Leon-Garcia, A. (2008). Probability, Statistics, and Random Processes For Electrical Engineering (Third
Edition). Prentice Hall.
5) Ali Grami (2020).“Probability, Random Variables, Statistics, and Random Processes Fundamentals &
Applications” , first edition, JohnWiley & Sons, Inc.
6) JOHN J. SHYNK (2013). Probability, RandomVariables, And Random Processes:Theory and Signal
Processing Applications”, University of California, Santa Barbara, CA, USA .
7) Papoulis, A. (1991). Probability, RandomVariables and Stochastic Processes (Third Edition). McGraw-
Hill.
References 3
1) https://online.stat.psu.edu/stat504/node/209/
2) https://support.minitab.com/en-us/minitab-express/1/help-and-how-to/basic-
statistics/probability-distributions/supporting-topics/basics/continuous-and-discrete-
probability-distributions/
3) https://online.stat.psu.edu/stat504/node/209/
4) https://support.minitab.com/en-us/minitab-express/1/help-and-how-to/basic-
statistics/probability-distributions/supporting-topics/basics/continuous-and-discrete-
probability-distributions/
5) https://www.investopedia.com/terms/p/probabilitydistribution.asp
6) https://opentextbc.ca/introbusinessstatopenstax/chapter/properties-of-continuous-
probability-density-functions/
7) https://sites.nicholas.duke.edu/statsreview/discrete-probability-distributions/