0% found this document useful (0 votes)
9 views

Probability

The document provides an overview of probability concepts, including methods of assigning probabilities, types of probability, and laws of probability such as addition and multiplication. It covers classical, relative frequency, and subjective probability, along with key terms like marginal, joint, and conditional probabilities. Additionally, it includes examples and applications of these concepts in problem-solving scenarios.

Uploaded by

varmakdc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

Probability

The document provides an overview of probability concepts, including methods of assigning probabilities, types of probability, and laws of probability such as addition and multiplication. It covers classical, relative frequency, and subjective probability, along with key terms like marginal, joint, and conditional probabilities. Additionally, it includes examples and applications of these concepts in problem-solving scenarios.

Uploaded by

varmakdc
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 58

Probability

Dhanya N.M.

Foundations of Data Science


Learning Objectives
• Comprehend the different ways of assigning
probability.
• Understand and apply marginal, union,
joint, and conditional probabilities.
• Select the appropriate law of probability to
use in solving problems.
• Solve problems using the laws of
probability including the laws of addition,
multiplication and conditional probability
• Revise probabilities using Bayes’ rule.
Foundations of Data Science
Methods of Assigning Probabilities

• Classical method of assigning probability


(rules and laws)
• Relative frequency of occurrence
(cumulated historical data)
• Subjective Probability (personal intuition or
reasoning)

Foundations of Data Science


Classical Probability

• Number of outcomes leading


to the event divided by the P( E )  ne
total number of outcomes N
possible Where:
• Each outcome is equally likely
N total number of outcomes
• Determined a priori -- before
performing the experiment ne  number of outcomes in E
• Applicable to games of chance
• Objective -- everyone correctly
using the method assigns an
identical probability

Foundations of Data Science


Relative Frequency Probability
• Based on historical
data
• Computed after P( E )  ne
performing the N
experiment Where:
• Number of times an N total number of trials
event occurred divided
by the number of trials n e
 number of outcomes
• Objective -- everyone producing E
correctly using the
method assigns an
identical probability

Foundations of Data Science


Subjective Probability
• Comes from a person’s intuition or
reasoning
• Subjective -- different individuals may
(correctly) assign different numeric
probabilities to the same event
• Degree of belief
• Useful for unique (single-trial) experiments
– New product introduction
– Initial public offering of common stock
– Site selection decisions
– Sporting events

Foundations of Data Science


Structure of Probability
• Experiment
• Event
• Elementary Events
• Sample Space
• Unions and Intersections
• Mutually Exclusive Events
• Independent Events
• Collectively Exhaustive Events
• Complementary Events
Foundations of Data Science
Experiment
• Experiment: a process that produces outcomes
– More than one possible outcome
– Only one outcome per trial
• Trial: one repetition of the process
• Elementary Event: cannot be decomposed or
broken down into other events
• Event: an outcome of an experiment
– may be an elementary event, or
– may be an aggregate of elementary events
– usually represented by an uppercase letter, e.g.,
A, E1
Foundations of Data Science
An Example Experiment
Experiment: randomly select, without
replacement, two families from the residents of
Tiny Town
 Elementary Event: the Tiny Town Population
sample includes families
Children in Number of
A and C Family
Household Automobiles
 Event: each family in
A Yes 3
the sample has children B Yes 2
in the household C No 1
 Event: the sample D Yes 2
families own a total of
four automobiles
Foundations of Data Science
Sample Space
• The set of all elementary events for an
experiment
• Methods for describing a sample space
– roster or listing
– tree diagram
– set builder notation
– Venn diagram

Foundations of Data Science


Sample Space: Roster Example
• Experiment: randomly select, without
replacement, two families from the residents of
Tiny Town
• Each ordered pair in the sample space is an
elementary event, for example -- (D,C)
Children in Number of Listing of Sample Space
Family
Household Automobiles
(A,B), (A,C), (A,D),
A Yes 3
(B,A), (B,C), (B,D),
B Yes 2
(C,A), (C,B), (C,D),
C No 1
(D,A), (D,B), (D,C)
D Yes 2

