A farmer is testing a new piece of equipment he has for determining whether an animal is a cow or a sheep. If a cow walks through the machine, 90% of the time it says it is a cow and 10% of the time it says it is a sheep. If a sheep walks through the machine, 95% of the time it says it is a sheep and 5% of the time it says it is a cow. The farmer has 5 cows and 36 sheep. If an animal walks through and the machine claims it is a cow, the probability that it actually is a cow can be expressed as b a where a and b are coprime numbers. What is a + b ?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
This is a standard application of Bayes rule in conditional probability. Due to the low incidence of cows, the probability that the animal is indeed a cow is only approximately 7 0 % .
A real-world application of this problem, is the issue 'false positives paradox' in medical tests. If the incidence of a disease is extremely low, and we only have a probabilistic test, then there will be more of those who test positive but do not have the disease, than those who test positive and actually have the disease.
There are two ways for the machine to think that the animal is a cow: The animal is a cow and the machine is correct. This occurs with probability of 4 1 5 × 9 0 % The animal is a sheep and the machine is incorrect. This occurs with probability of 4 1 3 6 × 5 %
The above calculations sum together cover every case where the machine thinks that it is a cow. Clearly, we need the first one to be correct, so that part is the numerator.
Our computed probability is
4 1 5 × 9 0 % + 4 1 3 6 × 5 % 4 1 5 × 9 0 % = 7 5
Our answer is 5 + 7 = 1 2
total number of animals = 5(cows) + 36(sheep) =41
probability of machine claiming the animal to be cow = (5/41) (90/100) + (36/41) (5/100)
probability of it actually being cow = {(5/41) (90/100)} / {(5/41) *(90/100) + (36/41) (5/100)}
on simplifying it gives = 90/126 = 5/7
therefore answer = 12
There are two cases here. first is that a cow walks in and its condition is 5 and the machine predicts it correctly, Second case is that a sheep walks in and the machine predicts it wrong. The two cases constitute the universal set for this conditional case. The case favoring us is that a cow walks in and the machine predicts it correctly. so the probability is (5 0.9)/(5 0.9+36*0.05 ) = 45/63 =5/7 in the reduced form. so a=5 and b=7. a+b=5+7=12.
Probability of a cow =5/41
Probablity of a sheep=36/41
Probability of being a cow by machine is =(5/41)*9/10+x
x= =Probability of being not a sheep by machine that is actually a sheep=(36/41)*5/100
Therefore,Probability of being a cow by machine is =(5/41) 9/10+(36/41) 5/100
Probability that it is actually a cow =((5/41) (9/10))/((36/41) 5/100+(5/41)*9/10)
Hence answer =5/7 a=5 b=7 a+b=12
Let A be the event that a cow walks through the machine, A c be the event that a sheep walks through the machine, B be the event that the machine claims that an animal is a cow, and B c be the event that the machine claims that an animal is a sheep. The desired probability is P ( A ∣ B ) .
P ( A ∣ B ) = P ( B ) P ( A ∩ B )
P ( A ∣ B ) = P ( B ∣ A ) P ( A ) + P ( B ∣ A c ) P ( A c ) P ( B ∣ A ) P ( A )
P ( A ∣ B ) = 0 . 9 ⋅ 5 + 3 6 5 + 0 . 0 5 ⋅ 5 + 3 6 3 6 0 . 9 ⋅ 5 + 3 6 5
P ( A ∣ B ) = 7 5
Thus, a + b = 1 2 .
Solution 1:
The probability that a cow walks through the machine is 4 1 5 . So the probability that the machine says cow is 0 . 9 ⋅ 4 1 5 + 0 . 0 5 ⋅ 4 1 3 6 = 4 1 0 . 9 ( 5 ) + 0 . 0 5 ( 3 6 ) . The chance that a cow walks through the machine and the machine says cow is 0 . 9 ⋅ 4 1 5 , so the probability that it is actually a cow is 4 1 . 9 ( 5 ) + . 0 5 ( 3 6 ) 4 1 . 9 ( 5 ) = . 9 ( 5 ) + . 0 5 ( 3 6 ) . 9 ( 5 ) = 7 5 . So a + b = 5 + 7 = 1 2 .
Solution 2: This is a simple application of Bayes Rule. Let A be the event that a cow walks through the machine. Let B be the event that the machine claims the animal is a cow. P ( A ) = 4 1 5 and P ( B ) = 4 1 5 ⋅ 1 0 9 + 4 1 3 6 ⋅ 2 0 1 = 8 2 0 1 2 6 = 4 1 0 6 3 and P ( B ∣ A ) = 1 0 9 . So P ( A ∣ B ) = P ( B ) P ( B ∣ A ) P ( A ) = 1 0 9 ⋅ 4 1 5 ⋅ 6 3 4 1 0 = 6 3 4 5 = 7 5 . So a + b = 5 + 7 = 1 2 .
I drew a table comparing what the animals are and what the machine claims them to be. Since it claims it's a cow, we see that 1.8 sheep would be tested as a cow and 4.5 cows would be tested as a cow. Therefore, 4.5 / 1.8 + 4.5 = 5/7.
a/b=45/(45+18)=45/83=5/7..............a+b=12
Problem Loading...
Note Loading...
Set Loading...
We know the animal selected is actually a cow or a sheep. So, we split this into two cases. Case 1: It is actually a cow. There are 5 cows out of 41 animals, and a 90% chance that the cow will be tested positive as a cow, so the probability that a cow chosen and is tested positive is 4 1 5 ⋅ 0 . 9 = 4 1 4 . 5
Case 2: It is actually a sheep. There are 36 sheep out of 41 animals, and a 5% chance it gets tested positive as a cow, so this probability is 4 1 3 6 ⋅ 0 . 0 5 = 4 1 1 . 8
Thus, the probability it is actually a cow is 4 1 4 . 5 + 4 1 1 . 8 4 1 4 . 5 = 5 / 7 , so our answer is 5+7=12