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

Tutorial 2

Uploaded by

dannyyang2222
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Tutorial 2

Uploaded by

dannyyang2222
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

ELEC2600H Tutorial 2

Counting Method
Conditional Probability
Total Probability Theorem
Bayes’ Rule
Sequential Experiment
Computing Probability using Counting Methods
2

 If the outcomes of an experiment are equiprobable


number of outcomes in A
P[ A] =
number of outcomes in sample space

 P[A] is a measure of the size of the set A


 How to determine the size of A and the size of the sample space?
e.g. How many ways are there to put 3 coins in 4 pockets?
 Can more than one coins be put into one pockets?
 Will the order of the pockets being considered?
Computing Probability using Counting Methods
3
 With replacement with ordering
 With replacement With ordering
Select an object Note its ≠

Put it back
identity
1 2 ≠1 2
n objects

 e.g. a child has 3 coins and 4 labeled pockets, more than 1 coins
can be put in the same pockets. In how many ways can he put the
coins in his pockets?

1 2 3 4
 Choose k objects from a set A that has n members with
replacement with ordering number of outcomes = nk
Computing Probability using Counting Methods
4
 Without replacement with ordering
 Without replacement With ordering
Select an object Note its ≠
identity
1 2 ≠1 2
n objects

 e.g. a child has 3 coins and 4 labeled pockets, only1 coins can be
put in one pocket. In how many ways can he put the coins in his
pockets?

1 2 3 4
 Choose k objects from a set A that has n members without
replacement with ordering number of outcomes= n ( n − 1)( n − 2 )( n − k + 1)
k terms
Computing Probability using Counting Methods
5
 Without replacement without ordering
 Without replacement Without ordering
Select an object Note its =
identity
1 2 =1 2
n objects

 e.g. a child has 3 coins and 4 pockets, only1 coins can be put in
one pocket and the order of the pockets are not considered. In
how many ways can he put the coins in his pockets?

1 2 3 4
Computing Probability using Counting Methods
6

 Without replacement without ordering


 Without ordering: does not note the identity of the objects in an
ordered list.
 Choose k object from a set A that contains n objects without
replacement and without ordering
# of ways to choose k object from n
objects without replacement with
ordering
n ( n − 1)( n − 2 ) ( n − k + 1) n!
=
number of outcomes C = n

k ( k − 1)( k − 2 ) (2)(1) ( n − k )!k !


k

k terms in numerator and denominator


# of ways to arrange the selected k objects
Computing Probability using Counting Methods –
Example 1
7
Suppose a password has 6 characters: 3 letters (chosen from A – Z) followed
by 3 numbers (chosen from 0 – 9). What’s the probability that the password
contains no duplicated letters or numbers?
Solution
1. What’s the size of sample space?
a) How many ways are there to choose 3 letters from 26 letters?
b)How many ways are there to choose 3 numbers from 10 numbers?
c) Size of sample space is:
2. How many ways are there to choose 3 letters from 26 letters without
duplication?
3. How many ways are there to choose 3 numbers from 10 numbers without
duplication?
Computing Probability using Counting Methods –
Example 2
8
A store sells a batch of 60 iPods, 10 of which are defective. Suppose
that you purchase 2 iPods from this store for your FYP project. What
is the probability that:
(1) None of the iPods that you buy are defective.
(2) Only one of the iPods that you buy is defective.
(3) At least 1 of the iPods that you buy is defective.
Computing Probability using Counting Methods – Example 3

Played with pack of 52 cards with 4 suits


13 hearts ♥ : A 2 3 4 5 6 7 8 9 10 J Q K
13 diamonds ♦ : A 2 3 4 5 6 7 8 9 10 J Q K
13 clubs: ♣ : A 2 3 4 5 6 7 8 9 10 J Q K
13 spades: ♠ : A 2 3 4 5 6 7 8 9 10 J Q K

What is the
probability of
being dealt each
type of poker
hand?

9
Conditional Probability
10

 The conditional probability, P[A | B], of event A given that event B


has occurred, is defined as:

P[ A  B ]
P[ A | B ] =
P[B ]
where we assume that P[B] >0

 P[A] is a priori probability


 P[A|B] is a posteriori probability
 Indicates if the occurrence of B will increase the probability of the
