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
PROBABILITY Experiments • An experiment leads to a single outcome which cannot be predicted with certainty. 1. Toss a coin head or tail 2. Roll a die 1, 2, 3, 4, 5, 6 3. Take medicine worse, same, better 4. Select a sample which members will be included. • Most basic outcome - sample point. • Set of all sample points - sample space. 1. Toss a coin Sample space = {h,t} 2. Roll a die Sample space = {1, 2, 3, 4, 5, 6} Venn diagrams are pictorial representations of sample spaces. 2 PROBABILITY 1. Probability of a sample point - number between 0 and 1 that measures the likelihood that the outcome will occur when the experiment is performed. (0=impossible, 1=certain). 2. Probabilities of all sample points must sum to 1. Long run relative frequency interpretation. e.g Coin tossing experiment EVENTS: • An event is a specific collection of sample points. • The probability of an event A is calculated by summing the probabilities of the sample points in the sample space for A. Steps for Calculating the Probabilities of Events 1. Define the experiment. 2. List the sample points. 3. Assign probabilities to the sample points. 4. Determine the collection of sample points contained in the event of interest. 5. Sum the sample point probabilities to get the event probability. Example: P(even number when roll a die)= 1/6+1/6+1/6=1/2 3 UNIONS & INTERSECTIONS. A compound event is a composition of two or more other events. The union of two events A and B is the event that occurs if either A or B or both occur, it consists of all sample points that belong to A or B or both (denoted by A∪B). The intersection of two events A and B is the event that occurs if both A and B occur, it consists of all sample points that belong to both A and B (denoted by A∩B). Example 3.6 Toss a die. A: {Even number}, B:{less than or equal to 3} (A∪B)={1,2,3,4,6} P(A∪B)=5/6 (A∩B)={2} P(A∩B)=1/6 Unions and intersections can be defined for more than 2 events. See example 3.7. 4 COMPLEMENTARY EVENTS The complement of event A (denoted by A’) - event that A does not occur. Figure 3.8 A’ A P(A)+P(A’)=1 hence P(A)=1-P(A’) Example 3.9 Toss two fair coins. Find P(A) when A:{at least one head} Sample space {HH, HT, TH, TT} all with equal probability A:{HH, HT, TH} P(A’)=P(TT)=0.25 P(A)=1-P(A’)=0.75 and A’:{TT} 5 THE ADDITIVE RULE AND MUTUALLY EXCLUSIVE EVENTS We can calculate P(A∪B) without knowing the probabilities associated with each sample point. A loaded die is tossed. Events are defined as A:{Even number}, B:{less than 3} Suppose we know P(A)=0.4, P(B)=0.2 and P(A∩B)=0.1 and we want to find P(A∪B). Figure 3.10 A A∩B B P(A∪B)=P(1)+P(2)+P(4)+P(6) P(A)=P(2)+P(4)+P(6)=0.4 P(B)=P(1)+P(2)=0.2 P(A∩B)=P(2)=0.1 Hence P(A∪B)=P(A)+P(B)-P(A∩B)=0.4+0.2-0.1=0.5 6 Additive rule of Probability P(A∪B)=P(A)+P(B)-P(A∩B) Special case. Events A and B are mutually exclusive if A∩B contains no sample points - they cannot both occur at the same time. Figure 3.11 A B If A and B are mutually exclusive - P(A∪B)=P(A)+P(B) 7 CONDITIONAL PROBABILITY A conditional probability takes additional information into account. Toss a fair die. A:{even number}, B:{less then or equal to 3} P(A)=0.5 Suppose that on a particular throw we know that B has occurred, what is the probability of A taking this info into account? Knowing B has occurred reduces the sample space from 6 sample points to 3 sample points. Conditional probability of each sample point in the reduced sample space is 1/3 i.e. P(1|B)=P(2|B)=P(3|B)=1/3 Hence P(A|B)=1/3 General formula 1/ 6 1 P ( A | B ) = = e.g. 1/ 2 3 P( A ∩ B) P ( A| B ) = P( B) 8 Example 3.13 To examine the relationship between exposure to benzene and cancer. Randomly select an adult male from the population. A=event the person regularly is exposed to benzene C=event the person develops cancer Suppose we know that P(A∩C)=.05, P(A∩C’)=.20, P(A’∩C)=.03, P(A’∩C’)=.72 Do these probabilities show a relationship between benzene exposure and cancer? Compare P(C|A) with P(C|A’) P (C| A) = P(C ∩ A) P( A) and P( A) = P( A ∩ C ) + P( A ∩ C ' ) Hence P(A)=.05+.20=.25 and P(C|A)=.05/.20=.20 Similarly P(A’)=.75 and P(C|A’)=.03/.75=.04 A Chemist is 5 times more likely to develop cancer than a nonChemist!!!!!! 9 THE MULTIPLICATIVE RULE AND INDEPENDENT EVENTS • The multiplicative rule is found by rearranging the formula for conditional probability P ( A ∩ B ) = P ( A| B ). P ( B ) = P ( B| A). P ( A) • Events A and B are independent if the occurrence of one does not alter the probability of the other i.e. P(A|B)=P(A) and P(B|A)=P(B) otherwise they are dependent events. Note: If A and B are mutually exclusive events then P(A|B)=0 hence A and B are dependent events. Example 3.16 3 out of 10 2nd Science students do not enter 3rd Science Randomly select 2 2nd Science students. What is the probability that both of the 2 students selected do not make it to 3rd Science? A:{1st selecteddoesn’t get through}, B:{2nd selected doesn’t get through} We want P(A∩B). P ( A ∩ B ) = P ( B| A). P ( A) P(A)=3/10 P(B|A)=2/9 Hence P(A∩B)=6/90=1/15 10 Example (3.18) Fair coin tossed twice A:{First toss is a head} B:{Second toss is a head} Sample space: {HH, HT, TH, TT} Each sample point has probability .25 P(B)=P(HH)+P(TH)=0.5 P(A)=P(HH)+P(HT)=0.5 P ( A ∩ B ) P ( HH ) 0.25 P ( B| A) = = = = 0.5 P ( A) P ( A) 0.5 Hence A and B are independent events because P(B)=P(B|A) This is what we would expect - the coin has no memory! 11 RANDOM VARIABLES Most of the events in chapter 3 were described in words. In real life we mostly deal with numerical data. A random variable (rv) is a variable that assumes numerical values associated with the random outcome of an experiment where one (and only one) numerical value is assigned to each sample point. Toss a red and a green die and note; • the sum of the two numbers • the larger of the two numbers Select an individual at random from some population and record; • blood pressure • height • blood cholesterol • age Put 10 electronic components on test and record; • time of first failure • time of fifth failure • number of failures in 24 hours 12 More than 1 rv can be associated with a single experiment. Example; Toss a coin 3 times x = number of heads y = throw on which first head occurs or 0 if no head. Sample point hhh hht Hth htt thh tht tth ttt x 3 2 2 1 2 1 1 0 y 1 1 1 1 2 2 3 0 x, y are 2 different rv's associated with the same chance experiment. x,y both take the values 0, 1, 2, 3 13 DISCRETE AND CONTINUOUS RANDOM VARIABLES Random variables are either discrete or continuous. A rv is discrete if its set of possible values is a collection of isolated points on the number line. It is continuous if its set of possible values is an entire interval on the number line. Discrete rv's almost always come from counting • number of fish caught in a day • number of defective items in a batch • number of patients who survive 5 years Continuous rv's come from measurement • Concentration of ester after 10 minutes when ethyl acetate is added to sodium hydroxide. • vapourisation temperature of a liquid • height of a tree • temperature at noon beside the lake in UCD 14 CONTINUOUS RANDOM VARIABLES PROBABILITY DISTRIBUTIONS FOR CONTINUOUS RANDOM VARIABLES A rv is continuous if its set of possible values is an entire interval on the number line. x is the time taken to run a particular distance, it is a continuous rv. • Time recorded to the nearest minute is discrete. • Time recorded to nearest second is discrete. • As the time is recorded to a greater degree of accuracy the probability histogram approaches a smooth curve. Area under curve = Probability Total area under curve = 1 15 A probability distribution for a continuous random variable x is specified by a mathematical function f(x) called a probability density function, a frequency function or a probability distribution. It is required that (1) f ( x) ≥ 0 (2) Total area under curve = 1 The probability that x takes a value in an interval is the area under the density curve above the interval. P(x = a) = 0 hence P(a < x < b) = P(a ≤ x ≤ b) The areas under most probability distributions are found using calculus or by numerical methods. For the most commonly used distributions these areas have been tabulated (see later). 16 THE NORMAL DISTRIBUTION The most important probability distribution for a continuous rv is the normal distribution which has a symmetric, bell shaped density curve. The density function for a Normal Random Variable with mean μ and standard-deviation σ is 1⎛ x−μ ⎞ 2 − ⎜ ⎟ 2⎝ σ ⎠ 1 e σ 2π μ = mean σ = std. deviation f ( x) = It is not one distribution but a family of distributions depending on the value of μ and σ. (x~N(μ,σ2)) 17 THE STANDARD NORMAL DISTRIBUTION Fig 5.7 The distribution of the Standard Normal RV z has μ=0 and σ=1 and can be used to calculate areas under any normal distribution (see later). z~N(0,1) Table 4 in the Cambridge Tables gives the cumulative areas under the z curve. This allows us to specify z → find area to the left of z. Table 5 gives percentiles of the Standard Normal distribution. And this allows us to specify an area → find z. (1) What value of z has an area to the left of 0.95? (2) What value of z has an area to the right of 0.025? (3) What value of z has an area to the right of 0.005? 18 PROBABILITIES FOR ANY NORMAL DISTRIBUTION Suppose x~N(μ,σ2) There are no tables for this distribution but if we let z= x−μ σ then z~N(0,1) and we can use the Standard Normal tables. (z is known as the standardised value of x) 19 Example 5.6 In a photochemical reaction A Æ C + 2D the quantum efficiency with 500nm light is x x~N(100,152) Find P(80<x<120) standardised lower limit 80 − 100 = −133 . 15 standardised upper limit 120 − 100 = 133 . 15 Thus P(80<x<120)=P(-1.33<z<1.33)=0.8164 Example 5.10 x=score on entrance exam ~N(550, 1002) Top 10% of candidates are successful. What score is required in order to be successful? Let x0 be the score such that if x>x0 implies success. P(x≤x0)=0.9 20 x 0 − 550 ⎞ ⎛ P ( x ≤ x 0 ) = P⎜ z ≤ ⎟ =.9 ⎝ 100 ⎠ . ) = 0.9 But P(z ≤ 128 x 0 − 550 = 128 . Hence 100 x 0 = 550 + 128 . (100) = 678