Documente Academic
Documente Profesional
Documente Cultură
e-mail: X.Wang@hw.ac.uk
Website: http://home.eps.hw.ac.uk/~xw66/
1
1
1
What are Probability and
Statistics?
Probability is the chance that something will happen
(is the measure of the likelihood that an event will occur)
Uncertainty, Randomness
Gambling: Poker, Dice, Roulette, Lottery, Majiang, …
Physics: Philosophy
* Classical Mechanics (Isaac Newton)
* Electromagnetism (James Maxwell)
* Thermodynamics and statistical mechanics (laws of thermodynamics, Ludwig Boltzmann) 3
* Quantum Mechanics (Niels Bohr, uncertainty principle, Copenhagen interpretation, etc.)
2
Course arrangement
Recommended Text:
Probability and Random variables: a Beginner’s
Guide
by David Stirzaker, Cambridge University Press,
2007 (5th printing)
Assessments:
1.There will be one Class test in the 1st half 15%
(one in the 2nd half for 15%)
3
Definitions
An experiment is a situation involving chance or probability
that leads to results called outcomes.
Outcome Examples
Experiment Sample Space
Toss a Coin Head, Tail
Toss 2 Coins HH, HT, TH, TT
Select 1 Card, kind 2♥, 2♦, ..., A♠ (52)
Select 1 Card, suit Heart, Club etc. (4)
Play a Football Game Win, Lose, Draw
Observe Gender Male, Female
4
Outcomes
1. Mutually Exclusive
2 Outcomes cannot occur at the same time
cannot draw both a Heart and a Club
2. Collectively Exhaustive
1 Outcome in sample space must occur
Club, Diamond, Heart or Spade must be drawn
5
Events
1. Any Collection of Sample Points
2. Simple Event
Outcome With 1 Characteristic
3. Compound Event
Collection of Outcomes or Simple Events
2 or More Characteristics
Event Outcomes
Experiment:
Toss 2 Coins 1 Head & 1 Tail HT, TH
Heads on 1st Coin HH, HT
At Least 1 Head HH, HT, TH
Heads on Both HH
11
6
Event Intersection: Venn
Diagram
Experiment: Draw 1 Card. Denomination,
Colour & Suit.
Black Event
Sample Black:
Space: 2B♣, ...,
2R♥, 2R♦, AB♠
2B♣, ..., AB♠
Ace S
Event Ace: Joint Event (Ace ∩ Black):
AR♥, AR♦, AB♣, AB♠ AB♣ , AB♠ 13
Event Intersection:
Contingency Table
Experiment: Draw 1 Card. Denomination,
Colour & Suit.
Color Simple
Sample Type Red Black
Total Event
Space (S): Ace:
Ace Ace & Ace & Ace
2R♥, 2R♦, AR♥,
2B♣, ..., AB♠
Red Black
AR♦,
Non-Ace Non & Non & Non-
AB♣ ,
Joint Event Red Black Ace AB♠
Ace AND Total Red Black S
Black:
AB♣ , AB♠ Simple Event Black: 2B♣, ..., AB♠
14
7
Event Union :
Venn Diagram
Experiment: Draw 1 Card. Denomination,
Colour & Suit.
Black Event
Sample Black:
Space: 2B♣ ,
2R♥, 2R♦, 2B♠, ...,
2B♣, ..., AB♠ AB♠
Ace S
Event Ace: Event (Ace ∪ Black):
AR♥, AR♦, AB♣, AB♠ AR♥, ..., AB♠, 2B15
♣, ..., KB♠
8
Special Events
1. Null Event
Club & Diamond on a single card
2. Complement of Event
For Event A, All Events Not In A: AC
3. Mutually Exclusive Events
Events Do Not Occur Simultaneously
Complement of Event
Example
Experiment: Draw 1 Card. Denomination,
Colour & Suit.
Black
Sample
Space:
2R♥, 2R♦,
2B♣, ..., AB♠
S
Event Black: Complement of Event Black,
2B♣, 2B♠, ..., AB♠ Black ’: 2R♥, 2R♦, ..., AR♥, AR♦
18
9
Mutually Exclusive Events
Example
Experiment: Draw 1 Card. Denomination,
Colour & Suit.
Sample
♥ Outcomes
in Event
Space: Heart:
2♥ , 2♦ , 2♥ , 3♥ ,
♠
2♣, ..., A♠ 4♥, ..., A♥
S
Event Spade:
2♠, 3♠, 4♠, ..., A♠ Events ♠ &♥ Mutually Exclusive
19
10
Assigning Event Probabilities
2. empirical, classical method. This is based on
experiment, collecting real data
Finding probabilities by
experiment
Empirical data: what’s the probability
of getting a head on the toss of a
Total Heads / single fair coin?
Number of Tosses
1.00 How many trials do we need to run to
become confident? That comes later!
0.75
0.50
0.25
0.00
0 25 50 75 100 125
Number of Tosses
22
11
Assigning Event Probabilities
3. Subjective method. This is based on experience,
knowledge of the situation, commonly used in expert
systems for medical diagnosis, or playing the stock
market, for example.
12
13
Compound Events: Contingency Table
Event
Event B1 B2 Total
A1 P(A1 ∩ B1) P(A1 ∩ B2) P(A1)
A2 P(A2 ∩ B1) P(A2 ∩ B2) P(A2)
Total P(B1) P(B2) 1
14
Contingency Table
Example
Draw 1 Card. Denomination and Colour
Color
Type Red Black Total
Ace 2/52 2/52 4/52
Non-Ace 24/52 24/52 48/52 P(Ace)
Additive Rule
30
15
Additive Rule Example
Color
Type Red Black Total
Ace 2 2 4
Non-Ace 24 24 48
Total 26 26 52
32
16
Conditional Probability
1. Event Probability Given that Another
Event Occurred
2. Revise Original Sample Space to
Account for New Information
Eliminates Certain Outcomes
Conditional Probability
Using Venn Diagram
Black ‘Happens’:
Eliminates All
Black
Other Outcomes
Ace
Black
S (S)
Event (Ace AND Black)
34
17
Conditional Probability
Using Contingency Table
Draw 1 Card. Denomination and Colour
Color
Type Red Black Total Revised
Sample
Ace 2 2 4 Space
Non-Ace 24 24 48
Total 26 26 52
P(Ace AND Black) 2 / 52 2
P(Ace | Black) = = =
P(Black) 2635/ 52 26
36
18
Statistical Independence
1. An event occurrence does Not affect the
probability of another event
Toss 1 Coin Twice . There is no causality
2. Tests for independence (Definition)
P(A | B) = P(A)
P(A and B) = P(A)*P(B)
Prove:
Dependent!
If A and B are independence,
Then A and Bc are independent A B
Tree Diagram
19
39
40
20
41
Multiplicative Rule
1. Used to Get Compound Probabilities
for Intersection of Events
Called Joint Events
2. P(A and B) = P(A ∩ B)
= P(A)*P(B|A)
= P(B)*P(A|B)
3. For Independent Events:
P(A and B) = P(A ∩ B) = P(A)*P(B)
42
21
43
44
22
Bayes’ Theorem (Rule, Law)
Bayes’ Theorem: Let events A1,…,Ak form a partition of
the space S such that Pr(Aj) > 0 for all j and let B be
any event such that Pr(B) > 0. Then for i = 1,..,k:
Pr ( Ai ) Pr ( B | Ai )
Pr ( Ai | B ) =
∑k Pr (Ak ) Pr (B|Ak )
Proof:
Pr( Ai ∩ B) Pr( Ai ) Pr(B | Ai)
Pr( Ai | B) = =
Pr(B) ∑k Pr(Ak ) Pr(B | Ak )
Bayes’ Theorem is just a simple rule for computing the conditional
probability of events Ai given B from the conditional probability of B given
each event Ai and the unconditional probability of each Ai
Pr ( Ai ) Pr ( B | Ai )
Pr ( Ai | B ) =
∑k Pr (Ak ) Pr (B|Ak )
46
23
47
Suppose you're on a game show, and you're given the choice of three doors:
Behind one door is a car; behind the others, goats.
You pick a door, say No. 1, and the host, who knows what's behind the doors,
opens another door, say No. 3, which has a goat. He then says to you, "Do you
want to pick door No. 2?"
Is it to your advantage to switch your choice?
48
24
Permutations and
Combinations
Both are ways to count the possibilities
The difference between them is whether order
matters or not
Consider a poker hand:
A♦, 5♥, 7♣, 10♠, K♠
Is that the same hand as:
K♠, 10♠, 7♣, 5♥, A♦
Does the order the cards are handed out matter?
If yes, then we are dealing with permutations
If no, then we are dealing with combinations
49
Permutations
A permutation is an ordered arrangement of the
elements of some set S
Let S = {a, b, c}
c, b, a is a permutation of S
b, c, a is a different permutation of S
An r-permutation is an ordered arrangement of r
elements of the set
A♦, 5♥, 7♣, 10♠, K♠ is a 5-permutation of the set of
52 cards
The notation for the number of r-permutations:
P(n,r) or nPr
The poker hand is one of P(52,5) permutations
50
25
Permutations
Number of poker hands (5 cards):
P(52,5) = 52*51*50*49*48 = 311,875,200
Number of (initial) blackjack hands (2 cards):
P(52,2) = 52*51 = 2,652
r-permutation notation: P(n,r)
The poker hand is one of P(52,5) permutations
51
26
Combinations
Combinations example
27
Combination formula proof
28