Statistics I
Learn to see order in the chaos
Author: Ignacio Arjona
na
rjo
A
io
ac
Ign
of
r ty
e
op
Pr
Table of Contents
I Calification Criteria and Aditional Information 2
1 Calification Criteria ............................................................................................................. 3
2 Probability and Statistics ...................................................................................................... 4
II Probability 5
1 Introduction to probability. Counting Sets............................................................................... 6
1.1 Permutations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2 Random Variable (abstraction), Distributions .......................................................................... 7
2.1 Distributions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.2 Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Probabilistic Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4 Discrete Uniform Probability Law . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.5 Conditional Probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
3 Expected Value, Median, Variance, Standard Deviation (Moment Generating Function) ................ 12
na
4 Central Limit Theorem......................................................................................................... 13
5 rjo
Por completar...................................................................................................................... 14
A
io
ac
I gn
of
e r ty
op
Pr
1
I. Calification Criteria and Aditional Information
2
I. Calification Criteria and Aditional Information
1 Calification Criteria
Attendance and Participation 10%
Individual and Group Assignments 30%
Theorical-Practical Exam 60%
na
rjo
A
io
ac
I gn
of
e r ty
op
Pr
3
I. Calification Criteria and Aditional Information
2 Probability and Statistics
Objective of Probabilities
To model uncertaintly with data. Uncertainty is when something is too complex to model.
Example: Flipping a Coin
To flip a coin is actually a deterministic problem.
Examples
Gas: to keep track of every molecule in a gas is nigh-imposible. The physic’s branch of statistical mechanics deal
with these type of problems.
Turbulence (fluids)
Weather
Human behaviour: for example, the influence Facebook had in Brexit
Relation Between Probability and Statistics
Probability: we assume a known probability distribution and from that we predict future outcomes
Statistics: the data is known and the distribution is unknown. We employ a hypothesis test to answer questions
na
(Is this a fair coin? Is this drug effective?)
rjo
A
io
ac
I gn
of
e r ty
op
Pr
4
II. Probability
5
II. Probability
1 Introduction to probability. Counting Sets
Probability
How we calculate how likely is some event going to happen
The probability of an event A is calculated by:
# ways A can happen
( 𝐴) =
# things that can happen
Example: Flipping a Coin Twice
A is the event of having at least 1 head. B is the event of having no heads at all.
The set, or sample space, contains all the possible things that can happen. {ℎℎ, ℎ𝑡, 𝑡ℎ, 𝑡𝑡} (4 elements)
The set A is composed by {ℎℎ, ℎ𝑡, 𝑡ℎ} (3 elements)
The pobability of A ocurring is, in this case: 43 = 0.75
The set B is composed by {𝑡𝑡}
The pobability of B ocurring is, in this case: 14 = 0.25
Example: Rolling two dices
Ω = {11, 12, ..., 21, 22, ..., 65, 66}
na
|Ω| = 62 = 36
𝐴 ≡ at least 1 die is a 5
𝐴 = {15, 25, 35, 45, 55, 65, 56, 54, 53, 52, 51}
rjo
A
𝑃( 𝐴) = 11
36
io
ac
Example: Flipping a Coin 10 times
gn
Ω = {ℎℎℎℎℎℎℎℎℎℎ, ℎℎℎℎℎℎℎℎℎ𝑡, ..., 𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡𝑡}
I
|Ω| = 210 = 1024
of
𝐴 ≡ getting at least 5 heads, 𝑥 ≥ 5 (𝑥 ≡ number of heads in 10 coin flips)
𝑃( 𝐴) = | 𝑥=5|+| 𝑥=6|+| 𝑥=7|+| 𝑥=8|+| 𝑥=9|+| 𝑥=10|
r ty
|Ω|
For x=5, we use the general formula 𝑛𝑟 = (𝑛−𝑟𝑛!)!𝑟!
e
10 10!
5 = (10−5)!5! = 252
op
We can repeat the same process for the other values of x, untill we arrive to:
638
𝑃( 𝐴) = 1024
Pr
1.1 Permutations
In other events, order does matter. For example, in a poker hand: 𝐾 𝐽346 . 𝐽𝐾436
52!
If we draw 5 cards out of a deck of 52 cards, there are (52−5)! possible hands = 311875200
6
II. Probability
2 Random Variable (abstraction), Distributions
2.1 Distributions
Binomial − Two Outcomes (Bernoulli)
Discrete
Multinomial − Many Outcomes
Normal
− Binomial for Large Numbers
Continuous Poisson − Rare Events
Exponential − Temporal Intervals
2.2 Sets
Set
A set is a collection of objects, which are the elements of the set. We express 𝑥 ∈ 𝑆 if S is a set, and x is an element
of the set
Disjoint Sets
Two sets are said to be disjoint if their intersection is empty. Several sets are said to be disjoint if no two of them
have a common element
na
Partition
rjo
A collection of sets is said to be a partition of a set S if the sets in the collection are disjoin and their union is S
A
Ordered Pair
io
ac
If x and y are two objects, we use (x,y) to denote the ordered pair of x and y. R denotes the set of real numbers.
The set of pairs (or triplets) of scalars, i.e. the two-dimentional plane (or the three-dimentional space) is denoted by
gn
R2 (or R3 )
I
of
2.3 Probabilistic Models
r ty
Probabilistic Models
e
op
They are a mathematical description of an uncertain situation. It has two elements:
Pr
1. The sample space Ω, which is the set of all possible outcomes of an experiment
2. The probability law, which assigns to a set A of possible outcomes (also called an event) a nonnegative number
P(A) (called the probability of A) that encodes our knowledge or belief about the collective "likelihood" of the
elements of A
Experiment
Every probabilistic model involves an underlying process called the experiment that will produce exactly one of
several possible outcomes
Event
A subset of the sample space, i.e. a collection of possible outcomes is called an event.
Three tosses of a coin constitute a single expreiment, rather than three experiments.
Sample Space
The sample space of an experiment may consist of a finite or an infinite number of possible outcomes.
Different elements of the sample space should be distinct and mutally explusive, so that when the experiment is
carried out, there is a unique outcome
7
II. Probability
Propability Laws
Assign to every event a number P(A), called the probability of A, satisfying the following axioms:
Probability Axioms
1. Nonnegativity: 𝑃( 𝐴) ≥ 0 for every event A
2. Additivity: If A and B are two disjoing events, then the probability of their union satisfies 𝑃( 𝐴∪𝐵) = 𝑃( 𝐴)+𝑃(𝐵)
3. Normalization: The probability of the entire sample space Ω is equal to 1, i.e. 𝑃(Ω) = 1
Some properties derived from these axioms:
1. 𝑃(Ω) = 𝑃(Ω ∪ ∅) = 𝑃(Ω) + 𝑃(∅) = 1 + 𝑃(∅) =⇒ 𝑃(∅) = 0
2. 𝑃( 𝐴1 ∪ 𝐴2 ∪ 𝐴3 ) = 𝑃( 𝐴1 ) + 𝑃( 𝐴2 ) + 𝑃( 𝐴3 ) (si son disjoints)
Discrete Models
Consider an experiment involving a single coin toss.
Ω = {𝐻, 𝑇 }
The events are: {𝐻, 𝑇 }, {𝐻}, {𝑇 }, {} If the coin is fair: 𝑃({𝐻}) = 0, 5; 𝑃({𝑇 }) = 0, 5,
na
𝑃({𝐻} ∪ {𝑇 }) = 𝑃({𝐻, 𝑇 }) = 𝑃(Ω) = 1
rjo
A
2.4 Discrete Uniform Probability Law
io
If the sample space consists of n possible outcomes, which are equally likely (i.e. all single-element events have
ac
the same probability), then the probability of any event A is given by
gn
number of elements of A
I
𝑃( 𝐴) =
of
𝑛
Properties of Probability Laws:
r ty
• If 𝐴 ⊂ 𝐵, then 𝑃( 𝐴) ≤ 𝑃(𝐵)
e
op
• 𝑃( 𝐴 ⊂ 𝐵) = 𝑃( 𝐴) + 𝑃(𝐵) − 𝑃( 𝐴 ∩ 𝐵)
Pr
• 𝑃( 𝐴 ∪ 𝐵) ≤ 𝑃( 𝐴) + 𝑃(𝐵)
• 𝑃( 𝐴 ∪ 𝐵 ∪ 𝐶) = 𝑃( 𝐴) + 𝑃( 𝐴𝑐 ∩ 𝐵) + 𝑃( 𝐴𝑐 ∩ 𝐵 𝑐 ∩ 𝐶)
2.5 Conditional Probability
Provides us with a way to reason about the putcome of an experiment, based on partial information. For example,
in an experiment involving two successive rolls of a die, you are told that the sum of the two rolls is 9. How likely
is that the first roll was a 6?
Properties of conditional probability
The conditional probability of an event A, given an event B with 𝑃(𝐵) > 0 is defined by
𝑃( 𝐴 ∩ 𝐵)
𝑃( 𝐴|𝐵) =
𝑃(𝐵)
If the possible outcomes are finitely many, and equally likely, then
number of elements 𝐴 ∩ 𝐵
𝑃( 𝐴|𝐵) =
number of elements in 𝐵
8
II. Probability
Coin Toss
We toss a fair coin 3 successive times. We wish to find the conditional probability 𝑃( 𝐴|𝐵) where A=more H than
T come up, and B=First toss is H
Ω = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇 𝐻, 𝐻𝑇𝑇, 𝑇 𝐻𝐻, 𝑇 𝐻𝑇, 𝑇𝑇 𝐻, 𝑇𝑇𝑇 }
𝐴 = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇 𝐻, 𝑇 𝐻𝐻}
𝐵 = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇 𝐻, 𝐻𝑇𝑇 }
𝐴 ∩ 𝐵 = {𝐻𝐻𝐻, 𝐻𝐻𝑇, 𝐻𝑇 𝐻}
3
𝑃( 𝐴|𝐵) =
4
Roll Dice
A fair 4-sided die is rolled. Let x and y be the result of the 1𝑠𝑡 and 2𝑛𝑑 roll, respectively. We want 𝑃( 𝐴|𝐵) where
𝐴 = {𝑚𝑎𝑥(𝑥, 𝑦) = 𝑚} with 𝑚 = 1, 2, 3, 4 and 𝐵 = {𝑚𝑖𝑛(𝑥, 𝑦) = 2}
Ω = {11, 12, 13, ..., 21, 22, ..., 43, 44}
𝐴1 {11}
𝐴2 {12,21,22}
𝐴3 {13,31,23,32,33}
na
𝐴4 {14,24,34,44,43,42,41}
𝐴1 ∩ 𝐵 {}
rjo
P(A|B)=0
A
𝐴2 ∩ 𝐵 {22} P(A|B)= 15
P(A|B)= 25
io
𝐴3 ∩ 𝐵 {23,32}
𝐴4 ∩ 𝐵 {24,42} P(A|B)= 25
ac
gn
Exercise
I
of
A conservative design team, call it C, and an innovative design team, call it N, are asked to separately design a
product within a month. From past experience we know that:
r ty
2
1. The probability that team C is successful is 3
e
1
2. The probability that team N is successful is
op
2
3
3. The probability that at least one team is successful is
Pr
4
Assuming that exactly one successful design is produced, what is the probability that it was designed by team N?
2
𝑃(𝑆𝑆) + 𝑃(𝑆𝐹) =
3
1
𝑃(𝑆𝑆) + 𝑃(𝐹𝑆) =
2
3
𝑃(𝑆𝑆) + 𝑃(𝑆𝐹) + 𝑃(𝐹𝑆) =
4
We solve the system, and get:
5
𝑃(𝑆𝑆) 12
1
(𝑆𝐹) 4
1
(𝐹𝑆) 12
1
𝑃({𝐹𝑆}) 12 1
𝑃(𝐹𝑆|{𝑆𝐹, 𝐹𝑆}) = 𝑃(𝐹𝑆|{𝑆𝐹} ∪ {𝐹𝑆}) = = 1 1
=
𝑃({𝑆𝐹} ∪ {𝐹𝑆}) 4 + 12
4
9
II. Probability
Another Exercise
If an aircraft is present in a certain area, a radar correctly registers its presence with probability 0,99. If it is not
present, the radar falsely registers an aircraft presence with probability 0,10. We assume that an aircraft is present
with probability 0,05. What is the probability of a false alarm? What is the probability of a missed detection?
We’re dealing with an event A. which occurs if and only if each one of several events 𝐴1 , ...𝐴𝑛 has ocurred,
i.e. 𝐴 = 𝐴1 ∩ ... ∩ 𝐴𝑛 is the occurrence of 𝐴1 , followed by 𝐴2 , all the way up to 𝐴𝑛 . The probability of an event 𝐴
is fiven by the Multiplication Rule
Multiplication Rule
𝑛
Ù 𝑛−1
Ù
𝑃( 𝐴𝑖 ) = 𝑃( 𝐴1 )𝑃( 𝐴2 | 𝐴1 ) ( 𝐴3 | 𝐴1 ∩ 𝐴2 )...𝑃( 𝐴𝑛 | 𝐴𝑖 )
𝑖=1 𝑖=1
Cards
Three cards are drawn from a deck without replacement. We wish to find the probability that none of the 3 cards
is a heart:
39 38 37
∗ ∗ ≃ 0.41
52 51 50
na
Total Probability Theorem
rjo
Let 𝐴1 , ..., 𝐴𝑛 be disjoint events that form a partition of the sample space, and assume that 𝑃( 𝐴𝑖 ) > 0 for all 𝑖.
Then, for any event 𝐵, we have
A
𝑃(𝐵) = 𝑃( 𝐴1 ∩ 𝐵) + ... + 𝑃( 𝐴𝑛 ∩ 𝐵) =
io
𝑃( 𝐴1 )𝑃(𝐵| 𝐴1 ) + ... + 𝑃( 𝐴𝑛 )𝑃(𝐵| 𝐴𝑛 )
ac
gn
Chess
I
You enter a chess tournament where your probability of winning a game is 0,3 against half the players (call them
of
type 1), 0,4 against a quarter of the players (type 2), and 0,5 against the remaining quarter of the players (type 3). You
play a game against a randomly-chosen opponent. What is your probability of winning?
r ty
Define the events:
e
𝐴𝑖 = {play against type i player} i=1,2,3
op
𝐵 = {win the match}
Pr
𝑃( 𝐴1 ) = 0.5 𝑃(𝐵| 𝐴1 ) = 0.3
𝑃( 𝐴2 ) = 0.25 𝑃(𝐵| 𝐴2 ) = 0.4
𝑃( 𝐴3 ) = 0.25 𝑃(𝐵| 𝐴3 ) = 0.5
𝑃(𝐵) = 0.5 ∗ 0.3 + 0.25 ∗ 0.4 + 0.25 ∗ 0.5 = 0.375
Dice
You roll a fair 4-sided die. If the result is 1 or 2, you roll once more, but otherwise you stop. What is the probability
that the sum total of your rolls is at least 4?
Let 𝐴𝑖 be the event that the 1𝑠𝑡 roll is 𝑖. Since the die is fair 𝑃( 𝐴𝑖 ) = 41 for each 𝑖. Let 𝐵 be the event that the
sum total is at least 4. Given the event 𝐴1 , the sum total will be at least 4 if the 2nd roll is 3 or 4, which happens with
probability 21 .
Given the event 𝐴2 , the sum total will be at least 4 if the 2𝑛𝑑 roll results in 2,3 or 4, which happens with probability
3
4.
If 𝐴3 happens, you stop, and the sum total remains below 4
If 𝐴4 happens, you stop, and the sum total is 4
1 3
𝑃(𝐵| 𝐴1 ) = , 𝑃(𝐵| 𝐴1 ) = , 𝑃(𝐵| 𝐴1 ) = 0, 𝑃(𝐵| 𝐴1 ) = 1
2 4
9
𝑃(𝐵) = 𝑃( 𝐴1 )𝑃(𝐵| 𝐴1 ) + 𝑃( 𝐴2 )𝑃(𝐵| 𝐴2 ) + 𝑃( 𝐴3 )𝑃(𝐵| 𝐴3 ) + 𝑃( 𝐴4 )𝑃(𝐵| 𝐴4 ) =
16
10
II. Probability
Baye’s Rule
Let 𝐴1 , 𝐴2 , ..., 𝐴𝑛 be disjoint events that form a partition of the sample space, and assume that 𝑃( 𝐴𝑖 ) > 0. Then
for any event 𝐵 such that 𝑃(𝐵) > 0, we have
𝑃( 𝐴𝑖 )𝑃(𝐵| 𝐴𝑖 ) 𝑃( 𝐴𝑖 )𝑃(𝐵| 𝐴𝑖 )
𝑃( 𝐴𝑖 |𝐵) = =
𝑃(𝐵) 𝑃( 𝐴1 )𝑃(𝐵| 𝐴1 ) + ... + 𝑃( 𝐴𝑛 )𝑃(𝐵| 𝐴𝑛 )
na
rjo
A
io
ac
I gn
of
e r ty
op
Pr
11
II. Probability
3 Expected Value, Median, Variance, Standard Deviation (Moment Gen-
erating Function)
na
rjo
A
io
ac
Ign
of
r ty
e
op
Pr
12
II. Probability
4 Central Limit Theorem
na
rjo
A
io
ac
gn
I
of
r ty
e
op
Pr
13
II. Probability
5 Por completar
na
rjo
A
io
ac
gn
I
of
r ty
e
op
Pr
14