Probability (Equations) Flashcards
P(R u C)
= P(R) + P(C) - P(R n C)
= 8/30 + 9/30 - 2/30 = 1/2
P(A u B u C)
-> P(A) + P(B) + P(C)
- P(A n B) - P(A n C) - P(B n C)
+ P(A n B n C)
Probability that it is red considering it is circular
-> P(R|C)
P(R|C) -> P(R n C) / P(C) = 2/30 divided by 9/30 = 2/30 * 30/9 = 2/9
Rewrite P(A|B) = P(A n B) / P(B)
P(A n B) = P(A|B) * P(B)
P(B) = P(A n B) / P(A|B)
Probability of getting a king then a queen from a deck?
Multiplication Rule
P(K n Q) = P(K) * P(Q|K) = 0.6%
Independent
P(F,G) = P(F) * P(G)
P(A n B) = P(A) * P(B)
since they do not directly effect each other (like choosing a queen then a king would do from a pack of cards ; toothache and weather is another example).
Don’t use the answer from the equation as the answer. We use this equation to determine if it IS independent, since the equation would hold up correctly.
Bayes’ Theorem
If P(A) > 0 then:
P(B|A) = P(A/B) * P(B) / P(A)
Bayes’ Theorem Alternative
Rewritten as:
P(B|A) = P(A|B) * P(B) / P (A|B ) ×P (B ) + P (A|¬B ) ×P (¬B )
Denominator = P(A|B^2) + P(A|¬B^2)
B’s cancel out
P(A) + P(A) = P(A)
Random Variable
S = {car,train,dog,cat}
F(car) = 1, F(train) = 1, F(dog) = 2, F(cat) = 2
What is F=1?
The result from a random experiment.
S = {car,train,dog,cat}
F(car) = 1, F(train) = 1, F(dog) = 2, F(cat) = 2
(F = 1) denotes {s exists in S | F(s) = 1} = {car, train}
S = {1,2,3,4,5,6}^2 = for two dice rolls
What is the probability for a and b to equal 12?
P(ab) = 1/36 for every ab which exists in S
F(ab) = a + b
r = 12 (arbitrarily chosen)
P(F = r) = P(ab | F(a|b) = r)
P (F = 12) = P ({ab |F (ab) = 12}) = P (66) = 1/36
¬(F = r)
{s | F(s) != r}
Conditional Distribution
P(F|G) = P(F = r| G = s)
Using Multiplication Rule
P(F = r1,G = s1) = P(F = r1|G = s1)P(G=s1)
P(F = r2,G = s2) = P(F = r2|G = s2)P(G=s2)
Probability Inference
P(Q|E1 = e1,…,En = en)
Conditional all the way to n.
Way of saying conditional queries can be joint.
Probability Inference Example
P(Cavity|Toothache=1)
P(Cavity = 1|Toochache = 1)
P(Cavity = 0|Toochache = 1)
P(Cavity = 1|Toochache = 1) = P(Cavity = 1|Toochache = 1) / P(Toothache = 1) = 0.12/0.2
P(Cavity = 0|Toochache = 1) = P(Cavity = 0|Toochache = 1) / P(Toothache = 1) = 0.08 / 0.2
0.2 = normalization constant
(0,6,0.4)
Conditional Independence
G, F are conditionally independent if
P(G, F|H1,…,Hn) = P(G|H1,…,Hn) * P(F|H1,…,Hn)
Let’s say we have two independent variables, weather and dentistry variables.
P (Weather = sunny, Toothache = r1, Catch = r2, Cavity = r3)
= P (Weather = sunny)P (Toothache = r1,Catch = r2,Cavity = r3)
Normalisation
S’ is a subset of S
4 coins, 2 low value, 2 high.
What is P( 3 tails | at least one low value is tails) if they are all flipped once.
P of one low value = {HTHH, HTHT, HTTH, HTTT, THHH, THHT, THTH, THTT, TTHH, TTHT, TTTH, TTTT} = 12/16, assuming the first two were low value
P of 3 tails = S’ = {HTTT, THTT, TTHT, TTTH, TTTT} = 5/16
Normalisation = 3 tails / S’ = 5/16 / 12/16 = 5/12
Normalisation Rule = P( A | B ) = P(A) / P(B)
Is the event that at least three of the coins come up tails independent of the event that at least one of the low-value coins comes up tails?
Probability of 3 = S’ = 5/16
Probability of one LV = 12/16
Since S’ is a subset of LV, because LV contains all elements S’ has, then P(LV and S’) = P(S’) = 5/16, represented if they weren’t independent.
But S(LV and S’) = P(S’) * S(LV) if they were independent which is not 5/16.
P(a) expanded
P(A | B)P(B) + P(A | ¬B)P(¬B)