Foundations of Data Science


Sample Space: Tree Diagram for
Random Sample of Two Families
B
A C
D
A
B C
D
A
C B
D
A
D B
C
Foundations of Data Science
Sample Space: Set Notation for
Random Sample of Two Families

• S = {(x,y) | x is the family selected on the


first draw, and y is the family selected on
the second draw}
• Concise description of large sample spaces

Foundations of Data Science


Sample Space
• Useful for discussion of general principles
and concepts
Listing of Sample Space
Venn Diagram
(A,B), (A,C), (A,D),
(B,A), (B,C), (B,D),
(C,A), (C,B), (C,D),
(D,A), (D,B), (D,C)

Foundations of Data Science


Union of Sets
• The union of two sets contains an instance
of each element of the two sets.
X 1,4,7,9 X Y
Y  2,3,4,5,6
X  Y 1,2,3,4,5,6,7,9
C  IBM , DEC , Apple
F  Apple, Grape, Lime
C  F  IBM , DEC , Apple, Grape, Lime
Foundations of Data Science
Intersection of Sets
• The intersection of two sets contains only
those element common to the two sets.

X 1,4,7,9 Y
X
Y  2,3,4,5,6
X  Y  4

C  IBM , DEC , Apple


F  Apple, Grape, Lime
C  F  Apple
Foundations of Data Science
Mutually Exclusive Events
• Events with no
common outcomes
• Occurrence of one
event precludes the
occurrence of the X Y
other event

C  IBM , DEC , Apple X 1,7,9 P( X  Y ) 0


F  Grape, Lime Y  2,3,4,5,6
C  F   X  Y  
Foundations of Data Science
Independent Events
• Occurrence of one event does not affect the
occurrence or nonoccurrence of the other
event
• The conditional probability of X given Y is
equal to the marginal probability of X.
• The conditional probability of Y given X is
equal to the marginal probability of Y.
P( X | Y )  P( X ) and P(Y | X )  P(Y )

Foundations of Data Science


Collectively Exhaustive Events
• Contains all elementary events for an
experiment

E1 E2 E3

Sample Space with three


collectively exhaustive events
Foundations of Data Science
Complementary Events

• All elementary events not in the event ‘A’


are in its complementary event.

P( Sample Space ) 1
Sample
Space
A A P( A) 1  P( A)

Foundations of Data Science


Counting the Possibilities
• mn Rule
• Sampling from a Population with
Replacement
• Combinations: Sampling from a Population
without Replacement

Foundations of Data Science


mn Rule
• If an operation can be done m ways and a
second operation can be done n ways, then
there are mn ways for the two operations to
occur in order.
• A cafeteria offers 5 salads, 4 meats, 8
vegetables, 3 breads, 4 desserts, and 3
drinks. A meal is two servings of
vegetables, which may be identical, and one
serving each of the other items. How many
meals are available?
Foundations of Data Science
Sampling from a Population with
Replacement
• A tray contains 1,000 individual tax returns.
If 3 returns are randomly selected with
replacement from the tray, how many
possible samples are there?
• (N)n = (1,000)3 = 1,000,000,000

Foundations of Data Science


Combinations
• A tray contains 1,000 individual tax returns.
If 3 returns are randomly selected without
replacement from the tray, how many possible
samples are there?

N N! 1000!
   166,167,000
 n  n!( N  n)! 3!(1000  3)!

Foundations of Data Science


Four Types of Probability
• Marginal Probability
• Union Probability
• Joint Probability
• Conditional Probability

Foundations of Data Science


Four Types of Probability

Marginal Union Joint Conditional

P( X ) P( X  Y ) P( X  Y ) P( X | Y )
The probability The probability The probability The probability
of X occurring of X or Y of X and Y of X occurring
occurring occurring given that Y
has occurred

X X Y X Y
Y

Foundations of Data Science


General Law of Addition

P( X  Y )  P( X )  P(Y )  P( X  Y )

X Y

Foundations of Data Science


General Law of Addition -- Example

P( N  S )  P( N )  P( S )  P( N  S )

