Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
More of David Palay’s Slides Conditional Probability Given that you had a quiz on Tuesday, what is the Probability that you have homework tonight… Example: Suppose one employee is selected from a group of random employees. We’re interested if this employee has used the proper cover sheet for his TPS report (since there’s a new cover sheet and we’re not certain that this employee has read the memo). We could ask: • What is 𝑃(𝑖𝑚𝑝𝑟𝑜𝑝𝑒𝑟 𝑇𝑃𝑆) We could ALSO ask, • What is 𝑃(𝑖𝑚𝑝𝑟𝑜𝑝𝑒𝑟 𝑇𝑃𝑆 | 𝑚𝑎𝑙𝑒) 𝑃(𝑖𝑚𝑝𝑟𝑜𝑝𝑒𝑟 𝑇𝑃𝑆 | 𝑀𝑎𝑙𝑒) • This is the probability of the employee’s TPS report having the wrong coversheet, GIVEN that the employee is male. Conditional Probability • Written as 𝑃(𝐵|𝐴) • Read as Probability of event B, given event A has already happened. Our Company • There are 15 people in the small company. • 9 are male • 5 females filed improper TPS reports • 8 employees filed improper TPS reports. • From this, we can figure out the probability of having an improper TPS report given that the employee is male. Method 1 • Create a table: Male Female Proper TPS Improper TPS Total • Use table to calculate probability Total Example • When rolling 2d6, what is the probability that the sum is a 7, GIVEN THAT ONE OF THE DICE IS A 1. {1,1} {1,2} {1,3} {1,4} {1,5} {1,6} {2,1} {2,2} {2,3} {2,4} {2,5} {2,6} {3,1} {3,2} {3,3} {3,4} {3,5} {3,6} {4,1} {4,2} {4,3} {4,4} {4,5} {4,6} {5,1} {5,2} {5,3} {5,4} {5,5} {5,6} {6,1} {6,2} {6,3} {6,4} {6,5} {6,6} Method 2: Calculating 𝑃 𝐴∩𝐵 𝑃 𝐵𝐴 = 𝑃 𝐴 TPS Reports 𝑃 𝑀𝑎𝑙𝑒 ∩ 𝐼𝑚𝑝𝑟𝑜𝑝𝑒𝑟𝑇𝑃𝑆 𝑃 𝐼𝑚𝑝𝑟𝑜𝑝𝑒𝑟𝑇𝑃𝑆 𝑀𝑎𝑙𝑒) = 𝑃(𝑀𝑎𝑙𝑒) Dependent and Independent events • Dependent events – 2 events where the outcome of one is influenced by the outcome of the other. • Independent events – 2 events who’s outcomes are completely unchanged based on the outcomes of each other. Dependent and Independent events • If 𝑃 𝐴 𝐵 = 𝑃 𝐴 • Or if 𝑃 𝐵 𝐴 = 𝑃(𝐵) • Then the events are independent! Tossing two Coins • If A is getting heads on the first toss, and • If B is getting heads on the second toss, Are A and B dependent or independent? Tossing two Coins • Find 𝑃 𝐵 𝐴 • Find 𝑃 𝐵 Tossing two Coins • Event A: getting Heads on first toss • Event B: getting Heads on second toss • Find 𝑃 𝐵 𝐴 1 𝑃 𝐵∩𝐴 1 4 𝑃 𝐵𝐴 = = = 1 𝑃 𝐴 2 2 • Find 𝑃 𝐵 1 𝑃 𝐵 = 2 A useful result! • Take the mathematical equation of conditional probability: 𝑃 𝐴∩𝐵 𝑃 𝐵𝐴 = 𝑃 𝐴 Multiply both sides by 𝑃(𝐴) 𝑃 𝐴 𝑃 𝐵 𝐴 =𝑃 𝐴∩𝐵 We can calculate 𝑃(𝐴 ∩ 𝐵) with just 𝑃 𝐴 and 𝑃(𝐵|𝐴). This is the MULTIPLICATION RULE for intersections. Even more useful! • If we think about independent events for a minute, we can recall that for two events A and B that are independent: 𝑃 𝐵𝐴 =𝑃 𝐵 But that means… In our Multiplication Rule for Intersections 𝑃 𝐴 𝑃 𝐵 𝐴 =𝑃 𝐴∩𝐵 If we are looking at ONLY independent events where 𝑃 𝐵 𝐴 = 𝑃 𝐵 Then, the Multiplication Rule results in 𝑃 𝐴 ∩ 𝐵 = 𝑃 𝐴 ∗ 𝑃(𝐵) This works for the probability of more than 2 events! • If A, B, C, D, … are all INDEPENDENT events (coin flips, single die rolls, etc.), then 𝑃 𝐴 ∩ 𝐵 ∩ 𝐶 ∩ 𝐷 ∩. . = 𝑃 𝐴 𝑃 𝐵 𝑃 𝐶 𝑃 𝐷 . . Ok, take a second…. Breath… • We just covered a lot with very little explanation. So, we’re going to do some examples. Dependent vs. Independent Determine whether the events are independent or dependent 1) A: a coin comes up heads B: 1d6 comes up even 2) A: 1d6 is thrown and comes up even B: a second d6 is thrown and the sum of the two is greater than 4 3) A: An ace is drawn from a standard deck of cards B: A second ace is drawn from the same deck Uh-oh…. Wait a sec. A: An ace is drawn from a standard deck of cards B: A second ace is drawn from the same deck We can come up with two different answers. It depends on if we put the first card BACK or NOT! Replacement • We talked about it with combinations & permutations, and now we need to incorporate it into independent & dependent events. Replacement Namely, if we have replacement, does it make it dependent or independent? Take our deck of cards example. A: An ace is drawn from a standard deck of cards B: A second ace is drawn from the same deck Replacement If we put the first card back into the deck (and re-shuffle) then we have an independent event. The first card has no impact on what the second card could be. Replacement Alternatively, if we leave the first card out, then the probabilities for the second card have changed. One more thing • Find 𝑃 𝑔𝑒𝑡𝑡𝑖𝑛𝑔 ℎ𝑒𝑎𝑑𝑠 4 𝑡𝑖𝑚𝑒𝑠 𝑜𝑛 𝑎 𝑐𝑜𝑖𝑛 𝑓𝑙𝑖𝑝 • Find 𝑃 𝐻𝐻𝐻𝐻|𝐻𝐻𝐻