Download Probability and the Binomial Distribution

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Statistics wikipedia , lookup

History of statistics wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
Probability and the Binomial Distribution Definition: A probability is the chance of some event, E, occurring in a specified manner. NOTATION: P{E} Note: A probability technically is between 0 and 1 (more on that later), but when we think of the “chance” of something happening, we often think in terms of a percent which is simply a probability converted to a percent. We can view probabilities from a Relative Frequency Interpretation P E
#waysEcanoccur
Example 3.2.5 Consider the experiment where a fair coin is tossed twice. Find P{HH}. Take notice that the event “HH” has some special properties associated with it that help us compute its probability. The individual outcomes of the coin flips all have equal probability. Also, the outcome of the first coin flip has no bearing on the outcome of the second coin flip (we’ll call this independence in just a minute…). Some formal definitions and rules are needed in order to compute probabilities in more general settings, but first let’s compute some just using instinct. #ofallpossibleoutcomes
Example 3.3.2 The following table summarizes the outcome of a study recording hair color and eye color for 1770 German men. For a randomly chosen male from this group, find A. P{Black Hair} B. P{Black or Red Hair} C. P{Black Hair or Blue Eyes} D. P{Red Hair and Brown Eyes} E. P{black haired man has blue eyes} = P{Blue Eyes given Black Hair} = P{Blue Eyes | Black Hair} Chapter3
Page2
DEFINITIONS We call the collection of all possible events a sample space and we denote the sample space by . Two events, E1 and E2 are disjoint (or mutually exclusive) if they cannot occur simultaneously The union of two events, E1 and E2 is the event that E1 or E2 or both occur NOTATION: E1  E2 E1 or E2 The intersection of two events, E1 and E2 is the event that E1 and E2 both occur NOTATION: E1  E2 E1 and E2 Two events, E1 and E2 are independent if knowledge that E1 occurred does not affect P{E2} and vice versa. Two events that are not independent are dependent. A conditional probability is the probability that one event occurs given that another event occurred. NOTATION: E1|E2 (reads “E 1 given E 2”) A common way to visualize how events interrelate in a sample space is through a Venn Diagram. We’ll use Venn Diagrams to picture several of the following probability rules. One can use any shape to represent an event. Probability Rules Rule 1 0 ≤ P{E} ≤ 1 Rule 2 If E1, E2, … , Ek are all the possible (disjoint) events, P{Ei} = 1 For the remainder of the probability rules, picture the size of the sample space to be “1” and the probability of an event to be the size of the event relative to the size of the sample space (so if event “A” has probability 0.25, then the shape in a Venn Diagram representing event “A” will occupy ¼ of the Venn Diagram). Chapter3
Page3
Rule 3 If Ec = {not E}, then P{Ec} = 1 – P{E} Rule 4 P{E1  E2} = P{E1} + P{E2} – P{E1  E2} Rule 5 If E1 and E2 are disjoint, then P{E1  E2} = P{E1} + P{E2} (special case of Rule 4) Rule 6 P{E1  E2} = P{E1|E2}P{E2} –OR– P E1|E2 
Rule 7 If E1 and E2 are independent, then P{E1  E2} = P{E1}P{E2} Fact: If P{E1  E2} = P{E1}P{E2}, then E1 and E2 are independent Chapter3
Page4
Tree Diagram A tree diagram is a useful tool for computing probabilities. Each branch in the tree diagram represents possible outcomes for a piece of an experiment. Chapter3
Page5
Example The ELISA (Enzyme‐Linked ImmunoSorbent Assay) is a common way to test for HIV infection. According to the CDC (the web page has since been unlinked) for the ELISA test, we have sensitivity = P{true positive} = P{test positive | you have the disease}  99.9% specificity = P{true negative} = P{testing negative | you don’t have the disease}  99.8% positive predictive value (PPV) = P{you have the disease|test positive} For a certain population, where 1/1000 are HIV positive, use a tree diagram to find: P{have HIV | test positive} and P{have HIV | test negative} Chapter3
Page6
As was mentioned before in class, a random variable is the measured outcome of some random process. When the random variable is quantitative, we can either have a discrete or a continuous random variable. When we have a discrete distribution of a random variable, we can list the probability associated with each possible outcome. From example 3.5.5, consider a certain population of the freshwater sculpin, Cottus rotheus. The distribution of the random variable Y = number of tail vertebrae is shown in the following table We’ve listed out the entire probability distribution – all the probabilities add up to one. We could graphically represent a discrete distribution with a frequency histogram. Construct a frequency histogram for the number of tail vertebrae in this population of sculpin. Chapter3
Page7
In the case where we have a continuous random variable, we want a different tool to represent this type of distribution. We call this representation of a continuous random variable’s distribution a density curve. Consider the distribution of blood glucose levels measured one hour after a subject (from a certain population of women) drinks 50mg of glucose dissolved in water. Example 3.4.1 depicts this distribution with binwidth set 10, 5 and “0”respectively Notice the probability density curve is like having a probability histogram where we’re squeezing the binwidth down to 0 (an infinite number of bins). Then, the way we get probabilities associated with continuous random variables is still an area, just like in the frequency histogram. But, we need area under a curve, so we need calculus. Integration from a to b of the function that results in the probability density curve will give us the probability of being between those two values under the specified distribution. Fortunately, a computer will be doing the integration for you in this class! More on that later… Now, think back to your math classes. Questions: What is the length of a single point? _____________________________________ What is the area of a line? ______________________________________________________ The following facts pertaining to probabilities associated with a continuous random variable are consequences of the fact that a line doesn’t have area: P{Y = a} = 0 = P{Y = b} (area of a line is zero) So, P{Y ≤ a} = P{Y < a} + P{Y = a} = P{Y < a} And, P{a ≤ Y ≤ b} = P{a < Y ≤ b} = P{a ≤ Y < b} = P{a < Y < b} Chapter3
Page8
Mean and Variance of a Discrete Random Variable The population mean of a discrete random variable, Y, is given by Y = yiP{Y = yi} The mean of a random variable, Y, is also known as the expected value of Y, denoted E[Y]. The population variance of a discrete random variable, Y, is given by Y2 = (yi ‐ Y)2P{Y = yi} One can show that Y2 = E[Y2] – (E[Y])2 = E[Y2] – (Y)2 Then, the population standard deviation is Y = σ2Y Example 3.5.5 For the number of tail vertebrae in the population of freshwater sculpin, Cottus rotheus, find Y and Y. Chapter3
Page9
Motivating the Binomial Distribution Let’s refresh our memory on computing probability with an example. Consider the experiment where we toss a fair coin 3 times. Find the probability distribution for flipping “heads” in this experiment. Now, think about finding probability distributions associated with flipping a fair coin say 6 times. And then consider the experiment where the coin is not fair. The calculations get unwieldy fast! We need a more convenient method… Chapter3
Page10
Definition: The independent trials model occurs when (i) n independent trials are studied (ii) each trial results in a single binary observation (iii) each trial’s success has (constant) probability: P{success} = p Notice that if P{success} = p, P{failure} = 1–p. Your text calls this the BInS (Binary / Indep. / n is fixed / Same p) setting, but is commonly referred to as a Binomial Experiment In a BInS setting, if we let Y = {# successes} then Y has a binomial distribution. NOTATION: Y ~ Bin(n,p). The binomial probability function is P{Y = j} = nCj p j (1 – p)n–j j = 0,1,…,n where nCj = n!
j! n‐j !
with j! = j(j‐1)(j‐2)…(2)(1) and define 0! = 1 Example Use the binomial probability function to find P{exactly 1 head} in the experiment where a fair coin is flipped 3 times. In R, the dbinom(j,n,p) and pbinom(J,n,p) functions will compute binomial probabilities. In the U.S., 15% of people have Rh negative blood. For a random sample of 50 people from the U.S., find: Probability that 8 will have Rh negative blood Probability less than 8 will have Rh negative blood Chapter3
Page11
Probability
Probability more than 5 but at most 12 will Distribution Plot
Binomial, n=50, p=0.15
have Rh negative blood (the picture of the 0.16
distribution might help us figure out how to 0.14
0.12
compute this….) 0.10
0.08
0.06
0.04
0.02
0.00
j (Number of Successes)
Binomial mean and variance If Y ~ Bin(n,p), the population mean and variance reduce to: µY = np and Y2 = np(1–p) Example Find the mean and standard deviation for the number of those in a sample of size 50 who have Rh negative blood. 0
Chapter3
2
4
6
8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50
Page12