N S P ( N ) .70
P ( S ) .67
.56 P ( N  S ) .56
.70 .67
P ( N  S ) .70.67  .56
0.81

Foundations of Data Science


Office Design Problem
Probability Matrix

Increase
Storage Space
Yes No Total
Noise Yes .56 .14 .70
Reduction No .11 .19 .30
Total .67 .33 1.00

Foundations of Data Science


Office Design Problem
Probability Matrix
Increase
Storage Space
Yes No Total
Noise Yes .56 .14 .70
Reduction No .11 .19 .30
Total .67 .33 1.00

P( N  S )  P( N )  P( S )  P( N  S )
.70.67  .56
.81

Foundations of Data Science


Office Design Problem
Probability Matrix
Increase
Storage Space
Yes No Total
Noise Yes .56 .14 .70
Reduction No .11 .19 .30
Total .67 .33 1.00

P ( N  S ) .56.14 .11
.81

Foundations of Data Science


Venn Diagram of the X or Y
but not Both Case

X Y

Foundations of Data Science


The Neither/Nor Region

X Y

P ( X  Y ) 1  P ( X  Y )

Foundations of Data Science


The Neither/Nor Region

N S

P ( N  S ) 1  P ( N  S )
1 .81
.19
Foundations of Data Science
Special Law of Addition

If X and Y are mutually exclusive,


P( X  Y )  P( X )  P(Y )

Y
X

Foundations of Data Science


Demonstration Problem 4.3
Type of Gender
Position Male Female Total
Managerial 8 3 11
Professional 31 13 44
Technical 52 17 69
Clerical 9 22 31
Total 100 55 155

P(T  C )  P(T )  P(C )


69 31
 
155 155
.645
Foundations of Data Science
Demonstration Problem 4.3
Type of Gender
Position Male Female Total
Managerial 8 3 11
Professional 31 13 44
Technical 52 17 69
Clerical 9 22 31
Total 100 55 155

P( P  C )  P( P)  P(C )
44 31
 
155 155
.484
Foundations of Data Science
Law of Multiplication
Demonstration Problem 4.5

P( X  Y )  P( X ) P(Y | X )  P(Y ) P( X | Y )


80
P( M )  0. 5714
140
P( S| M ) 0. 20
P( M  S )  P( M ) P( S| M )
( 0. 5714 )( 0. 20 ) 0.1143

Foundations of Data Science


Law of Multiplication
Demonstration Problem 4.5
30
Probability Matrix P( S )  0.2143
140
of Employees
80
Married P( M )  0.5714
Supervisor Yes No Total
140
Yes .1143 .1000 .2143 P ( S | M ) 0.20
No .4571 .3286 .7857 P( M  S )  P( M ) P( S| M )
Total .5714 .4286 1.00 ( 0. 5714 )( 0. 20 ) 0.1143

P( M  S )  P( M )  P( M  S ) P( S ) 1  P( S )
0. 5714  0.1143 0. 4571 1  0. 2143 0. 7857
P( M  S )  P( S )  P( M  S ) P( M  S )  P( S )  P( M  S )
0. 2143  0.1143 0.1000 0. 7857  0. 4571 0. 3286
P( M ) 1  P( M )
1  0. 5714 0. 4286
Foundations of Data Science
Special Law of Multiplication
for Independent Events
• General Law
P( X  Y )  P( X ) P(Y | X )  P(Y ) P( X | Y )
• Special Law
If events X and Y are independent,
P( X )  P( X | Y ), and P(Y )  P(Y | X ).
Consequently,
P( X  Y )  P( X ) P(Y )
Foundations of Data Science
Law of Conditional Probability
• The conditional probability of X given Y is
the joint probability of X and Y divided by
the marginal probability of Y.

P( X  Y ) P(Y | X ) P( X )
P( X | Y )  
P(Y ) P(Y )

Foundations of Data Science


Law of Conditional Probability

P ( N ) .70
S N P ( N  S ) .56
P( N  S )
P( S | N ) 
.56 P( N )
.70
.56

.70
.80

Foundations of Data Science


