1 / 50

Module 2: Probability

Module 2: Probability . Outline . basic probability definitions random variables probability distributions and densities expected values. Probability. When we perform experiments, there is a random component.

fontaine
Download Presentation

Module 2: Probability

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Module 2: Probability K. McAuley

  2. Outline • basic probability definitions • random variables • probability distributions and densities • expected values K. McAuley

  3. Probability • When we perform experiments, there is a random component. • Even if we are careful, different results will be obtained when we repeat an experiment. • We want to understand, quantify and model the types of variations that we encounter. K. McAuley

  4. Probability Definitions Experiment • situation leading to a value • could be an actual planned experiment, or any circumstance in which values are observed • e.g., gold recovery from an ore sample • e.g., atmospheric concentration of phenol • e.g., consumer preferences from a survey • an experiment has outcomes Sample Space • the set of all possible outcomes from an experiment • e.g,. {appealing, acceptable, unappealing} • e.g., a range of real numbers for temperature • Sample space is denoted by “S” K. McAuley

  5. Probability Definitions Events are collections of outcomes. • An event has occurred if at least one of the outcomes in the event has occurred. • A single outcome is also an event • e.g., E = {chip is defective} • e.g., E = {car finish is metallic, car finish is matte} • We can talk about the intersection and union of events • e.g., if E1={car is red, car is green, car is blue} and E2={car is not red}, then what is the intersection of E1 and E2? E1E2 = ? K. McAuley

  6. Visualizing Events We can use Venn diagrams to visualize events: S Sample space E2 E1 E1  E2 K. McAuley

  7. Set Operations • union • union of two events is the total set of outcomes occurring in either event • intersection • intersection of two events is the set of outcomes that occur in both events • complement • the complement of an event E is the set of events in the sample space that are not in E What does E1  E2 look like on the Venn diagram? What about the complement of E1  E2 ? K. McAuley

  8. Mutually Exclusive Events Two events are mutually exclusive if they can’t occur together K. McAuley

  9. Examples • Temperature in a reactor • sample space (-273.15 C, ) • event E1 - temperature below 350 °C, E1 = {T350} • event E2 - temperature above 300 °C, E2 = {T>300} • E1E2 = ? • E1E2 = ? • Reactor temperature is a continuous random variable K. McAuley

  10. Examples • defects in samples of 5 chips from a chip foundry • sample space = { nnnnn, dnnnn, ndnnn, nndnn, nnndn, nnnnd, ddnnn, nddnn,… ddddd} • event E1, one of the first two chips in the sample is defective and the rest are not, E1 = ? • event E2 - at most one chip is defective, E2 = ? • event E3, no defective chips, E3 = ? • E1E2 = ? • E3 E1 = ? • Chip quality is a discrete random variable. K. McAuley

  11. Probability Definitions Probability • indicates relative frequency, or likelihood, of a certain event occurring Axioms of Probability • required for consistency • P(S) = 1 • if E1 and E2 are mutually exclusive, P(E1 E2) = P(E1) + P(E2) K. McAuley

  12. Additional Probability Facts • Probability of nothing happening • Probability of an event NOT happening • where the prime denotes “complement” K. McAuley

  13. Additional Probability Facts Probability of a union of events Why do we subtract this? What happens to this term if events are mutually exclusive? K. McAuley

  14. How can we determine probabilities? • By examining the sample space and counting • Determine the frequency of different outcomes using some assumptions • e.g., probability of rolling two sixes in a row is 1/36. • Use permutations and combinations • physical observation • e.g., temperatures appear to occur in a pattern that follows a normal probability distribution K. McAuley

  15. Probability functions for discrete random variables Equally Likely Outcomes If we have N equally likely outcomes, then If we have an event consisting of several equally likely outcomes, i.e., E={outcome1, outcome2, outcome3} then K. McAuley

  16. Probability functions for discrete random variables More generally, if we have an event consisting of equally likely individual outcomes, then where n(E) is the number of outcomes in E, and n(S) is the number of outcomes in the sample space S. K. McAuley

  17. Multiplication Rule Assume we have two operations that are independent.If the first operation can be performed n1 ways, and the second operation can be performed n2 ways, then both operations together can be performed n1*n2 ways. e.g., number of ways to select a woman with a white shirt and a man with a black shirt from the class. K. McAuley

  18. Additional Counting Rules • Permutations • selecting r objects from a total of n when order is important • Combinations • choosing r objects from a total of n when order is not important Why? Why? K. McAuley

  19. Probability and Inter-relationships • Conditional Probability • Independence • Bayes’ Theorem K. McAuley

  20. Conditional Probability What is the likelihood of an event E1 occurring, given that event E2 has occurred? Let’s talk about what this notation means Let’s look at a Venn diagram to figure out what is happening “given” K. McAuley

  21. Conditional Probability What is the likelihood of an event E1 occurring, given that event E2 has occurred? K. McAuley

  22. Example Galvanneal Line for coating steel with zinc has two quality tests: thickness and tape peel test Quality outcomes with probabilities - • O1: thickness off-spec, fails tape test -- 0.04 • O2: thickness acceptable, fails tape test -- 0.1 • O3: thickness off-spec, passes tape test -- 0.03 • O4: thickness acceptable, passes tape test -- 0.83 Events - • E1 = {fails tape test} • P(E1) = P(O1) + P(O2) = 0.14 • E2 = {fails thickness test} • P(E2) = P(O1) + P(O3) = 0.07 K. McAuley

  23. Example Conditional Probability • What is the probability that given the zinc thickness is off-spec, the coil fails the tape test? K. McAuley

  24. Independent Events Two events are independent if • intuitive interpretation • likelihood of one event occurring is not influenced by whether the other event has occurred • likelihood of both events occurring together is simply the product of the likelihood of each one occurring K. McAuley

  25. Bayes’ Theorem • suppose we have two events A and B but What is it good for? K. McAuley

  26. Bayes’ Theorem - Example Drug Testing at the Olympics - Reliability of analytical procedure • T -- positive test reading, D -- drug user • probability of true positive is 0.99 (correctly detects usage when individual is a drug user) -- P(T|D)=0.99 • probability of true negative is 0.94 (correctly detects non-usage when individual is not a drug user) -- P(T’|D’)=0.94 • suppose that 5% of population are drug users -- P(D) = 0.05 • if a positive reading is obtained, what is the probability that the individual is in fact a drug user? -- P(D|T) K. McAuley

  27. Bayes’ Theorem - Example • From Bayes’ Theorem • P(T|D) = 0.99, P(T’|D’)=0.95, P(D)=0.05 • We can calculate probabilities of complement events • P(D’)=1-P(D)=1-0.05 = 0.95 • P(T|D’)=1-P(T’|D’)=1-0.94 = 0.06 We still need P(T). How can we get it? K. McAuley

  28. Bayes’ Theorem - Example • putting it all together, • with a positive detection rate of 99%, and a false positive rate of 6%, there is a 46% chance that an individual is a drug user given a positive reading, when 5% of the population are drug users K. McAuley

  29. Bayes’ Theorem • When we have some event B, and a range of mutually exclusive events E1, …, En that cover the sample space K. McAuley

  30. Random Variables and Probability Distributions K. McAuley

  31. Random Variable What is a random variable? • When experiments lead to categorical results, we assign numbers to the random variable: • e.g., defective = 0, functional = 1 Why do we assign numbers? • to help us to express probabilities and outcomes using mathematical expressions K. McAuley

  32. Types of Random Variables Discrete Random Variables • take on integer values or other discrete sets of values Continuous Random Variables • take on values from a portion of the real line K. McAuley

  33. Random Variables - Notation Random variable denoted by capital X Particular values obtained from an experiment are denoted by lower-case x K. McAuley

  34. Discrete Random Variables • Notation for probability functions • Example - sampling one chip from a batch of 30, when 10 are defective. • defective = 0, functional = 1 K. McAuley

  35. Cumulative Distribution Function We can also use Cumulative Distribution Functions • FX is the probability that we obtain an outcome less than or equal to a given number K. McAuley

  36. Probability Function - Example Galvanneal Line example revisited • discrete random variable - attach score (number) to reflect outcomes x=0, 1, 2 -- “acceptability score” • O1: thickness off-spec, fails tape test x = 0 • O2: thickness acceptable, fails tape test x = 1 • O3: thickness off-spec, passes tape test x = 1 • O4: thickness acceptable, passes tape test x = 2 • interpretation - score reflects severity of situation in descending order Probability Function P(X=0) = 0.04, P(X=1) = 0.13, P(X=2) = 0.83 K. McAuley

  37. Expected Value • What is the value of the random variable expected on average? • Let’s figure out the expected value of the outcome for testing of a sample from the Galvaneal line. • Maybe it will help to consider what would happen if we tested 1000 random samples K. McAuley

  38. Expected Value The expected value of a discrete random variable X is defined as The expected value is given the symbol : • is called the MEAN of the random variable X. What is the expected number of buttons if we selected someone randomly from the class? K. McAuley

  39. Example - Mean for Galvanneal Line • Using the probability function, What is E(X) when we are rolling a die? K. McAuley

  40. Expected Values In general, if we have any function of a random variable, we can find the expected value of that function: • What is E(X3) when we roll a die? K. McAuley

  41. Variance What is the expected squared deviation from the mean? • The sample variance s2 which is a statistic used to estimate the true variance 2 • What is 2 when we roll a die? • What is 2 for the number of buttons? K. McAuley

  42. Standard Deviation … is the square root of the variance The mean, variance and standard deviation are parameters summarizing a probability distribution for a random variable. K. McAuley

  43. Linearity of Expectation The Expected Value operation is LINEAR: • Additivity E(X+Y) = E(X) + E(Y) 2) Scaling E(kX) = k E(X) where k is a constant e.g., E(7X+6) = 7E(X) + 6 = 7X + 6 K. McAuley

  44. Probability Distributions for Discrete R.V.’s • We can determine probability functions by counting • Some common situations result in • Binomial Distribution • Poisson Distribution K. McAuley

  45. Binomial Distribution Suppose we are conducting a number of independent trials, each with only one of two possible values • Each trial is called a Bernoulli trial • Outcomes -- 0, 1 -- True/False -- Success/Fail -- ... • For each trial, P(1) = p, and P(0) = 1-p • If we have n trials, what is the probability that we obtain x successes (outcomes of 1)? Let’s figure it out using an example. K. McAuley

  46. Binomial Distribution Putting it all together, the probability of having x successes in n independent trials is: Binomial Probability Distribution Function K. McAuley

  47. Binomial Distribution Mean Variance How could we prove this? K. McAuley

  48. Using the Binomial Distribution Sampling with Replacement - Example - On the microwave module line of a telecommunications equipment maker, the probability of a defective module is 0.21. From each batch, one module is selected and tested, and then returned to the batch. This procedure is repeated 5 times, so that we have 5 independent tests for defects. What is the probability of having : a) 1 defect in the five tests? b) 3 defects in the five tests? Why is it important that the module be returned? Would anyone really do this? K. McAuley

  49. Binomial Example a) n = 5 (independent trials), x = 1 (“success” = defect identified) b) n = 5, x = 3 K. McAuley

  50. Binomial Example Why is it necessary to return the module to the batch before the next sample? • preserve independence • if module not returned, chance of getting a defective module changes. • Binomial distribution is appropriate in sampling situations when there is “sampling with replacement” • for sampling without replacement, we need to use the Hypergeometric distribution • if the batch size is large, relative to the number of tests in the sample, binomial provides reasonable approximation • e.g., sampling 10 items from a population of 10000 K. McAuley

More Related