ST Topic 1
ST Topic 1
Topic 1: Introduction
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 2 / 129
Organizational issues
Organizational issues
E-mail: [email protected]
Office hours: Tuesdays and Wednesdays 11:00 – 13:00 (send an email
beforehand!)
Evaluation:
Continuous evaluation 40%
- 20% Midterm date: 1-4. Topics 1 to 5.
- 10% R practices 12/2 - 26/2 - 26/3- 6/5.
- 10 % Exercises in class 12/2 - 26/2 - 9/4 - 22/4 - 30/4.
Final exam 60% 19-5-2025 9am
- Covers all topics
- Minimum grade is 5!
Statistics 3 / 129
Organizational issues
Literature
Statistics 4 / 129
Organizational issues
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 5 / 129
Statistics: basic concepts
Statistics - is the science that allows us to analyze a set of observed data in order
to know the characteristics of the real phenomenon that has generated them.
- If we manage to know the phenomenon that generates the data, we will be
able to anticipate what the next observed data will be like, or we can learn
to provoke or avoid them.
- It can then be said that statistics is a learning tool based on observation,
since it helps us to draw generalizable conclusions from a set of observed
data.
Statistics 6 / 129
Statistics: basic concepts
Statistics 7 / 129
Statistics: basic concepts
Statistics 7 / 129
Statistics: basic concepts
Statistics 7 / 129
Statistics: basic concepts
Statistics 7 / 129
Statistics: basic concepts
Determinist vs random
Statistics 8 / 129
Statistics: basic concepts
Types of variables
Qualitative (categorical)
- Nominal. Gender, country of birth, hair color...
- Ordinal. Level of education, satisfaction level, a place in a race...
Quantitative (numerical)
- Discrete. Number of kids, number of students enrolled in a class, number of
Microsoft stocks in an investor’s portfolio...
- Continuous. Height, weight, time...
Statistics 9 / 129
Statistics: basic concepts
Statistics 10 / 129
Statistics: basic concepts
Population vs sample
Our eventual aim is to make statements about the population based on a sample
(a sample needs to be representative).
Statistics 11 / 129
Statistics: basic concepts
Parameter vs statistic
Statistics 12 / 129
Statistics: basic concepts
Parameter vs statistic
Statistics 12 / 129
Statistics: basic concepts
Parameter vs statistic
Statistics 12 / 129
Statistics: basic concepts
Parameter vs statistic
We form opinions and make decisions about a population parameter (fixed, but
unobservable) based on a sample statistic (observable, but random).
Statistics 12 / 129
Descriptive Statistics
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 13 / 129
Descriptive Statistics
For example, the following dataset contains Life Expectancy at birth for 200
countries: 1 = short (< 70), 2 = medium (70 − 75), and 3 = long (> 75)
Statistics 14 / 129
Descriptive Statistics
A frequency distribution is a table used to organize data. Can be used for all types
of data.
xi ni fi Ni Fi
x1 n1 f1 N1 F1
... ... ... ... ...
xl nl fl Nl Fl
Statistics 15 / 129
Descriptive Statistics
Countries dataset contains Life Expectancy at birth for 200 countries: 1 = short
(< 70), 2 = medium (70-75), and 3 = long (> 75).
Life Expectancy ni fi Ni Fi
Short n1 = 58
Medium n2 = 52
Long n3 = 90
Total
Statistics 16 / 129
Descriptive Statistics
15 people were asked how many times they had gone to the cinema in the last year.
The data collected were as follows: 2, 1, 0, 4, 3, 2, 1, 1, 3, 2, 3, 0, 2, 2, 1.
xi ni fi Ni Fi
0 2
1 4
2 5
3 3
4 1
Total
Statistics 17 / 129
Descriptive Statistics
Graphical representation
The use of graphics is essential both in a first part of a statistical analysis (when we
are describing our data set) and in the results part (when we want to efficiently
show our main results or findings).
Graphs allow to present the principal characteristics of the data in an
instantaneous manner.
Graphs are easy to read and understand, even non-specialists can interpret
statistical information presented in graphs.
The choice of the type of the graph depends mainly on two things: (i) type
of data (qualitative vs quantitative) and (ii) the objective or goal of
transmitting certain information.
It is extremely easy to lie (misinform) with graphs (either on purpose or by
mistake).
Statistics 18 / 129
Descriptive Statistics
Bar chart
The bar chart is just a visual representation of the frequency table. In a bar chart
the height of a rectangle represents each frequency (either absolute or relative).
There is no need for the bars to touch. Used for nominal, ordinal and discrete
data.
Statistics 19 / 129
Descriptive Statistics
Pie chart
The pie chart is another visual representation of the frequency table. In a pie chart
the whole pie is worth a 100% and each slice represents the % in each category.
Used for nominal, ordinal and discrete data.
Pie chart is often used in the news and the newspapers, however, it presents certain
disadvantages as compared to the bar chart:
Statistics 20 / 129
Descriptive Statistics
Histogram
Statistics 21 / 129
Descriptive Statistics
Box-plot
Page views
Grade
0 2 4 6 8
Statistics 22 / 129
Descriptive Statistics
Statistics 23 / 129
Descriptive Statistics
Statistics 24 / 129
Descriptive Statistics
Arithmetic Mean
The arithmetic mean (or simply mean) of a set of data is the sum of the data
values divided by the number of observations.
Population mean (if we have the entire population of size n available):
Pn
i=1 xi x1 + x2 + . . . + xn
µ= = .
n n
Pn
i=1 xi x1 + x2 + . . . + xn
x̄ = =
n n
Statistics 25 / 129
Descriptive Statistics
Arithmetic Mean
Arithmetic mean is the most intuitive and commonly used measure for
central tendency.
It can be applied for quantitative data only.
It has a major disadvantage: it is not robust to outliers (atypical data point).
Statistics 26 / 129
Descriptive Statistics
ȳ = a + b · x̄ .
Statistics 27 / 129
Descriptive Statistics
Median
Statistics 28 / 129
Descriptive Statistics
Median: example
Statistics 29 / 129
Descriptive Statistics
Mode
Statistics 30 / 129
Descriptive Statistics
Mode: example
Statistics 31 / 129
Descriptive Statistics
Comparison of mean, median and mode also help to describe the shape of
the distribution.
Statistics 32 / 129
Descriptive Statistics
72 80 67 70 63 75 75 65 82 84 85 60
P12
Given that the i=1 xi = 878, describe the central tendency of the data.
Statistics 33 / 129
Descriptive Statistics
Mean:
878
x̄ = = 73.17 bottles
12
Median. First sort the observations in increasing order:
60 63 65 67 70 72 75 75 80 82 84 85
Then find the 1/2(12 + 1) = 6.5th position, which is between the 6th and
the 7th: (72 + 75)/2 = 73.5
The mode is 75.
Since Mo > Me > x̄ , the distribution is skewed to the left (negatively
skewed).
Statistics 34 / 129
Descriptive Statistics
Percentiles and quartiles are measures that indicate the position relative to
the entire dataset.
For example, you are told that you scored in the 92nd percentile on your
mathematics exam. It means that approximately 92% of the students who
took this exam scored same or lower than you and approximately 8% of the
students who took this exam scored higher than you.
Statistics 35 / 129
Descriptive Statistics
Percentiles separate an ordered data set into 100 parts. For example, in
number of siblings P15 = 2 means that 15% of a sample (or population)
have 2 siblings or less.
Deciles separate an ordered data set into 10 parts. For example, in income
D4 = 2000EUR means that 40% of a sample (or population) have income of
2000EUR or less.
Quartiles separate an ordered data set into 4 parts. For example, in exam
grade Q3 = 8.6 means that 75% of students have grade of 8.6 or less.
Convert deciles and quartiles to percentiles and use the percentile formula to find
the position of the r th percentile:
r
k= · (n + 1)
100
Statistics 36 / 129
Descriptive Statistics
60 63 65 67 70 72 75 75 80 82 84 85 86
Statistics 37 / 129
Descriptive Statistics
Box-and-Whisker Plot
LL = Q1 − 1.5 × (Q3 − Q1 )
UL = Q3 + 1.5 × (Q3 − Q1 )
Statistics 39 / 129
Descriptive Statistics
Box-and-Whisker Plot
Statistics 40 / 129
Descriptive Statistics
Statistics 41 / 129
Descriptive Statistics
Gilotti’s Pizzeria has 4 locations in one large metropolitan area. Daily sales
(in hundreds of dollars) from a random sample of 10 weekdays from each of
the 4 locations are given in table below.
25
20
15
10
5
0
Which location has the largest range (spread) of sales? Largest median?
Statistics 42 / 129
Descriptive Statistics
Variability
What is variability?
Sample A: 1 2 3 34
Sample B: 8 9 10 13
Sample means are the same x̄A = x̄B = 10, but is the spread (a.k.a. variability,
dispersion, variation) the same?
Statistics 43 / 129
Descriptive Statistics
Re = xmax − xmin
Statistics 44 / 129
Descriptive Statistics
60 63 65 67 70 72 75 75 80 82 84 85 86
Range: Re = 86 − 60 = 26.
Interquartile range: IQR = 83 − 66 = 17.
Statistics 45 / 129
Descriptive Statistics
36 63 65 67 70 72 75 75 80 82 84 85 86
Range: Re = 86 − 36 = 50
Interquartile range: IQR = 83 − 66 = 17
Statistics 46 / 129
Descriptive Statistics
Although range and interquartile range measure the spread of data, both
measures take into account only two of the data values.
We need a measure that would present an average of the distance between
each of the data values and the mean.
Such measure is called variance and the square root of variance is called
standard deviation.
Statistics 47 / 129
Descriptive Statistics
Pn Pn
2 i=1 (xi − µ)2 i=1 xi
2
σ = = − µ2 .
n n
Pn
2 − x̄ )2
i=1 (xi n
s = = σ2 .
n−1 n−1
Shape of a Distribution
Statistics 49 / 129
Descriptive Statistics
Skewness is a measure of the asymmetry. The symmetry (or the lack of) can be
described by:
1 Looking at a histogram or a bar chart or a box plot.
2 Comparing the mean, the median and the mode:
- If mean=median=mode the distribution is symmetric.
- If mean>median>mode the distributions is skewed to the right (positively).
- If mean<median<mode the distributions is skewed to the left (negatively).
3 Calculating the coefficient of skewness. Most commonly used is Fisher’s
(implemented in R and Excel) coefficient.
The two approaches usually (but not always) lead to the same conclusion.
Statistics 50 / 129
Descriptive Statistics
Statistics 51 / 129
Descriptive Statistics
20
1500
15
10
1000
5
500
0
0 500 1000 1500 2000 2500
Statistics 52 / 129
Descriptive Statistics
Grade Grade
8
15
6
10
4
5
2
0
0
0 2 4 6 8 10
Statistics 53 / 129
Descriptive Statistics
Statistics 54 / 129
Descriptive Statistics
Statistics 55 / 129
Descriptive Statistics
Statistics 56 / 129
Descriptive Statistics
Statistics 57 / 129
Probability
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 58 / 129
Probability
Probability
Statistics 59 / 129
Probability
Random Experiment
Statistics 60 / 129
Probability
Sample Space
The possible outcomes from a random experiment are called the basic
outcomes, and the set of all basic outcomes is called the sample space. We
use the symbol S to denote the sample space.
Sample spaces can be finite or infinite, formed of qualitative or quantitative
outcomes.
Examples of a sample spaces:
- A coin is tossed, S = {H, T }. Basic outcomes: H or T. The set of all basic
outcomes is the sample space S = {H, T }.
- The number of persons admitted to a hospital emergency room,
S = {0, 1, 2, 3, . . .}.
- Rolling a die, S = {1, 2, 3, 4, 5, 6}.
- Height of a student, S = (1.40, 2.20).
- Name of a student, S = {Adele, Peter , Emily , John...}.
Statistics 61 / 129
Probability
Event
Statistics 62 / 129
Probability
Statistics 63 / 129
Probability
Probability
Statistics 64 / 129
Probability
I. Classical probability
Statistics 65 / 129
Probability
The relative frequency probability is the limit of the proportion of times that
event A occurs in a large number of trials:
nA
fr (A) = P(A) = lim fr (A)
n n→+∞
Statistics 66 / 129
Probability
We can calculate what would happen if we rolled a die 1000, 10 000 and an
infinite amount of times....
Statistics 67 / 129
Probability
Statistics 68 / 129
Probability
Probability Postulates
0 ≤ P(A) ≤ 1.
Let O1 and O2 be two mutually exclusive sets (that is, O1 ∩ O2 = ∅), then
In particular, let A be an event in S and let Oi denote the basic outcomes (of
the event A). Then,
X
P(A) = P(Oi ) = P(O1 ) + P(O2 ) + · · · .
P(S) = 1.
Statistics 69 / 129
Probability
P(Ā) = 1 − P(A).
Let A and B be two events. Using the addition rule of probabilities, the
probability of their union is as follows:
Statistics 70 / 129
Probability
Conditional Probability
P(A ∩ B)
P(A|B) = .
P(B)
Statistics 71 / 129
Probability
Statistics 72 / 129
Probability
Statistics 72 / 129
Probability
because A ∩ B = {5}.
Statistics 72 / 129
Probability
because A ∩ B = {5}.
Then apply the rule of conditional probability:
P(A ∩ B) 1/6
P(A|B) = = = 1/3.
P(B) 1/2
Statistics 72 / 129
Probability
Statistical Independence
Statistics 73 / 129
Probability
In a certain country, 30% of people have blond hair. In the same country, 25% of
the population have blue eyes. Finally, 15% of the population have blond hair and
blue eyes. Are the events ”a person has blond hair” and ”a person has blue eyes”
statistically independent?
Call event Blond - ”a person has blond hair” and event Blue - ”a person has
blue eyes.” Write down the given information:
Statistics 74 / 129
Probability
In a certain country, 30% of people have blond hair. In the same country, 25% of
the population have blue eyes. Finally, 15% of the population have blond hair and
blue eyes. Are the events ”a person has blond hair” and ”a person has blue eyes”
statistically independent?
Call event Blond - ”a person has blond hair” and event Blue - ”a person has
blue eyes.” Write down the given information:
Statistics 74 / 129
Probability
In a certain country, 30% of people have blond hair. In the same country, 25% of
the population have blue eyes. Finally, 15% of the population have blond hair and
blue eyes. Are the events ”a person has blond hair” and ”a person has blue eyes”
statistically independent?
Call event Blond - ”a person has blond hair” and event Blue - ”a person has
blue eyes.” Write down the given information:
Statistics 74 / 129
Probability
Graphically:
Statistics 75 / 129
Probability
Statistics 76 / 129
Probability
Apply LTP:
Statistics 77 / 129
Probability
Bayes’ Theorem
P(B|A) · P(A)
P(A|B) =
P(B)
and
P(A|B) · P(B)
P(B|A) = .
P(A)
Statistics 78 / 129
Probability
We know that the probability of having COVID-19 is 15%. We also know that
probability of giving a positive for a PCR test for a person who has COVID-19 is
90%, meanwhile in 2% of cases people test positive even though they don’t have
the virus (false positive). Given that a person tested positive, what is the
probability that she has the the COVID-19?
Statistics 79 / 129
Probability
Statistics 80 / 129
Probability
Statistics 80 / 129
Probability
P(P|C ) · P(C )
P(C |P) = .
P(P)
Statistics 80 / 129
Probability
For applying Bayes’ theorem, we need to compute P(P). We can get it, by
applying LTP.
Since the event C and C̄ are mutually exclusive and collectively exhaustive,
we have that
P(P) = P(P ∩ C ) + P(P ∩ C̄ )
= P(P|C ) · P(C ) + P(P|C̄ ) · P(C̄ )
= 0.90 · 0.15 + 0.02 · 0.85 = 0.152.
Hence
P(P|C ) · P(C ) 0.90 · 0.15 0.135
P(C |P) = = = = 0.89.
P(P) 0.152 0.152
Statistics 81 / 129
Random variables
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 82 / 129
Random variables
Random variable
A random variable is a function that maps from the sample space to the real
numbers.
We conduct a random experiment and after learning the outcome s in S (the
sample space of the random experiment) we calculate a number X . That is,
to each outcome s in the sample space we associate a number
X (s) = x .
Statistics 83 / 129
Random variables
For the random variable to be fully defined, we need to know two major
ingredients:
- The complete sample space (what are the possible events).
- The probabilities of each of the events. The rule of how to assign the
probabilities is sometimes called the probability model.
Statistics 84 / 129
Random variables
x ∈ SX 0 1 2 3
1 3 3 1
PX = (X = x ) 8 8 8 8
For example, PX (x = 1) = P({HTT , THT , TTH}) = 38 .
Statistics 85 / 129
Random variables Discrete random variables
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 86 / 129
Random variables Discrete random variables
Random variables (which can be only quantitative, there are no qualitative random
variables) are divided into discrete and continuous. Examples of discrete random
variables:
Number of heads after tossing a coin three times (0,1,2,3).
A result of rolling a die (1,2,3,4,5,6).
Number of clients that come into the store per day.
Number of siblings.
Number of car accidents per week in an autonomous community.
Statistics 87 / 129
Random variables Discrete random variables
Distinguish between X (upper case X) and x (lower case x)! X is the random
variable; x is a given value.
Example: we can write P(X = 7) and read “what is the probability that random
variable X is equal to the value 7”?
For example, the question “what is the probability that a store has exactly 20
customers enter in the next hour?” can be addressed using the probability mass
function as follows. First, let X be a random variable that represents the number
of customers that enter the store in the next hour. Then, express the probability
as P(X = 20).
Statistics 88 / 129
Random variables Discrete random variables
The PMF can be written down in a table format. For example, consider a
random variable X - the number we observe after rolling a die once. Then
the PMF of X is given by:
x 1 2 3 4 5 6
P(X = x ) 1/6 1/6 1/6 1/6 1/6 1/6
Statistics 89 / 129
Random variables Discrete random variables
Expected Value
Statistics 91 / 129
Random variables Continuous random variables
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Statistics 92 / 129
Random variables Continuous random variables
P(X = 5.67956392) = 0.
Statistics 93 / 129
Random variables Continuous random variables
0.4
0.3
0.20
0.2
0.10
0.1
0.00
0.0
−3 −2 −1 0 1 2 3
0.8
0.8
0.4
0.4
0.0
0.0
−1 0 1 2 3 4 5 6 −3 −2 −1 0 1 2 3
Statistics 94 / 129
Random variables Continuous random variables
−3 −2 −1 0 1 2 3
Statistics 95 / 129
Random variables Continuous random variables
- Z x
P(X = x ) = f (x )dx = 0.
x
- Z b
P(a < x < b) = P(a ≤ x ≤ b) = f (x )dx .
a
Statistics 96 / 129
Random variables Continuous random variables
F (x ) = P(X ≤ x )
Which leads us the relationship between the PDF and the CDF:
f (x ) = F (x )′ .
Statistics 97 / 129
Random variables Continuous random variables
PDF CDF
0.4
1.0
0.8
0.3
0.6
0.2
0.4
0.1
0.2
0.0
0.0
−3 −1 1 2 3 −3 −1 1 2 3
Statistics 98 / 129
Random variables Continuous random variables
Statistics 99 / 129
Random variables Continuous random variables
Remember, the mean and variance for the discrete random variable are given
by:
X 2
X 2 2 2 2
E [X ] ≡ µ = x · P(x ), V [X ] ≡ σ = x · P(x ) − µ = E [X ] − E [X ]
x x
E [αX + βY ] = αE [X ] + βE [Y ].
V [αX + βY ] = α2 V [X ] + β 2 V [Y ].
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Bernoulli Distribution
Bernoulli Distribution
Bernoulli Distribution
Example
An urn contains 40 black and 10 red balls. You pick at random one ball from the
urn. Let X be the number of black balls you pick from the urn. What is the PMF
of X ?
Bernoulli Distribution
Example
An urn contains 40 black and 10 red balls. You pick at random one ball from the
urn. Let X be the number of black balls you pick from the urn. What is the PMF
of X ?
Binomial Distribution
What if we consider more than one experiment? What if, say, we picked 5 balls and
wanted to get 3 black ones. This is where binomially distributed random variables
come in play! The setup is simple:
n independent experiments/trials.
Each experiments ends up in a success with probability p and a failure with
probability 1 − p;
That is, each trial is a Bernoulli random variable.
Let X be the number of successes. Then X is a binomial random variable.
Binomial Distribution
X ∼ binom(n, p).
E [X ] = np and V [X ] = np(1 − p)
We have calculated:
x 0 1 2 3 4
P(x ) 0.1296 0.3456 0.3456 0.1536 0.0256
F (x ) 0.1296 0.4752 0.8208 0.9744 1.0000
We have calculated:
x 0 1 2 3 4
P(x ) 0.1296 0.3456 0.3456 0.1536 0.0256
F (x ) 0.1296 0.4752 0.8208 0.9744 1.0000
We have calculated:
x 0 1 2 3 4
P(x ) 0.1296 0.3456 0.3456 0.1536 0.0256
F (x ) 0.1296 0.4752 0.8208 0.9744 1.0000
We have calculated:
x 0 1 2 3 4
P(x ) 0.1296 0.3456 0.3456 0.1536 0.0256
F (x ) 0.1296 0.4752 0.8208 0.9744 1.0000
We have calculated:
x 0 1 2 3 4
P(x ) 0.1296 0.3456 0.3456 0.1536 0.0256
F (x ) 0.1296 0.4752 0.8208 0.9744 1.0000
We can also graph the probability distribution function (PMF) and the cumulative
distribution function (CDF).
PMF CDF
1.0
0.30
0.8
0.20
0.6
P(x)
F(x)
0.4
0.10
0.2
0.00
0.0
−1 0 1 2 3 4 5 −1 0 1 2 3 4 5
x x
Binomial(n=10,p=0.5)
Normal(mu=5,var=2.5)
0.20
0.15
0.10
0.05
0.00
0 2 4 6 8 10
Poisson Distribution
Poisson distribution
X ∼ Poisson(λ)
e −λ · λx
P(x ) = , where e ≈ 2.71828
x!
The mean and variance are:
E [X ] = λ and V [X ] = λ
Suppose that in a given city there are, on average, 3 car accidents per day. What
is the probability that there will be 0 accidents tomorrow? What about 1, 2, 3, 4,
5, 100, 1000... accidents?
Suppose that in a given city there are, on average, 3 car accidents per day. What
is the probability that there will be 0 accidents tomorrow? What about 1, 2, 3, 4,
5, 100, 1000... accidents?
To find the probability of each outcome just apply the formula
P(X = x ) = P(x ) = e −λ · λx /x !, where λ = 3
Suppose that in a given city there are, on average, 3 car accidents per day. What
is the probability that there will be 0 accidents tomorrow? What about 1, 2, 3, 4,
5, 100, 1000... accidents?
To find the probability of each outcome just apply the formula
P(X = x ) = P(x ) = e −λ · λx /x !, where λ = 3
We have calculated:
x 0 1 2 3 4 5 6 ...
P(x ) 0.05 0.15 0.22 0.22 0.17 0.10 0.05 ...
F (x ) 0.05 0.20 0.42 0.65 0.82 0.92 0.97 ...
What is the probability of having at most 5 accidents?
What is the probability of having 2 accidents or more?
Given that X ∼ Poisson(λ = 3):
PMF CDF
1.0
0.20
0.8
0.6
P(x)
F(x)
0.10
0.4
0.2
0.00
0 2 4 6 8 10 0 2 4 6 8 10
x x
Binom(n, p) ∼ Poisson(np).
1 Organizational issues
3 Descriptive Statistics
4 Probability
5 Random variables
Discrete random variables
Continuous random variables
6 Probability Distributions
Bernoulli and Binomial Distribution
Normal distribution: approximations
Poisson Distribution
Uniform distribution
One of the simplest distributions, can be either discrete (for example, rolling
a die) or continuous.
We use uniform distribution when probabilities of the experiment are
distributed in an equal manner in a certain interval.
For example, spinning a needle on a 360◦ circle.
Uniform distribution
If a r.v. X is uniformly distributed, i.e. X ∼ U(a, b) then its PDF is given by:
(
1
x ∈ (a, b)
f (x ) = b−a
0 otherwise
Uniform distribution
If a r.v. X is uniformly distributed, i.e. X ∼ U(a, b) then its PDF is given by:
(
1
x ∈ (a, b)
f (x ) = b−a
0 otherwise
Uniform distribution
If a r.v. X is uniformly distributed, i.e. X ∼ U(a, b) then its PDF is given by:
(
1
x ∈ (a, b)
f (x ) = b−a
0 otherwise
(b − a)2
E [X ] = 0.5(a + b), V [X ] =
12
We know that daily demand for gasoline (in thousands of liters) in a gas station is
uniformly distributed X ∼ U(5, 15).
Draw the PDF.
Calculate the mean.
What is the probability that the demand is 7 thousands of liters or less?
In R we use dunif() and punif() commands.
Exponential distribution
One of the simplest continuous distributions, used for continuous data that
has positive values only.
The exponential distribution is usually used to model the amount of time
(duration) until some specific event occurs.
Length, in minutes, of a phone call; waiting times at a doctor’s office; the
duration of a car battery in months. Also, the amount of money customers
spend in one trip to the supermarket; the amount of change a person has in
his/her pockets, etc.
The Exponential distribution also describes the time between events in a
Poisson process.
Exponential distribution
Exponential distribution
Hence
(
1 − e −λx x ≥0
F (x ) =
0 x <0
Exponential distribution
Graphically:
PDF CDF
1.0
0.04
0.8
0.6
F(x)
f(x)
0.02
0.4
0.2
0.00
0.0
0 20 40 60 80 120 0 20 40 60 80 120
x x
Exponential distribution
Graphically:
PDF CDF
1.0
0.04
0.8
0.6
F(x)
f(x)
0.02
0.4
0.2
0.00
0.0
0 20 40 60 80 120 0 20 40 60 80 120
x x
Exponential distribution
Graphically:
PDF CDF
1.0
0.04
0.8
0.6
F(x)
f(x)
0.02
0.4
0.2
0.00
0.0
0 20 40 60 80 120 0 20 40 60 80 120
x x
E [X ] = 1/λ, V [X ] = 1/λ2
We know that the average waiting time at a doctor’s office is 20 minutes. Assume
that X -waiting time, follows an exponential distribution X ∼ Exp(λ). What is the
value of λ? What is the PDF of the random variable X ?
We know that the average waiting time at a doctor’s office is 20 minutes. Assume
that X -waiting time, follows an exponential distribution X ∼ Exp(λ). What is the
value of λ? What is the PDF of the random variable X ?
We know that the average waiting time at a doctor’s office is 20 minutes. Assume
that X -waiting time, follows an exponential distribution X ∼ Exp(λ). What is the
value of λ? What is the PDF of the random variable X ?
We know that the waiting time at a doctor’s office follows an exponential distribu-
tion X ∼ Exp(λ = 0.05). CDF is given by
(
1 − e −λx x ≥0
F (x ) = P(X ≤ x ) = F (x ) =
0 x <0
We know that the waiting time at a doctor’s office follows an exponential distribu-
tion X ∼ Exp(λ = 0.05). CDF is given by
(
1 − e −λx x ≥0
F (x ) = P(X ≤ x ) = F (x ) =
0 x <0
We know that the waiting time at a doctor’s office follows an exponential distribu-
tion X ∼ Exp(λ = 0.05). CDF is given by
(
1 − e −λx x ≥0
F (x ) = P(X ≤ x ) = F (x ) =
0 x <0
We know that the waiting time at a doctor’s office follows an exponential distribu-
tion X ∼ Exp(λ = 0.05). CDF is given by
(
1 − e −λx x ≥0
F (x ) = P(X ≤ x ) = F (x ) =
0 x <0