Office Design Problem
Increase
Storage Space
Yes No Total
Noise Yes .56 .14 .70
Reduction No .11 .19 .30
Total .67 .33 1.00

Reduced Sample
Space for P ( N  S ) .11
P( N | S )  
“Increase P( S ) .67
Storage Space” .164
= “Yes”
Foundations of Data Science
Independent Events
• If X and Y are independent events, the
occurrence of Y does not affect the
probability of X occurring.
• If X and Y are independent events, the
occurrence of X does not affect the
probability of Y occurring.
If X and Y are independent events,
P( X | Y )  P( X ), and
P(Y | X )  P(Y ).
Foundations of Data Science
Independent Events
Demonstration Problem 4.10
Geographic Location
Northeast Southeast Midwest West
D E F G
Finance A .12 .05 .04 .07 .28

Manufacturing B .15 .03 .11 .06 .35

Communications C .14 .09 .06 .08 .37

.41 .17 .21 .21 1.00

P( A  G ) 0.07
P( A| G )   0.33 P( A) 0.28
P(G ) 0.21
P( A| G ) 0.33  P ( A) 0.28
Foundations of Data Science
Independent Events
Demonstration Problem 4.11

D E
A 8 12 20 8
P( A| D)  .2353
34
B 20 30 50
20
P( A)  .2353
C 6 9 15 85
P( A| D)  P( A) 0.2353
34 51 85

Foundations of Data Science


Revision of Probabilities: Bayes’ Rule

• An extension to the conditional law of


probabilities
• Enables revision of original probabilities
with new information

P(Y | Xi ) P( Xi )
P( Xi| Y ) 
P(Y | X 1) P( X 1)  P(Y | X 2 ) P( X 2 )  P(Y | Xn ) P( Xn )

Foundations of Data Science


Revision of Probabilities
with Bayes' Rule: Ribbon Problem
P( Alamo ) 0. 65
P( SouthJersey) 0. 35
P( d | Alamo ) 0. 08
P( d | SouthJersey) 0.12
P( d | Alamo ) P( Alamo )
P( Alamo| d ) 
P( d | Alamo ) P( Alamo )  P( d | SouthJersey) P( SouthJersey)
( 0. 08)( 0. 65)
 0. 553
( 0. 08)( 0. 65)  ( 0.12)( 0. 35)
P( d | SouthJersey) P( SouthJersey)
P( SouthJersey| d ) 
P( d | Alamo ) P( Alamo )  P( d | SouthJersey) P( SouthJersey)
( 0.12)( 0. 35)
 0. 447
( 0. 08)( 0. 65)  ( 0.12)( 0. 35)

Foundations of Data Science


Revision of Probabilities
with Bayes’ Rule: Ribbon Problem

Prior Conditional Joint Revised


Probability Probability Probability Probability

Event
P( Ei ) P(d| Ei ) P(Ei  d) P( Ei| d )
Alamo 0.65 0.08 0.052 0.052
0.094

=0.553

South Jersey 0.35 0.12 0.042 0.042


0.094
0.094
=0.447
Foundations of Data Science
Revision of Probabilities
with Bayes' Rule: Ribbon Problem
Defective
0.08 0.052
Alamo
0.65
Acceptable + 0.094
0.92
Defective 0.042
0.12
South
Jersey
0.35 Acceptable
0.88

Foundations of Data Science


Probability for a Sequence
of Independent Trials
• 25 percent of a bank’s customers are commercial
(C) and 75 percent are retail (R).
• Experiment: Record the category (C or R) for
each of the next three customers arriving at the
bank.
• Sequences with 1 commercial and 2 retail
customers.
– C1 R2 R3
– R1 C2 R3
– R1 R2 C3
Foundations of Data Science
Probability for a Sequence
of Independent Trials
• Probability of specific sequences containing
1 commercial and 2 retail customers,
assuming the events C and R are
independent
 1   3  3 9
P(C1  R 2  R 3)  P(C ) P( R) P( R)       
 4   4   4  64
 3  1   3 9
P( R1  C 2  R 3)  P( R) P(C ) P( R)       
 4   4   4  64
 3  3  1  9
