Professional Documents
Culture Documents
• (If time allows it) Start presenting some important Discrete Distributions.
4 Distributional Summaries
4 Distributional Summaries
Definition (Informal)
A Random Variable X is a variable that takes on different numerical values
according to the outcomes of a random experiment.
The probability of the numerical values will result from the probabilities of the
outcomes.
To define a random variable, we need:
1. a list of all possible numerical values
2. the probability of each numerical value
0, 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10
• The probabilities are determined by the assumptions made about the coin
flips, e.g.
• what is the probability of a ‘tail’ on a single coin flip
• whether this probability is the same for every coin flip
• whether the 10 coin flips are ‘independent’ of each other
Example
• Measure the time taken by school students to complete a test.
• Every student has a maximum of 2 hours to finish the test.
• Let X = completion time (in minutes).
• The possible values of the random variable X are contained in the interval
• Suppose we have:
a. A sample space S “for the events”
b. A probability measure (Pr ) “for the events” in S
• Let X (s) be a function that takes an element s ∈ S to a number x
Example (continued)
Let us define X (sij ) as the sum of the outcomes in both dice:
Consequences:
• X (·) maps S into D.
• The sample space D is given by
Exercise
What is P(9)? What is P(13)? [Hint: does 13 belong to D?]
Flores-Agreda, La Vecchia S110015 Spring Semester 2021 12 / 46
What is a Random Variable?
A(n) even more formal characterisation
D = {x : x = X (s) , s ∈ S}
Ai ∩ Aj = ∅
1
P({X = 1}) = Pr (‘6’ on the 1st roll) =
6
5 1 5
P({X = 2}) = Pr (no ‘6’ on the 1st roll and ‘6’ on the 2nd roll) = · =
6 6 36
P({X = 3}) = Pr (no ‘6’ on either the 1st nor 2nd roll and ‘6’ on the third roll)
5 5 1 25
= · · =
6 6 6 216
..
.
P({X = n}) = Pr (no ‘6’ on the first n − 1 rolls and ’6’ on the last roll)
n−1
5 1
= ·
6 6
..
.
Example (continued)
Geometric distribution
0.15
0.10
p
0.05
0.00
0 10 20 30 40 50
x
Example (continued)
• Rather than list the possible values of X along with the associated probabilities in a table,
we can provide a formula that gives the required probabilities.
n−1
5 1
P({X = n}) = for n = 1, 2, . . .
6 6
Exercise
Show that
∞ n−1
X 5 1
= 1.
n=1
6 6
4 Distributional Summaries
Discrete random variables are often associated with the process of counting.
More generally:
• For a discrete random variable X , any table listing all possible nonzero
probabilities provides the entire Probability Distribution.
• The probability mass function p(a) of X is defined by
4 Distributional Summaries
The Cumulative Distribution Function (CDF) is a table listing the values that X can take, along
with X
FX (a) = P ({X ≤ a}) = p(x).
all x≤a
If the random variable X takes on values x1 , x2 , x3 , . . . ., xn listed in increasing order
x1 < x2 < x3 < · · · < xn , the CDF is a step function, that it its value is constant in the intervals
(xi−1 , xi ] and takes a step/jump of size pi at each xi :
xi FX (xi ) = P ({X ≤ xi })
x1 p1
x2 p1 + p2
x3 p1 + p2 + p3
.. ..
. .
xn p1 + p2 + · · · + pn = 1
Example
xi 0 1 2 3 Tot
P({X = xi }) 4/35 18/35 12/35 1/35 1
P({X ≤ xi }) 4/35 22/35 34/35 35/35
0 x <0
4/35 0≤x <1
FX (x) = 22/35 1 ≤ x < 2
34/35 2 ≤ x < 3
1 x ≥ 3.
Example (continued)
... or graphically, you get a step function ...
Remark
Suppose a ≤ b. Then, because the event {X ≤ a} is contained in the event
{X ≤ b}, namely
{X ≤ a} ⊆ {X ≤ b},
it follows that
FX (a) ≤ FX (b),
so, the probability of the former is less than or equal to the probability of the
latter.
Definition (Quantiles)
The CDF can be inverted to define the value x of X that corresponds to a given
probability α, namely α = P(X ≤ x), for α ∈ [0, 1].
The inverse CDF FX−1 (α) or quantile of order α, Q(α), is the smallest realisation
of X associated to a CDF greater or equal to α
In formula, the α-quantile Q(α) is the smallest number satisfying:
EXEMPLE
...calling (only for this slide) R the rv, r its realizations and FR (r ) its CDF at r ...
Copyright c 2016–2017, Prof. Dr. Diego Kuonen, CStat PStat CSci, RCS, GSEM, Université de Genève, Suisse. Tous droits réservés. 148
4 Distributional Summaries
0.4
12/35
P(X=x)
0.2
4/35
1/35
0.0
0 1 2 3
x
Definition
The Square root of the Variance, or Standard Deviation, of the distribution
p
s.d (X ) = Var (X )
q
= p1 (x1 − E [X ])2 + p2 (x2 − E [X ])2 + · · · + pn (xn − E [X ])2
0.4 0.4
12/35 12/35
P(X=x)
P(X=x)
0.2 0.2
4/35 4/35
1/35 1/35
0.0 0.0
0 1 2 3 0 1 2 3
x x
Distribution 2 is 'more spread' than Distribution 1
E [αX ] = αE [X ]
E [α + X ] = α + E [X ]
Var (αX ) = α2 Var (X )
Var (α + X ) = Var (X )
Exercise
Let us very the first property: E [αX ] = αE [X ] . From the intro lecture we know that, for every
αi ∈ R,
Xn
αi Xi = α1 X1 + α2 X2 + .... + αn Xn .
i=1
So, the required result follows as a special case, setting αi = α, for every i, and applying the
definition of Expectation. Verify this and the other properties as an exercise. [Hint: set
αi = αpi .]
Definition
Consider two discrete random variables Then, X and Y are independent if
for all values x that X can take and all values y that Y can take.
E [X + Y ] = E [X ] + E [Y ]
Remark
Note that Eq. (2) does not (typically) hold if X and Y are NOT
independent—more to come on this later on...
Exercise
Show that
2
Var (X ) = E X 2 − E [X ] .
• A Random Variable maps events from the Sample Space of the Events
onto a set of numerical values.
• This entails a new sample space and a new probability measure P(·)
4 Distributional Summaries
Remark
Their main characteristic is that the probability P ({X = xi }) is given by an
appropriate mathematical formula: i.e.
pi = P ({X = xi }) = h(xi )
1
P ({X = x}) = .
(k + 1)
xi P ({X = xi })
1
0 (k+1)
1
1 (k+1)
.. ..
. .
1
k (k+1)
Total 1
E [X ] = x1 p1 + ... + xk pk
1 1 1
= 0· +1· + ··· + k ·
(k + 1) (k + 1) (k + 1)
1
= · (0 + 1 + · · · + k)
(k + 1)
1 k (k + 1)
= ·
(k + 1) 2
k
= .
2
E.g. when k = 6, then X can take on one of the seven distinct values
x = 0, 1, 2, 3, 4, 5, 6, each with equal probability 17 , but the expected value of
X is equal to 3, which is one of the possible outcomes!!!
Example
An example of discrete uniform is related to the experiment of rolling a
die—remark, the outcome zero is not allowed in this specific example.
Let us call X the corresponding random variable and {x1 , x2 , ..., x6 } its realizations.
Moreover,
1
E (X ) = (1 + 2 + 3 + 4 + 5 + 6) · = 3.5,
6
which is not one of the possible outcomes!!!
Definition
Bernoulli trial is the name given to the random variable X having probability
distribution given by
xi P({X = xi })
1 p
0 1−p
Often we write
1−x
P({X = x}) = p x (1 − p) , for x = 0, 1
Remark
Just for the sake of notation, let us set X = 1 if Success occurs, and X = 0 if
Failure occurs
Example
Coin tossing: we can define a random variable
xi P({X = xi })
1 p
0 1−p
and say that X = 1 if H and X = 0 if T .
Flores-Agreda, La Vecchia S110015 Spring Semester 2021 44 / 46
Bernoulli Trials
Expectation and Variance
• Mean:
E [X ] = 1 · p + 0 · (1 − p)
= p
• Variance:
2 2
Var (X ) = (1 − p) · p + (0 − p) · (1 − p)
= p (1 − p) .