Document

advertisement
Project 1 Lecture Notes
Table of Contents
•
•
•
•
•
•
•
Basic Probability
Word Processing Mathematics
Summation Notation
Expected Value
Database Functions and Filtering
Conditional Probability
Bayes’ Theorem
Basic Probability
 Sometimes outcomes are determined
by chance
 A collection of outcomes is called an
event
 The probability of an event, denoted
P(E), is the likelihood an event E will
occur
Basic Probability
 P(E) is always between 0 and 1
 This means there is between a 0%
chance and 100% chance an event E will
occur
Basic Probability
 Three ways to determine probability
 Empirically (through trials)
 Flip a coin a 100 times. How many times do you expect
to see heads? What about a 1000 flips?
 By Authority (an expert)
 Meteorologist says there’s a 30% chance of rain
 Common Agreement (universally accepted)
 Roll a dice. What are your chances of getting a six?
Basic Probability
 Empirically-based probabilities mean:
 The fraction of times an event E occurs
in a large number of trials will be very
close to P(E)
 Universally-based probabilities mean:
# of ways for E to occur
 P(E) =
Total # of possible outcomes
Basic Probability
 Properties of Probability
(i) 0≤P(E)≤ 1 for any event E
(ii) If E is guaranteed to occur, then P(E)=1
(iii) If E and F cannot happen at the same
time, then P(E or F) = P(E) + P(F)
Basic Probability
 Properties of Probability (cont)
 The collection of all possible outcomes in
an experiment is called the sample
space and is denoted by the letter S.
 So property (iii) is equivalent to P(S)=1
Basic Probability
 Venn diagrams:
E
F
EF
 The union of E andF, represented by E U F
is the collection of items that appear in E
or F or in both E and F.
Basic Probability
 Venn Diagrams
 An example:




Let
Let
Let
Let
S = {letters in alphabet}
V = {vowels}
C = {consonants}
F = {1st three letters in alphabet}
Basic Probability
 V U F = { a, b, c, e, i, o, u }
The set of
vowels
The set
of 1st
three
letters
Basic Probability
 Venn diagrams:
E
EF
F
 The intersection of E and F, represented
by E ∩ F is the collection of terms that
appear in both E and F.
Basic Probability
V∩F={a}
The set of
vowels
V∩F
The set
of 1st
three
letters
Basic Probability
 More Properties:
 The empty set, represented by { }, is the set
containing no items.
 If E ∩ F = { }, then there are no members that appear
in both E and F.
 We say that E and F are mutually exclusive events.
They cannot happen both at the same time.
Basic Probability
V∩C={}
The set of
vowels
The set
of 1st
three
letters
Basic Probability
 Properties
(iv) PE  F   PE   PF   PE  F 
and
PE  F   PE   PF   PE  F 
E
F
EF
EF
Basic Probability
 The last statement means property (iii) can
be rewritten as:
 If E and F are mutually exclusive, then P(EUF) =
P(E) + P(F)
 If E, F, G are pair-wise mutually exclusive,
then P(E U F U G) = P(E) + P(F) + P(G)
 For more events, the process is similar
Basic Probability
 More Properties:
 The complement of
an event E, written
as EC , is the set of
items NOT
contained in E.
 Notice in the last
Venn Diagram, C =
VC
 P(EC) = 1 – P(E)
Basic Probability
 DeMorgan’s Laws: E  F  E  F 
C
C
C
F
E
EC
FC
Basic Probability
 DeMorgan’s Laws: E  F  E  F 
C
C
C
So everything
minus the
intersection
F
E
EC
FC
Basic Probability
 DeMorgan’s Laws:
E F
C
C
E F
C
C
C


 EF
C


 EF
 This leads to two more properties:
C
C
C
(vi) PE  F   P E  F   1  PE  F 
C
C
C


(vii) PE  F   P E  F  1  PE  F 




Basic Probability
 Ex. Suppose we toss a fair coin 3 times.
The sample space is given by S = {HHH,
HHT, HTH, HTT, THH, THT, TTH, TTT}.
What is the probability of getting exactly 2
tails?
 Soln. We count all of the times when there
are exactly 2 tails: HTT, THT, TTH. Since
there are 8 possible outcomes, the answer
is 3/8.
Basic Probability
 Ex. Suppose the probability of owning
a house (H) is 47% while the
probability of owning a car (C) is 73%.
If the probability of owning a house
and a car is 28%, find the probability
of owning a house or a car.
Basic Probability
 Soln.
PH  C   PH   PC   PH  C 
 0.47  0.73  0.28
 0.92
Therefore, the probability of owning a
house or a car is 92%.
Basic Probability
 Ex. Suppose the probability of owning
a house (H) is 47% while the
probability of owning a car (C) is 73%.
If the probability of owning a house
and a car is 28%, find the probability
of not owning a house.
Basic Probability
• Soln.
 
P H C  1  P H 
 1  0.47
 0.53
Therefore, the probability of not
owning a house is 53%.
Basic Probability
 Ex. Suppose the probability of owning
a house (H) is 47% while the
probability of owning a car (C) is 73%.
If the probability of owning a house
and a car is 28%, find the probability
of neither owning a house nor owning
a car.
Basic Probability
 Soln. We want to find PH C  C C  ,
that is no house and no car.

P H C
C
C
  PH  C  
C
 1  P H  C 
 1  PH   PC   PH  C 
 1  0.47  0.73  0.28
 1  0.92
 0.08
Basic Probability
 Ex. Suppose the probability of owning
a house (H) is 47% while the
probability of owning a car (C) is 73%.
If the probability of owning a house
and a car is 28%, find the probability
of not owning a house and owning a
car.
Basic Probability
 Soln. We want to find PH C  C  , that
is no house and a car. When you want
to find “not A intersect B,” draw a Venn
diagram.
H
C


P H  C  PC   PH  C 
 0.73  0.28
 0.45
C
H C
H C
Basic Probability
 Correct & Incorrect notation:
Correct
Incorrect
EF  S
PE   PF   0.75
PE   PF   0.75
P E C  1  P E 
EC  1 E
 
 
PE
C
EF S
P E 
C
Basic Probability
 Focus on the Project:
 Define variables:
 S: successful loan work out
 F: failed loan work out
 Use Loan Records.xls and COUNTIF
function in Excel
Basic Probability
 Focus on the Project:


Range is the collection of cells from which you want to count
Criteria is the information you want to count
Basic Probability
 Focus on the Project:




Range: G11:G8236
Criteria: “yes”
Range: G11:G8236
Criteria: “no”
Basic Probability
 Focus on the Project:
 3818 successful work out situations
 4408 failed work out situations
 8226 total records
Basic Probability
 Focus on the Project:
P S  
3818
8226
 0.464
P F  
4408
8226
 0.536
Basic Probability
 Focus on the Project:
 These probabilities are generally true for
the typical borrower
 However, they do not account for the
specific characteristics of John Sanders
Download