Académique Documents
Professionnel Documents
Culture Documents
Lecture 5
Lecturer: Ali Ghodsi
Notes: Jim Dowling
October 18, 2007
P (A B),
P (A B)
P (A)
then do so,
P (B|A) =
If we don't have
P (A),
P (B) P (A|B)
P (A)
P (A) = P (B) P (A|B) + P B C P A|B C
P (T |A) = 0.8
P T |AC = 0.05
We are looking for the probability that a caller who tested positive on the
test will attempt suicide,
P (A|T ) =
P (A|T ),
which is:
P (A T )
P (A) P (T |A)
=
P (A)
P (A) P (T |A) + P (AC ) P (T |AC )
1
0.02 0.8
0.24
0.02 0.8 + 0.98 0.05
Aside
Looking for (seeking): When does the following hold true:
P (A|B) = P (B|A)
P (A) = P (B)
(A|B)
P (A|B) = P (B)P
, when P (A) = P (B), then
P (A)
the fraction P (A) in the numerator and P (B) in the denominator become 1,
P (A|B) = P (B|A).
Answer: When
Another Aside
For the
Ai = 1
Ai =
Ai =
i
The reason for these denitions is to
!
\
Ai =
i{1}
Ai
A1 = A1 = A1
Denition:
A1 , A2 , ..., An
!
P
Ai
iS
where
S 2{1,2,..,n} ,
P (Ai )
iS
and where
2.1
A, B are independent:
P (A B) = P (A) P (B)
A, C are independent:
P (A C) = P (A) P (C)
B, C are independent:
P (B C) = P (B) P (C)
A, B, C are independent:
If (A, B), (A, C), and (B,C) are independent, then we say that the events A, B,
not imply that all the events are independent. We demonstrate this now with
an example.
We have 2 independent toin cosses.
P (H1 ) =
both cosses produce a heads, then the two coin tosses will have dierent results
and
P (H1 H2 D) = 0
which is not the same as the product of the probabilities of the individual events:
1
1 1 1
=
2 2 2
8
1 1
1
=
2 2
4
1 1
1
=
2 2
4
1 1
1
=
2 2
4
Therefore, we can see that although the events are pairwise independent, the 3
events
(H1 , H2 , D)
Figure 1: Example of how Pairwise Independence does not imply full Independence.
2.2
A = {f irst roll 3}
B = {f irst roll {3, 4, 5}}
C = {sum is 9}
Firstly, the intersection of the three events is dened as:
P (A B C) =
where the outcome that intersects
A, B, C
1
36
is the roll
(3, 6).
P (A B C) =
A, B, C
, as :
1
1 1 1
1
= P (A) P (B) P (C) = =
36
2 2 9
36
However, although the 3 events are independent, the events are not pairwise
independent. We prove this by showing that the intersection of the events
and
and
B:
P (A B) = column 3 in diagram =
, but
P (A) .P (B) =
1 1
1
=
2 2
4
therefore,
P (A B) 6= P (A) P (B)
1
6
Figure 2: Serial and Parallel Set of Servers with known Failure Rates
2.3
Reliability Example
Independent components that have known failure rates can be put together to
form a serial system, see Figure 2 (a).
The system consisting of a NIS, DNS and NFS server only works when all
systems are working. The probability that the system consisting of a NIS, DNS
and NFS server is working is
3
Y
Pi
i=1
For the parallel system, if any of the components are working, the system is
working, see Figure 2 (b). The probability the parallel system is working is:
3
Y
(1 Pi )
i=1
Homework:
Birthday problem:
year. For a class, what is the probability that two pupils have the same birthday.
How many pupils do we need to have a probability greater than 50% that 2 or
more pupils have the same birthday.
Binomial Probability
independent trials.
an independent trial, where there are only two outcomes, then it is called a
Bernoulli Trial.
3.1
if
P ({success}) = p,
and
q =1p
successes in
stages is:
pk q nk
Looking for:
C=
, where
i! = 1x2x3
, and
0! = 1,
n
k
and
=
i
successes in
C=
n
k
stages, gives us
which is
n!
k!(n k)!
is non-negative.
choose
= comb(n, k) = n choose k
Aside:
n
X
n
pk (1 p)nk = norm 1
k
k=0
Replacement
, where k>n is allowed
n!
(nk)!
No Replacement
n+k1
n 1
, where k>n is allowed
n
k
=
n!
(nk)!k!
X
1
p=
2
k=0
n
k
1 k 1 nk X
=
2 2
k=0
1
2n
3.2
n
X
k=0
n
n
X
1
n
=1
= 2n
k
2
n
k
n
k
k=0
=1
P,
modems,
and
C > m.
customers.
modems than are available? This is a binomial probability problem. How many
stages is this Bernoulli trial?
Answer:
C
X
C
pi q Ci
i
i=m+1
Counting
objects, such that when an object is picked from the set, it is replaced, so
k th
objects from
stages, where
n n n n = nk
4.1
stage 1 has
...
stage
has
n1
options,
nk
options
n1 n2 ...nk
ni
k stages
as a
Permutations Example 1
If we pick a phone number with 5 digits, where each digit can be
In
this case, order of phone numbers matters, so 00001 is not the same as 10000,
and repetitions are allowed, so we can have 99999. The number of ways in which
you can construct these numbers is
105 .
Permutations Example 2
Unique number of 5 digits, with distinct digits.
10 9 8 7 6 =
4.2
10!
10 9 8 7 6 5 4 3 2 1
=
54321
(10 5)!
Combinations
n!
(nk)! . If we take
ways. For the rst digit in our
5!
arrangement, we have 5 choices, 4 choices for the 2nd digit, 3 choices for the 3rd
digit, 2 choices for the 4th digit, and one choice for the 5th digit. This gives us
the following:
n!
n!
(n k)!
n
=
=
k
k!
(n k)!k!
Combinations represent the
the rst 2 balls are red, the next 2 balls are green and the last 3 balls are
blue.
Here,
0
the rst 2 balls are red, and the last 5 balls are blue.
Here,
0
{P1 , ..., P9 }
Another way of looking at it is that we have a bag of 3 colors, we want to
pick 7 colors, there can be repetition and the ordering doesn't matter. This is
represented as, the
Example
4 colors (n
= 4)
n+k1
n1
= 3)
{P1 , P2 , P3 , P 4 , P5 , P 6 }
here k can be larger than n.
Identity
Relation
In a bag of n objects, how many ways can we partition the bag into two components, one containing
n
k
=
objects. The
n
nk
Multinomials/Partitions
nobjects into k
nk parts:
X
n =n
nk
n1 objects, n2 objects,
...,
(n over n1 ),
(n n1 over n2 )
!
n1
X
(n over n1 ) (n n1 over n2 ) (n n1 n2 over n3 ) n (
n ) over nk
If we have n objects, the rst set of
n1 objects
is selected using
i=1
n!
(n n1 )!
(n n1 n2 )!
n!
n!
=
Pn1
n1 ! (n n1 )! n2 ! (n n1 n2 )! n3 ! (n n1 n2 n3 )!
n
!...n
1
k!
nk ! n ( i=1 ni ) nk !
Multinomial rule:
5.1
n!
n1 !n2 !n3 ! nc !
How many ways can we partition the set of 11 positions into 4 partitions
containing 1, 4, 4, 2 elements for the letters M, I, S, P, respectively:
P1 P2 P3 .....P11
If we apply the multinomial rule, we get:
11!
1!4!4!2!
Homework
How can you dene combinations recursively, and what is its connection to
Pascal's triangle. Try to prove the recursion.
10