class: top, right, inverse, title-slide # STT 2820 Chapter 14 ### Alan T. Arnholt ### updated: 2019-10-07 --- class: inverse, center, middle # Diagrams --- National Pet Owners Survey 39% of US households own at least one dog and 34% of US households own at least one cat. Assume that 60% of US households own a dog or cat. **DRAW A PICTURE** a. What is the probability that a randomly selected household owns neither a dog nor a cat? -- 0.4 -- b. What is the probability that a randomly selected household owns both a dog and a cat? -- 0.13 -- c. What is the probability that a randomly selected household owns a cat if that household owns a dog? -- 1/3 --- class: inverse, center, middle # Tree --- A manufacturing firm orders computer chips from three companies. 10% from Company A, 20% from B and 70% from C. Some are defective. 4% of A's are defective; 2% of Bs are; and 0.5% of C's are. A worker discovers a randomly selected chip is defective. What is the probability it came from Company B? -- `$$\frac{0.20 \times 0.02}{0.10 \times 0.04 + 0.20 \times 0.02 + 0.70 \times 0.005} = 0.3478261$$` --- # Conditional Probability We often find probabilities of the form "given B, what is the probability of A?" These are called **conditional probabilities** and are written `\(P(A | B) = P(A \cap B)/P(B)\)`. If A and B are independent, `\(P(A | B)= P(A)\)`, `\(P(B | A)= P(B)\)` and the formula we used for independence follows...ie, `\(P(A \cap B) = P(A)\cdot P(B)\)`. -- ``` Searched Laptop Yes No Sum Yes 30 42 72 No 145 203 348 Sum 175 245 420 ``` -- Given this information, would you say being searched is independent of carrying a laptop? -- `\(P(\text{laptop} \cap \text{searched}) = \frac{30}{420} = \frac{1}{14}\)`...the question is does this equal `\(P(\text{laptop}) \times P(\text{searched}) = \frac{72}{420} \cdot \frac{175}{420} = \frac{1}{14} \Rightarrow\)` the events being searched and carrying a laptop are independent. --- class: inverse, center, middle # Bayes Rule --- Ovarian cancer affects only 1 of every 5000 women. A new test detects this cancer 99.97% of the time when it is present. Unfortunately, it also gives a false positive 5% of the time. What is the probability that a woman who tests positive actually has ovarian cancer? **DRAW A TREE** -- In general `\(P(A | B) = \dfrac{P(A \cap B)}{P(B)}=\dfrac{P(B | A)\cdot P(A)}{P(B | A) P(A) + P(B | A^c)P(A^c)}\)`. Sometimes `\(A^c\)` is composed of multiple events, all of which must be considered. -- `\(P(C|+) = \dfrac{P(C \cap +)}{P(+)}=\dfrac{P(+ | C)\cdot P(C)}{P(+ | C) P(C) + P(+ | C^c)P(C^c)}\)` Answer: `\(\frac{0.9997 \times 0.0002}{0.9997 \times 0.0002 + 0.05 \times 0.9998} = 0.0039837\)` --- class: inverse, center, middle # Sampling Without Replacement --- # Consider a deck of cards. a. What is the probability of getting two aces in the first two cards? -- `\(P(A_2 | A_1)\times P(A_1) = 3/51 \times 4/52 = 12/2652\)` -- b. What is the probability of getting five hearts in a row? -- `\(P(\text{five hearts in a row}) = 13/52 \times 12/51 \times 11/50 \times 10/49 \times 9/48 =\\ 4.9519808\times 10^{-4}\)`. --- class: inverse, center, middle # Football --- A particular football team is know to run 40% of its plays to the left and 60% to the right. When the play goes to the right, the right tackle shifts his stance 80% of the time, but does so only 10% of the time when the play goes to the left. As the team set up for the play the right tackle shifts his stance. What is the probability that the play will go to the right? **DRAW A TREE** -- `\(P(L) = 0.40, P(R) = 0.60, P(S|L) = 0.10, P(S^c|L) = 0.904\)` `\(P(S|R) = 0.80, P(S^c|R) = 0.20\)` `$$P(R|S) = \frac{P(R\cap S)}{P(S)} = \frac{P(S|R)P(R)}{P(S|L)P(L) + P(S|R)P(R)}\\ = \frac{0.80\times 0.60}{0.10 \times 0.40 + 0.80 \times 0.60} = \frac{12}{13}= 0.9230769$$` --- class: inverse, center, middle # Plumber --- Plumber Bob does 40% of the plumbing jobs in a small town. 30% of the people in town are unhappy with their plumbers but 50% of Bob's customers are unhappy with his work. If your neighbor is not happy with his plumber, what is the probability it was Bob? -- 2/3 --- class: inverse, center, middle # Coins --- How many times should a coin be tossed so that the probability of at least one head is at least 99%? -- Extra Credit....you tell me :)