Probability Notes
Probability Notes
Probability &
Statistics
2DI90 – Chapter 3 of MR
Random Variables (§ 2.8 MR)!
Example:
• X is the random variable corresponding to the temperature of
the room at time t.
• x is the measured temperature of the room at time t.
2
Discrete Random Variables (§ 3.1 MR)!
!
3
Probability Distributions (§ 3.2 MR)!
! he probability distribution of a random variable X is a
T
description of the probabilities associated with each possible
outcome of X.
4
Probability Distributions!
If the space of possible outcomes is countably infinite, the
previous definition can be easily generalized:
5
Example!
Consider a situation in which a user can make one of three
possible requests to a GUI. We can view this as a random
experiment with the following sample space:
6
It’s very easy to check this is a valid probability mass function.
Example!
Let X be the number of times you need to send a packet over a
network to ensure it was received.
8
Cumulative Distribution Function (§ 3.3 MR)!
!For any random variable the possible outcomes of a random
variable are real numbers. It is then often useful to describe the
probability distribution using a different function…
-1 0 1 2 3 4 5 -1 0 1 2 3 4 5 11
C.D.F. Example!
1.0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
-1 0 1 2 3 4 5
A – 0.3 B – 0.4
C – 0.5 D – 0.6 12
Mean and Variance (§ 3.4 MR)!
!There are certain “summaries” of the distribution of a random
variable that can give a lot of information about it. These have
also easy intuitive interpretations.
Definition: Mean and Variance (discrete r.v.)
13
Mean and Variance!
The mean is a weighted average of the possible values of X,
where the weights are their corresponding probabilities.
Therefore the mean describes the “center” of the distribution.
In other words X takes values “around” its mean…
14
Example!
The number of surface defects on the CD-RW of a certain
manufacturer is well modeled by a random variable X with the
following distribution:
15
Example!
16
Functions of Random Variables!
Functions of random variables are ALSO random variables.
18
Variance as an Expected Value!
In light of the previous result:
20
* - happy meal is a trademark of McDonald's corporation, and I have no affiliation with them whatsoever…
Properties of the Mean and Variance!
Properties:
WARNING!!!
21
Example!
You are playing slot-machine game in a casino downtown. The
machine gives a prize of €100 with probability 0.02. To play you
need to pay €5…
€
2
€
€
22
Independence of Random Variables!
Earlier we talked about independent events. Actually the concept
of independence extends naturally to random variables, and plays
a crucial role both in probability and statistics.
23
Independence of Random Variables!
Example: Let X denote the number of students in the classroom
today and Y denote the outcome of flipping a coin.
Proposition:
26
Discrete Uniform Distribution (§ 3.5 MR)!
Definition: Discrete Uniform Distribution
29
Dices!
30
Dices!
31
Bernoulli Random Variables!
Definition: Bernoulli Random Variable
Examples:
32
Bernoulli Trials (§ 3.6 MR)!
Independent Bernoulli random variables are important blocks to
build more complicated random variables…
34
Binomial Distribution!
36
Binomial Distribution!
37
Binomial Distribution!
38
Binomial Distribution Example!
Samples from a certain water supply have a 10% chance of
containing an organic pollutant. Suppose you collect 20 samples
over time, and these are taking in such a way that you can
assume these are independent. Let X be the number of
contaminated samples.
39
Binomial Distribution Example!
40
Geometric Distribution (§ 3.7 MR)!
!Let X be the number of times you need to send a packet over a
network to ensure it was received.
42
Geometric Distribution Example!
Let X be the number of times you need to send a packet over a
network to ensure it was received.
dgeom(seq(0, 9, 1), 0.9)
0.8
0.4
0.0
43
2 4 6 8 10
1:10
Some Properties!
In other words:
44
Memoryless Property!
This means that, for most objects for which there is no “wear”
during normal operation the corresponding duration is well
modeled by a geometric distribution:
Examples:
46
Negative Binomial Distribution!
Definition: Negative Binomial random variable
48
Negative Binomial Distribution (§ 3.7 MR)!
!
49
Hypergeometric Distribution (§ 3.8 MR)!
Suppose we are in a setting similar to the one of binomial
distributions:
50
Hypergeometric Distribution!
If we put the ball back in the bag and shuffle them around we
can repeat the previous random experiment.
What if you don’t put the balls you take back in the bag???
51
Hypergeometric Distribution!
Definition: Hypergeometric random variable
53
Another Way!
54
Properties!
The mean and variance of a hypergeometric random variable is a
bit harder to derive than for a binomial random variable,
because of the dependencies. But can still be done (with some
work…
56
Poisson Distribution (§ 3.9 MR)!
This is a very important and useful distribution, appearing in
many contexts. It is particularly relevant to study queues, as it
can be used as a sensing model requests arriving to a server
over time.
Assumptions:
59
Poisson Distribution Derivation!
To derive the exact expression for the Poisson distribution
let’s consider what happens to the distribution of a binomial
random variable in the limit.
60
Derivation – 1st Term!
61
Derivation – 2nd & 3rd Terms!
62
Poisson Distribution!
64
Properties!
The mean and variance are easily calculated from the p.m.f:
65
Example!
There are many situations where the Poisson distribution
seems to be a good fit.
66
Example!
67
Example!
68
A Strange Example!
(Bortkiewicz ‘1898) The number of fatalities resulting from
being kicked by a horse was recorded for 10 corps of Prussian
cavalry over a period of 20 years. Perhaps surprisingly (or not)
this follows quite well a Poisson distribution with parameter
λ=0.61…
69
Next in the Course!
Discrete random variables are not the end of the story…