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
STAB22 Statistics I Lecture 16 1 Probability Tree Describe events & probabilities at different stages Conditional Probabilities Simple Probabilities Joint Probabilities B P(BC|A) BC P(A ∩ BC) = P(A) × P(BC|A) B P(AC ∩ B) = P(AC) × P(B|AC) BC P(AC ∩ BC) = P(AC) × P(BC|AC) A P(A) P(B|AC) P(AC) P(A ∩ B) = P(A) × P(B|A) P(B|A) AC P(BC|AC) 2 Example (Monty Hall Problem) Contestant shown 3 doors: 1 contains a car other 2 contain goats Contestant picks a door Presenter must open a door containing a goat, Then offer contestant to Switch doors, or Stay with his original pick ( From TV show “Let’s Make a Deal” ) 3 Example (Monty Hall Problem) 4 Example Doctor prescribes screening test for Hepatitis B (HB), since it affects 2% of population What is prob. of having HB? P(HB) = However, the test is not perfectly accurate! If you have HB, test is positive (+) with P(+|HB) = 96% If you don’t (HBC), test is negative (−) with P(−|HBC) = 98% Actual Test’s Accuracy table: Prob Correct HB 96% HBC 98% Build a probability tree for the test 5 Accuracy table: Example Simple Probs Actual Condition HB HBC Conditional Probs Actual Prob Correct HB 96% HBC 98% Test Result Joint Probs + − + − Find prob. of testing positive: P(+) = Find prob. of having HB given that you tested positive: P(HB|+) = 6 Random Variables Consider experiment of rolling 2 dice How can you define event A? 1. Describe the event 2. 3. Event A A = “Sum of two rolls is 3” List outcomes in event A = {(1,2),(1,2)} Use a Random Variable Most common way to describe events! 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 Sample space (S) 7 Random Variables Random variable X assigns a single number to every outcome of an experiment Eg. Consider flipping 2 fair coins Random variable X = # of heads in 2 flips Sample space (S) H , H H ,T T , H T , T Values of random variable X X H ,H 2 X H ,T 1 X T , H 1 X T ,T 0 8 Random Variables In practice, Random Variables used to describe events and their probability Example: Rolling 2 fair dice Random Variable X = sum of 2 rolls List sample points of event (X=5) Find probability P(X=5) 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 Sample space 9 Types of Random Variables Discrete Can only take specific value, e.g. 0, 1, 2, ... Typically the result of counting something E.g. the number of children in a family Continuous Can take any value within an interval, e.g. all values in [0,1] Typically the result of some type of measurement E.g. the temperature tomorrow 10 Probability Model A table, graph, or formula that describes The values of a random variable The probability associated with each value Probability of X taking some specific value x is denoted by P(X=x) or just P(x) E.g. X = sum of 2 dice rolls → P(X=5) = P(5)= 4/36 For any probability model: 0 P ( X x) 1 & P ( X x) 1 all x 11 Example Flip 2 fair coins, X = # of heads Fill in the probability model Value x P(X=x) X H ,H 2 X H ,T 1 X T , H 1 X T ,T 0 Sample space Total 12 Example Flip 3 fair coins, X = # of heads Probability model → Find prob. of getting 2 or more heads Find prob. of getting at least 1 head Value x P(X=x) 0 1/8 1 3/8 2 3/8 3 1/8 Total 1 13 Expected Values Probability model of (discrete) Random Variable can be described numerically with: Mean or Expected Value: E X xP x all x 2 2 Variance: Var ( X ) x P x all x Standard Deviation: SD( ) Var ( X ) 14 Example Flip 2 fair coins, X = # of heads Find mean, variance, and standard deviation of X x P(x) 0 1/4 1 2/4 2 1/4 Total 1 x × P(x) (x − µ)² (x − µ)² × P(x) 15