Stat151 Class1
Stat151 Class1
A=
2 3
A, sometimes written as A
C
, is called the complementary
event of A
Chance of = 1 chance of
P(
A) = 1 P(A) = 1
3
5
=
2
5
STAT 151 Class 1 Slide 13
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Joint probability - independent events - Drawing a blue in draw 1 and
a green in draw 2 (with replacement)
A and B are independent means the occurrence of one event does
not change the chance of the other
1
2
4
3
5
Draws
1 2
A = { in 1st draw}
B = { in 2nd draw}
P(A) =
3
5
; P(B) =
2
5
P(A and B) =
3
5
2
5
=
6
25
= P(A)P(B)
STAT 151 Class 1 Slide 14
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Joint probability and disjoint events
Two events A and B are disjoint or sometimes called mutually
exclusive if they cannot occur simultaneously: P(A and B)=0
Example
P( and in a single draw) = 0
STAT 151 Class 1 Slide 15
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Conditional probability
Conditional probability is a useful quantication of how the assessment of
chance changed due to new information: If A happened, what is the chance
of B?
The conditional probability of B given A is written as P(B|A)
Example Drawing marbles WITHOUT replacement
?
A = { in 1st draw}
B = { in 2nd draw}
P(B) =
2
5
P(B|A) =
2
4
2
5
2
4
because has been drawn
P(A and B) =
2
4
3
5
= P(B|A)P(A) =
6
20
= P(B)P(A)
;
STAT 151 Class 1 Slide 16
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Conditional probability and independence
The following relationships hold if A and B are independent
P(A|B) = P(A)
P(B|A) = P(B)
P(A and B) = P(A)P(B)
Independence is NOT the same as mutually exclusive (disjoint),
which is P(A and B) = 0.
STAT 151 Class 1 Slide 17
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
The multiplication rule
P(AB) = P(A|B)P(B) = P(B|A)P(A) Multiplication Rule
Example
Marbles in urn: 1 2 4 3 5
P( and Odd) = P( |Odd)P(Odd) =
1
3
3
5
=
1
5
= P(Odd| )P( ) =
1
2
2
5
=
1
5
Rearranging the multiplication rule:
P(A|B) =
P(AB)
P(B)
STAT 151 Class 1 Slide 18
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Partition rule
P( ) = P( and odd) +P( and even)
= P({ 1 5 }) +P({ 4 })
=
2
5
+
1
5
=
3
5
STAT 151 Class 1 Slide 19
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Union of events (1)
Union of events can sometimes be best
visualized using a Venn diagram (John
Venn, 1834-1923)
Example What is the probability of drawing
a or an odd number ?
1
2
4
3
5
Urn
Green
Odd
1
2
4
3
5
;
STAT 151 Class 1 Slide 20
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Union of events (2)
P( or odd) = P( ) +P(Odd) P( and odd)
=
2
5
+
3
5
1
5
=
4
5
In general, if A and B are:
disjoint, then P(A or B) = P(A) +P(B)
not disjoint, then P(A or B) = P(A) +P(B) P(AB)
STAT 151 Class 1 Slide 21
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Probability tree
Probability tree is useful for studying combination of events. Branches of a tree are
conditional probabilities.
Example
Drawing two marbles from urn without replacement:
Draw 1
Draw 2
P( ) =
3
5
2
4
2
4
= P( | )
P( ) =
3
5
2
4
2
4
= P( | )
3
5
Draw 2
P( ) =
2
5
3
4
3
4
= P( | )
P( ) =
2
5
1
4
1
4
= P( | )
2
5
STAT 151 Class 1 Slide 22
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Bayes Theorem (Thomas Bayes, 1701-1761)
Trees are useful for visualizing P(B|A) when B follows from A in a natural (time)
order. Many problems require P(A|B), Bayes Theorem provides an answer.
Example
Testing for an infectious disease.
Disease
Test
P(
D
T) =
99
100
9
10
T
9
10
= P(
T|
D)
P(
D T) =
99
100
1
10 T
1
10
= P(T|
D)
D
99
100
Test
P(D
T) =
1
100
1
10
T
1
10
= P(
T|D)
P(D T) =
1
100
9
10 T
9
10
= P(T|D)
D
1
100
What is P(D|T) or P(
D|
T)?
STAT 151 Class 1 Slide 23
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Bayes Theorem (2)
P(D|T) =
P(D T)
P(T)
=
P(T|D)P(D)
P(T)
=
P(T|D)P(D)
P(T D) +P(T
D)
Partition rule
=
P(T|D)P(D)
P(T|D)P(D) +P(T|
D)P(
D)
Multiplication rule
=
9
10
1
100
9
10
1
100
+
1
10
99
100
=
1
12
In general,
P(A|B) =
P(B|A)P(A)
P(B)
STAT 151 Class 1 Slide 24
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Data revisited- Discrete vs. Continuous Data
Discrete - countable number of possible values
Examples
(1) Coin Tossing: H H T H T T H T T T
Two possible values: H or T
(2) Financial crisis: 1982, 1984, 1987,... (No. of crises in a
decade)
Many possible values: 0, 1, 2, 3, 4,...
Continuous - values fall in an interval (a, b), a could be and
b could be
Example
Survival time in cancer patients: 0.67 0.01 0.48 1.06 0.85 0.45 ...
0 < survival time < a positive number
STAT 151 Class 1 Slide 25
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
First look - summary statistics
Nave methods
Numerical summary: Min, max, mean, variance, etc.
Graphical summary: Histogram, pie chart, bar graph, etc.
Tabular summary: Tables of frequencies
Attributes
Quick and dirty
Identify potential problems, errors
Flaws
Dicult to generalize especially when the dataset is
complicated
Not easily portable cannot describe a chart or graph unless
you can see it!
STAT 151 Class 1 Slide 26
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
What do we do about data?
Financial crises data
Mexican
82
S&L
84
Black Mon.
87
Comm. RE
91
Asian
97
LTCM
98
Dotcom
00
Subprime
07
Euro
12
?
We may be interested in X, the number of crises in the next decade. Possible questions:
What is the probability of X=0, or 1, or 2, or 3 or...?
Probability distribution - tells us the long run frequencies (chances) of the possible
outcomes
On average, how many crises in a decade?
Expectation (Expected value) - tells us the weighted average of the possible
outcomes, where the weights are the probabilities
How likely will X dier from the expected?
Standard deviation (Variance) - tells us the weighted average of deviations of the
possible outcomes from the expected value
STAT 151 Class 1 Slide 27
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Discrete distributions - Tossing a coin
(H) or (T) ?
Long run frequencies
H T
1
2
1
2
The long run frequencies are 1/2 each for
H and T there is equal chance for H or T
;
STAT 151 Class 1 Slide 28
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Discrete distributions - Drawing a marble
1
2
4
3
5
1 2 3 4 5 ?
1 2 3 4 5
1
5
1
5
1
5
1
5
1
5
3
5
2
5
;
The long run frequencies tell us there is equal chance for 1, 2, 3, 4
and 5 but there is a higher chance for blue than green
STAT 151 Class 1 Slide 29
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Discrete probability distributions
X H T
P(X)
1
2
1
2
X 1 2 3 4 5
P(X)
1
5
1
5
1
5
1
5
1
5
3
5
2
5
X
a
1
a
2
a
3
...
P(X) P(a
1
) P(a
2
) P(a
3
)
...
Probability distribution function
;
A probability distribution summarizes the long run frequencies (chances) of the
possible outcomes of X
STAT 151 Class 1 Slide 30
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Probability distribution for a discrete random variable
X is the unknown outcome.
X is called a discrete random variable if its value can only come from a countable
number of possible values: a
1
, a
2
, ..., a
k
.
Examples
Coin toss: X = H or T (2 possible values)
Marbles: X = 1, 2, 3, 4, or 5 (5 possible values)
Financial crisis: X = 0, 1, 2, 3,... (Innite but countable number of possible
values)
P(X = a
i
) gives the probability X = a
i
and is called a probability distribution
function.
A valid probability distribution function must satisfy the following rules:
P(X = a
i
) must be between 0 and 1
We are certain that one of the values will appear, therefore:
P(X = a
1
or X = a
2
or ...X = a
k
) = P(X = a
1
) +P(X = a
2
) +... +P(X = a
k
)
X=a
1
,X=a
2
,...are disjoint events
= 1
STAT 151 Class 1 Slide 31
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Example: Probability distribution of the number from drawing a marble
X 1 2 3 4 5
P(X) 0.2 0.2 0.2 0.2 0.2
P(X = 1) = 0.2
P(X 3) = P(X = 3) +P(X = 4) +P(X = 5) = 0.6
P(X = 1.5) = 0
P(X > 5) = 0
1 = P(X = 1)+P(X = 2)+P(X = 3)+P(X = 4)+P(X = 5)
STAT 151 Class 1 Slide 32
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Continuous random variable
The survival time (X) of a cancer patient following diagnosis may be
any value in a range (e.g. 0 < X < some positive number).
X is called a continuous random variable if its value fall in a range
(a, b) (, ). For a continuous random variable X, P(X = x) for
any value x is 0, we can only talk about the probability of X falling in
a range
Examples
P(X > 2 years) = Probability of surviving beyond 2 years
P(0 < X 1 year) = Probability of dying within 1 year
P(X 2 years|X > 1 year) = Probability of dying within 2
years given surviving for 1 year?
STAT 151 Class 1 Slide 33
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Probability distribution for a continuous random variable
A continuous random variable, X, is a random variable with outcome that falls
within a range or interval, (a, b)
Examples
X = survival time of a patient: (a, b) = [0, 150] years
X = return from an investment of 10000; (a, b) = [10000, ) dollars
X = per capita income; (a, b) = [0, 1000000000000] dollars
The probability distribution of X is dened by a (probability) density
function (PDF), f (x). The interpretation of f (x) is similar to probability but
there are subtle dierences:
f (x) 0 for any value of x in (a, b)
f (x) = P(X = x) = 0 for any value of x
P(r X s) = P(r < X < s)
since P(X=r )=P(X=s)=0
probability of X between r and s
P(a X b) = 1 since X must fall within (a, b)
The cumulative distribution function (CDF for short), written as F(x), is
dened as P(X x)
STAT 151 Class 1 Slide 34
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Example - survival data
Density of survival time
X (Time in years)
D
e
n
s
i
t
y
0 1 2 3 4 5
f(x) = 1.5e
1.5x
f (x) = e
x
, > 0 is called an
exponential density
Dierent values of can be used
to model dierent populations
All exponential densities have the
same shape but dierent gradients
so it is easy to describe to others
Allows us to make probability
statements about survival times we
have and have not observed
The area under f (x) is 1 which
means the probability of dying
between time 0 and is 1
STAT 151 Class 1 Slide 35
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Some calculations
X (Time in years)
D
e
n
s
i
t
y
0 1 2 3 4 5
f(x) = 1.5e
1.5x
P(X > 2)
P(X > 2) = 0.049 is the red area under the curve and can be
obtained by analytical or numerical (computer) analysis
STAT 151 Class 1 Slide 36
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Some calculations
X (Time in years)
D
e
n
s
i
t
y
0 1 2 3 4 5
f(x) = 1.5e
1.5x
P(X < 1)
P(X 1) = P(0 < X 1) = 0.776 is the red area under the curve
and can be obtained by analytical or numerical analysis.
STAT 151 Class 1 Slide 37
Introduction Randomness Probability Probability rules Probability distributions Discrete Continuous
Some calculations
P(X 2|X > 1) =
P(1 < X and X 2)
P(X > 1)
conditional probability
=
P(1 < X 2)
P(X > 1)
=
1 P(X 1) P(X > 2)
1 P(X 1)
=
1 0.776 0.049
1 0.776
= 0.781
STAT 151 Class 1 Slide 38