Contents


Other exercices

 
Combinatorics - Probability
bayes rule

Conditional probability

Bayes rule


Let's consider the following set of 7 books placed on the bookcase 1:
Bookcase1 = {Physics1, Physics2, Physics3, Math1, Math2, History, Geography},

And the set of 5 books placed on the bookcase 2:
Bookcase2 = {Physics1, Physics2, Physics3, Math1, Math2}

The bookcase1 contains 3 Physics books, 2 Math books,one History book, and one Geography book.

The bookcase2 contains 3 Physics books and 2 Math books.

By mistake, one book was taken from the bookcase1 and placed on the bookcase2.

Let's consider the following events that are mutually exlusive:
Event P1: "A Physics book was taken from the bookcase1"
Event M1: "A Math book was taken from the bookcase1"
Event H1: "A History book was taken from the bookcase1"
Event G1: "A Geography book was taken from the bookcase1"

And the events:
Event P2: "A Physics book is chosen from the bookcase2"
Event M2: "A Math book is chosen from the bookcase2"
Event H2: "A History book is chosen from the bookcase2"
Event G2: "A Geography book is chosen from the bookcase2"


Given the fact that the book chosen from the bookcase2 is of Physics (P2), what is the probability that the book taken by mistake from the bookcase1 was:
1. A Physics book (P1)?
2. A Math book (M1)?
3. A History book (H1)?
4. A Geography book (G1)?


1.
P(P1/P2) = P(P2/P1)P(P1) /ΣP(P2/X1)P(X1) [X = P, N, H, G]
= P(P2/P1)P(P1) / [P(P2/P1)P(P1) + P(P2/M1)P(M1) + P(P2/H1)P(H1) + P(P2/G1)P(G1)] =
(4/6) x (3/7) / [(4/6) x (3/7) + (3/6) x (2/7) + (3/6) x (1/7) + (3/6) x (1/7)] +
(2/7) / [(2/7) + (1/7) + (1/14) + (1/14)] = (2/7) / [(4/14) + (2/14) + (1/14) + (1/14)] =
(2/7) / (8/14) = (2/7) / [(4/7) = (2/7) / [(7/4) = 1/2 = 50%

2.
P(M1/P2) = P(P2/M1)P(M1) /ΣP(P2/X1)P(X1) [X = P, N, H, G]
= P(P2/M1)P(M1) / [P(P2/M1)P(M1) + P(P2/P1)P(P1) + P(P2/H1)P(H1) + P(P2/G1)P(G1)] =
(3/6) x (2/7) / [(3/6) x (2/7) + (4/6) x (3/7) + ( 3/6) x (1/7) + (3/6) x (1/7)) =
(2/14) /[(2/14) + (4/14) + (1/14) + (1/14)] = (2/14) /(8/14)= 1/4 = 25.0%

3.
P(H1/P2) = P(P2/H1)P(H1) /ΣP(P2/X1)P(X1) [X = P, N, H, G] =
= P(P2/H1)P(H1) / [P(P2/H1)P(H1) + P(P2/P1)P(P1) + P(P2/M1)P(M1) + P(P2/G1)P(G1)] =
(3/6) x (1/7) /[(3/6) x (1/7) + (4/6) x (3/7) + (3/6) x (2/7) + (3/6) x (1/7)] =
((1/14) /[(1/14)) + (4/14) + (2/14) + (1/14)] = ((1/14) /[(8/14)] =
((1/14) /[(8/14)] = 1/8 = 12.5%

4.
P(G1/P2) = P(P2/G1)P(G1) /ΣP(P2/X1)P(X1) [X = P, N, H, G] =
= 12.5% (as in 3.)

The sum of all this probabilities must give 1.
P(P1/P2) + P(M1/P2) + P(H1/P2) + P(G1/P2) = 50% + 25 % + 12.5% + 12.5% = 1

General case: Bayes theorem


When a set of events, such as P1, M1, H1, and G1 are mutually exlusive and exhaustive (P1 ∪ M1 ∪ H1 ∪ G1 = S = Sample space), they form partitions of S.
For a paticular event X, we have the rule of total probability:
P(X) = P(X/P1)P(P1) + P(X/M1)P(M1) + P(X/H1)P(H1) + P(X/G1)P(G1) = Σ (X/Si P(Xi)
Where Si is a partition of the sample space S.
For any event Si, the Bayes rule is written as:
P(Si/X) = P(X/Si) x P(Si)/[Σ P(X/Si) x P(Si)]

Bayes rule:

P(Si/X) = P(X|Si) x P(Si)/[Σ P(X|Si) x P(Si)]

X any event, and Si is a partition of the sample space S.



Si mutually exlusive: ∩Si = Φ
exhaustive: ∪ Si = Sample space
total probability rule: P(X) = Σ P(X|Si) P(Si)
Bayes rule:
P(Si|X) =P(X|Si) x P(Si)/[Σ P(X|Si) x P(Si)]

P(X) > 0




  
Today: :
____________

calculator for combinatorics probability and Statistics












© ScientificSentence - 2008 - All rights reserved.