Chapter 2 Probability 21 P(A0 B)=P(A)P(B) If the two events are dependent,for example,the probability of the occurrence of event B depends on the occurrence of event A,then. P(B14)=P(4OB) P(4) and consequently the probability that both events occur is: P(40 B)=P(A)P(BM) An example of independent events:We throw a die two times.What is the probability of obtaining two sixes? We mark the first throw as event A and the second as event B.We look for the probability P(An B).The probability of each event is:P(A)='/6.and P(B)='/6.The events are independent which means: PAnB)=P4)PB)=(M6)(I6)=(/6). The probability that in two throws we get two sixes is(). An example of dependent events.From a deck of 52 playing cards we draw two cards.What Is the probability that both cards drawn are aces? The first draw is event A and the second is event B.Recall that in a deck there are four aces. The probability that both are aces is P(An B).The events are obviously dependent,namely drawing of the second card depends on which card has been drawn first. P(A=Ace)=(1s2)=(h3). n co5 crds re PAnB)=P4)PB4=(/s)(s)=(22) The probability of drawing two aces is(). Example:Ina pen there are 1 calves:2 black,3red and 5 spotted.They are let out one at ing tab order.The probabilities of the first calf being of a particular A P4) 2 black 41 P(black)=2/o 3 red A2 P(red)='/10 5 spotted P(spotted)=ho Here the probability P(A)is the relative number of animals of a particular color.We can see that: ∑,PA)=1
Chapter 2 Probability 21 P(A ∩ B) = P(A) P(B) If the two events are dependent, for example, the probability of the occurrence of event B depends on the occurrence of event A, then: ( ) ( ) ( ) | P A P A B P B A ∩ = and consequently the probability that both events occur is: P(A ∩ B) = P(A) P(B|A) An example of independent events: We throw a die two times. What is the probability of obtaining two sixes? We mark the first throw as event A and the second as event B. We look for the probability P(A ∩ B). The probability of each event is: P(A) = 1 /6, and P(B) = 1 /6. The events are independent which means: P(A ∩ B) = P(A) P(B) = (1 /6) (1 /6) = (1 /36). The probability that in two throws we get two sixes is (1 /36). An example of dependent events: From a deck of 52 playing cards we draw two cards. What is the probability that both cards drawn are aces? The first draw is event A and the second is event B. Recall that in a deck there are four aces. The probability that both are aces is P(A ∩ B). The events are obviously dependent, namely drawing of the second card depends on which card has been drawn first. P(A = Ace) = (4 /52) = (1 /13). P(B = Ace | A = Ace) = (3 /51), that is, if the first card was an ace, only 51 cards were left and only 3 aces. Thus, P(A ∩ B) = P(A) P(B|A) = (4 /52) (3 /51) = (1 /221). The probability of drawing two aces is (1 /221). Example: In a pen there are 10 calves: 2 black, 3 red and 5 spotted. They are let out one at the time in completely random order. The probabilities of the first calf being of a particular color are in the following table: Ai P(Ai) 2 black A1 P(black) = 2 /10 3 red A2 P(red) = 3 /10 5 spotted A3 P(spotted) = 5 /10 Here, the probability P(Ai) is the relative number of animals of a particular color. We can see that: Σi P(Ai) = 1
22 Biostatistics for Animal Science either black or red, alf is bla rst calf e)the first two calves are spotted and black,regardless of order Solutions a)There is a total .spotted.The number of favorableo comes are 5 and the totalmberothe probability that a calf is sp P(spotted)=5h='h k or red is an example of union P(red)= 10 710 Also,this the P(black red)=1-P(spotted)=1-= ple of conditional probab ity that the secon black if we know that the firs one was spotted is the er of black alves (2)divided by the number of calves remaining after removing a spotted one from the pen(9): P(black spotted)= d)This is an example of the probability of an inte n of events.The probabi ity that the first calf is spotte is P(spotted)=0.5.The probability that the second calf is black when the first was spotted is: P(black I spotted)= d and the second is black is the intersection P[spotted(black I spotted)]= Similarly,the probability that the first is black and the second is spotted is: P[blackn(spotted I black)]=(2/)()= lookin for a pair (black,)the eithe P([spottedn(black spotted)][blackn(spotted black)];=()+()= We can illustrate the previous examples using a tree diagram:
22 Biostatistics for Animal Science Find the following probabilities: a) the first calf is spotted, b) the first calf is either black or red, c) the second calf is black if the first was spotted, d) the first calf is spotted and the second black, e) the first two calves are spotted and black, regardless of order. Solutions: a) There is a total of 10 calves, and 5 are spotted. The number of favorable outcomes are m = 5 and the total number of outcomes is n = 10. Thus, the probability that a calf is spotted is: P(spotted) = 5 /10 = 1 /2 b) The probability that the first calf is either black or red is an example of union. P(black or red) = P(black) + P(red) = 2 /10 + 3 /10 = 5 /10 = ½. Also, this is equal to the probability that the first calf is not spotted, the complement of the event described in a): P(black ∪ red ) = 1 - P(spotted) = 1 - 1 /2 = 1 /2 c) This is an example of conditional probability. The probability that the second calf is black if we know that the first one was spotted is the number of black calves (2) divided by the number of calves remaining after removing a spotted one from the pen (9): P(black | spotted) = 2 /9 d) This is an example of the probability of an intersection of events. The probability that the first calf is spotted is P(spotted) = 0.5. The probability that the second calf is black when the first was spotted is: P(black | spotted) = 2 /9 The probability that the first calf is spotted and the second is black is the intersection: P[spotted ∩ (black | spotted)] = (5 /10) (2 /9) = 1 /9 e) We have already seen that the probability that the first calf is spotted and the second is black is: P[spotted ∩ (black | spotted)] = 1 /9. Similarly, the probability that the first is black and the second is spotted is: P[black ∩ (spotted | black)] = (2 /10) (5 /9) = 1 /9 Since we are looking for a pair (black, spotted) regardless of the order, then we have either (spotted, black) or (black, spotted) event. This is an example of union, so the probability is: P{[spotted ∩ (black | spotted)] ∪ [black ∩ (spotted | black)]} = (1 /9) + (1 /9) = 2 /9 We can illustrate the previous examples using a tree diagram:
Chapter 2 Probability 23 First calf Second calf 1 black(h)() 2 black(lo)≤ 3 red (ho)() 5 spotted (h)() 2 black (h)() -3 red (ho) 2 red ('ho)() 5 spotted (h)() 2 black2/o2/a) 5 spotted (h) 3 red (h)(l) 4 spotted (ho)() 2.4 Bayes Theorem Bayes theorem is useful for stating the probability of some event A if there is information about the probability of some event E that happened after the event A.Bayes theorem is applied to an experiment that occurs in two or more steps.Consider two cages Ki and K2,in the first cage there are three mice,two brown and one white,and in the second there are two brown and two white mice.Each brown mouse is designated with the letter B,and each white mouse with the letter W. gEw A cage is randomly chosen and then a mouse is randomly chosen from that cage.If the chosen mouse is brown,what is the probability that it is from the first cage? The first step of the experiment is choosing a cage.Since it is chose randomly,the t cage is P()=().The second step is choosing a mouse from the cage.The probability of choosing a brown mouse from th first Ccag℃1S P(BKi)=(),and of choosing a brown mous from the s econd cage is P(BK2)=().The lty that the cage is chosen if it is known that the mouse is brown is an example of conditional probability: P(KIB)=P(KB) P(B) The probability that the mouse is from the first cage and that it is brown is: P(K0B)=P(K)P(BIK)=()()=()
Chapter 2 Probability 23 First calf Second calf 1 black (2 /10) (1 /9) 2 black (2 /10) 3 red (2 /10) (3 /9) 5 spotted (2 /10) (5 /9) 2 black (3 /10) (2 /9) 3 red (3 /10) 2 red (3 /10) (2 /9) 5 spotted (3 /10) (5 /9) 2 black (5 /10) (2 /9) 5 spotted (5 /10) 3 red (5 /10) (3 /9) 4 spotted (5 /10) (4 /9) 2.4 Bayes Theorem Bayes theorem is useful for stating the probability of some event A if there is information about the probability of some event E that happened after the event A. Bayes theorem is applied to an experiment that occurs in two or more steps. Consider two cages K1 and K2, in the first cage there are three mice, two brown and one white, and in the second there are two brown and two white mice. Each brown mouse is designated with the letter B, and each white mouse with the letter W. Cage K1 Cage K2 B,B,W B,B,W,W A cage is randomly chosen and then a mouse is randomly chosen from that cage. If the chosen mouse is brown, what is the probability that it is from the first cage? The first step of the experiment is choosing a cage. Since it is chosen randomly, the probability of choosing the first cage is P(K1) = (1 /2). The second step is choosing a mouse from the cage. The probability of choosing a brown mouse from the first cage is P(B|K1) = (2 /3), and of choosing a brown mouse from the second cage is P(B|K2) = (2 /4). The probability that the first cage is chosen if it is known that the mouse is brown is an example of conditional probability: ( ) ( ) ( ) 1 P B P K B P K1 |B ∩ = The probability that the mouse is from the first cage and that it is brown is: P(K1 ∩ B) = P(K1) P(B | K1) = (1 /2) (2 /3) = (1 /3)
24 Biostatistics for Animal Science from the second cage and brown: P(B)=P(K)P(BIK)+P(K)P(BIK)=()()+()()=7h2 Those probabilities assigned to the proposed formula PKB)=()1()= Thus,the probability that a mouse is from the first cage if it is known that it is brown is(). This problem can be presented using Bayes theorem: P(KB)=P(KB)/P(B)=P(K)P(B1K)+P(K:)P(BIK:) P(,)P(BI,) Generally,there is an event A with k possible outcomes A,42.A.that are independent and the sum of their probabilities is 1,P()=1).Also,there is an event E,that occurs after event A.Then: P4IE)=P4AE)】 P(A)P(E4) P(E) P(A )P(EIA)+P()P(E)+.+P(A)P(EIA) To find a solution to some Bayes problems one can use tree diagram.The example with two cages and mice can be presented like this: 子 () () )) 份() From the diagra yread the of int thatthe nple,the pr obability is brown and f from the Another example:For artificial insemination ot e bulls is utilize ome large herd semen from two Bull 1 ha 0 of th that the of su nations for bull 1 and bull 2 are 65%and 82 For incalf the infor about its father has been lost.What is the that the father of that calf is bull 2?
24 Biostatistics for Animal Science The probability that the mouse is brown regardless from which cage it is chosen is P(B), which is the probability that the brown mouse is either from the first cage and brown, or from the second cage and brown: P(B) = P(K1) P(B | K1) + P(K2) P(B | K2) = (1 /2) (2 /3) + (1 /2) (2 /4) = 7 /12 Those probabilities assigned to the proposed formula: P(K1 | B) = (1 /3) / (7 /12) = 4 /7 Thus, the probability that a mouse is from the first cage if it is known that it is brown is (4 /7). This problem can be presented using Bayes theorem: ( ) ( | ) ( ) ( | ) ( ) ( | ) ( | ) ( ) ( ) 1 1 2 2 1 1 1 P K P B K P K P B K P K P B K P K B P K1 B / P B + = ∩ = Generally, there is an event A with k possible outcomes A1, A2,.,Ak, that are independent and the sum of their probabilities is 1, (Σi P(Ai) = 1). Also, there is an event E, that occurs after event A. Then: ( ) ( ) ( | ) ( ) ( | ) . ( ) ( | ) ( ) ( | ) ( ) ( | ) 1 1 2 2 k k i i i i P A P E A P A P E A P A P E A P A P E A P E P A E P A E + + + = ∩ = To find a solution to some Bayes problems one can use tree diagram. The example with two cages and mice can be presented like this: B K1 W B K2 W ( ) 2 ( ) 3 1 2 2 3 1 2 ( ) 1 ( ) 3 1 2 1 3 ( ) 2 ( ) 4 1 2 2 1 4 2 ( ) 2 ( ) 4 1 2 2 4 From the diagram we can easily read the probability of interest. For example, the probability that the mouse is brown and from the first cage is (1 /2) (2 /3) = (1 /3), and the probability that it is brown and from the second cage is (1 /2) (2 /4) = (1 /4). Another example: For artificial insemination of some large dairy herd semen from two bulls is utilized. Bull 1 has been used on 60% of the cows, and bull 2 on 40%. We know that the percentage of successful inseminations for bull 1 and bull 2 are 65% and 82%, respectively. For a certain calf the information about its father has been lost. What is the probability that the father of that calf is bull 2?
Chapter 2 Probability 25 We define P(A)=0.6 is the probability of having used bull P(A2)=0.4 is the probability of having used bull 2 E=the event that a calf is born (because of successful insemination) P(E)=0.65=the probability of successful insemination if bull P(E A2)=0.82=the probability of successful insemination if bull 2 P(4IE)=P(40E) P(AP(EA) .4.82) =0.457 P(E) PA)P(EA)+P(A)PEA)(.6(.6)+(4(82) Thus,the probability that the father of that calf is bull 2 is 0.457. Exercises 2.1.In a barn there are 9 cows.Their previous lactation milk records are Cow 1 2 3 4 5 6 7 8 9 Mik(kg)370042004500530054005700610062006900 If we randomly choose a cow wh 5000k 0 pro duced m produce U K
Chapter 2 Probability 25 We define: P(A1) = 0.6 is the probability of having used bull 1 P(A2) = 0.4 is the probability of having used bull 2 E = the event that a calf is born (because of successful insemination) P(E | A1) = 0.65 = the probability of successful insemination if bull 1 P(E | A2) = 0.82 = the probability of successful insemination if bull 2 ( ) = + ∩ ( ) ( | ) ( ) ( | ) ( ) ( | ) = ( ) ( | ) = 1 1 2 2 2 2 2 2 P A P E A P A P E A P A P E A P E P A E P A E 0.457 (.6)(.65) (.4)(.82) (.4)(.82) = + Thus, the probability that the father of that calf is bull 2 is 0.457. Exercises 2.1. In a barn there are 9 cows. Their previous lactation milk records are: Cow 1 2 3 4 5 6 7 8 9 Milk (kg) 3700 4200 4500 5300 5400 5700 6100 6200 6900 If we randomly choose a cow what is the probability: a) that it produced more than 5000 kg, b) that it produced less than 5000 kg? If we randomly choose two cows what is the probability: c) that both cows produced more than 5000 kg, d) that at least one cow produced more than 5000 kg, e) that one cow produced more than 4000 kg, and the other produced more than 5000 kg?