occurrence of A or not
Properties of Conditional Probability
11
Conditional Probability – Example 1
12
A number x is selected at random in the interval [-2, 2]. Let A = {x < 0},
B = {|x – 0.5| < 0.5}, and C = {x > 0.75}. Find the conditional
probabilities:
(1) P[A | B]
(2) P[B | C]
(3) P[A | Cc]
(4) P[B | Cc]
Solution
Conditional Probability – Example 2
13
For each statement below, determine whether the statement is always
true.
(1)
(2)
(3)
(4)
Solution:
Total Probability Theorem
14

A = (1)  (2)  (n)


(1) = A  B1 (1)
 (3) (5) (7)
(2) (10)
( n ) = A  Bn (4) (6) (8)

(1), (2), … , (n) are


pair wise mutually
exclusive
Bayes’ Rule
15

B1 B3 B5 B9 S
B7
A
B2 B6 B8 B10
B4
Total Probability Theorem Example
16

A store sells a batch of 60 iPods, 10 of which are defective. Suppose


that you purchase 2 iPods from this store for your FYP project. Suppose
that if any of the iPods that you purchased were defective, then you
return them to the store to swap for new iPods (you can swap both, if
needed). Also suppose that you could only return to the store at most
once. (Assume no iPod is sold or swapped before you return to the store)
What is the probability that you end up with 2 non-defective iPods?
Total Probability Theorem & Bayes’ Rule
– Example
17
A man is worried that he might have a disease. He decides to get
tested. Suppose that the testing methods for this disease are known
to be accurate 99 percent of the time, regardless of whether the
results come back positive or negative. His test results come back
positive. If half of the population has it, what is the chance that he
actually has the disease? If, instead, the doctor tells him that the
disease is actually quite rare, occurring randomly in the general
population in only one of every 10,000 people, what is the chance
that he has the disease?
Independent
18
 P[AB] = P[A] x P[B] Two events A and B

P[ A  B] P[ A]P[ B] P[ A  B] P[ A]P[ B]
=
P[ A | B] = = P[ A] =
P[ B | A] = = P[ B]
P[ B] P[ B] P[ A] P[ A]

 P[A1A2] = P[A1]×P[A2]
P[A2A3] = P[A2]×P[A3] Events A1, A2 and
P[A1A3] = P[A1]×P[A3] A3 are independent
P[A1A2A3] = P[A1]×P[A2] ×P[A3]

Sequential Experiment
19
 Bernoulli Trials
 1 experiment 2 outcomes
 P[{outcome 1}] = p, P[{outcome 2}] = 1 – p
 Binomial Probability Law
n independent Bernoulli trials n k
pn (k ) =   p (1 − p )
 n−k

 k successes in n trials k 

 Geometric Probability Law


 M: number of trials until the first success
pM ( M =
m) = p (1 − p ) m −1
P[ A1c A2c ...... Amc −1 Am ] = m=
1, 2,....
 N : the number of trials before the first success
p( N =n) =P[ A1c A2c ...... Anc An +1 ] =
p(1 − p ) n n=
0,1, 2,....
Example 1 - Bean Machine Game
20
For a Galton board with seven rows of pins, what is the probability that
the ball will fall into the bin located second to the left?
Assumption 1: the ball bounces to each side with equal probability;
Assumption 2:the ball bounces to the left with probability 0.2, and to
the right with probability 0.8.
Solution: Bernoulli trail 1 Level 1
Bernoulli trail 2 Level 2
Bernoulli trail 3 Level 3
Bernoulli trail 4 Level 4
Bernoulli trail 5 Level 5
Bernoulli trail 6 Level 6
Bernoulli trail 7 Level 7

A B C D E F G H
Example 2
21

A student needs 10 chips of a certain type to build a circuit. It is


known that 5% of these chips are defective. How many chips should
he buy, so that, with greater than 90% probability, he will have enough
chips for the circuit to be built with no defects?
Geometric Probability Law Example
22

A type of missile has failure probability 0.02. Let N denote the number
of launches before the first failure. Find the probability of the first
failure occurred in the 21st launch.

You might also like