P( R1  R 2  C 3)  P( R) P( R) P(C )       
 4   4   4  64
Foundations of Data Science
Probability for a Sequence
of Independent Trials
• Probability of observing a sequence
containing 1 commercial and 2 retail
customers, assuming the events C and R are
independent

P(C1  R 2  R 3)  ( R1  C 2  R 3)  ( R1  R 2  C 3)
 P(C1  R 2  R 3)  P( R1  C 2  R 3)  P( R1  R 2  C 3)
9 9 9 27
   
64 64 64 64

Foundations of Data Science


Probability for a Sequence
of Independent Trials
• Probability of a specific sequence with 1 commercial and 2
retail customers, assuming the events C and R are
independent 9
PC  R  R   P(C ) P( R) P( R) 
64
• Number of sequences containing 1 commercial and 2 retail
customers
 n n! 3!
nCr     3
 r  r !n  r ! 1!3  1!
• Probability of a sequence containing 1 commercial and 2
retail customers
9  27
3  
 64  64
Foundations of Data Science
Probability for a Sequence
of Dependent Trials
• Twenty percent of a batch of 40 tax returns
contain errors.
• Experiment: Randomly select 4 of the 40 tax
returns and record whether each return
contains an error (E) or not (N).
• Outcomes with exactly 2 erroneous tax returns
E 1 E2 N3 N4
E 1 N2 E3 N4
E 1 N2 N3 E4
N 1 E2 E3 N4
N 1 E2 N3 E4
N 1 N2 E3 E4
Foundations of Data Science
Probability for a Sequence
of Dependent Trials
• Probability of specific sequences containing 2
erroneous tax returns (three of the six
sequences)
P ( E 1  E 2  N 3  N 4)  P ( E 1) P ( E 2| E 1) P ( N 3| E 1  E 2) P ( N 4| E 1  E 2  N 3)
 8   7   32   31  55,552
         0.01
 50   49   48   47  5,527,200
P ( E 1  N 2  E 3  N 4)  P ( E 1) P ( N 2| E 1) P ( E 3| E 1  N 2) P ( N 4| E 1  N 2  E 3)
 8   32   7   31  55,552
         0.01
 50   49   48   47  5,527,200
P ( E 1  N 2  N 3  E 4)  P ( E 1) P ( N 2| E 1) P ( N 3| E 1  N 2) P ( E 4| E 1  N 2  N 3)
 8   32   31  7  55,552
         0.01
 50   49   48   47  5,527,200
Foundations of Data Science
Probability for a Sequence
of Independent Trials

• Probability of observing a sequence containing


exactly 2 erroneous tax returns
P(( E1  E 2  N 3  N 4 )  ( E1  N 2  E 3  N 4 )  ( E1  N 2  N 3  E 4 )
( N 1  E 2  E 3  N 4 )  ( N 1  E 2  N 3  E 4 )  ( N 1  N 2  E 3  E 4 ))
 P( E 1  E 2  N 3  N 4 )  P( E 1  N 2  E 3  N 4 )  P( E 1  N 2  N 3  E 4 )
 P( N 1  E 2  E 3  N 4 )  P( N 1  E 2  N 3  E 4 )  P( N 1  N 2  E 3  E 4 )
55, 552 55, 552 55, 552 55, 552 55, 552 55, 552
     
5, 527, 200 5, 527, 200 5, 527, 200 5, 527, 200 5, 527, 200 5, 527, 200
0. 06

Foundations of Data Science


Probability for a Sequence
of Dependent Trials
• Probability of a specific sequence with exactly 2 erroneous tax
returns
 8   7   32   31  55,552
P ( E 1  E 2  N 3  N 4 )       0.01
 50   49   48   47  5,527,200
• Number of sequences containing exactly 2 erroneous tax returns

 n n n! 4!
nCr   C   6
 r r
r !n  r ! 2 !4  2!
• Probability of a sequence containing exactly 2 erroneous tax
returns

 55,552 
6  0.06
 5,527,200 
Foundations of Data Science

You might also like