Logo
Pattern

Discover published sets by community

Explore tens of thousands of sets crafted by our community.

Bayes' Theorem Examples

12

Flashcards

0/12

Still learning
StarStarStarStar

A diagnostic machine classifies factory parts as either defective or non-defective. The machine has a 97% accuracy rate for detecting non-defective parts and a 95% accuracy rate for detecting defective parts. If 2% of all manufactured parts are defective, what is the probability that a part classified as defective is actually non-defective?

StarStarStarStar

The probability that a part is non-defective given it is classified as defective is:

P(Non-defectiveDefective)=P(DefectiveNon-defective)P(Non-defective)P(Defective)=0.030.980.950.02+0.030.98=0.6069. P(\text{Non-defective} | \text{Defective}) = \frac{P(\text{Defective} | \text{Non-defective}) \cdot P(\text{Non-defective})}{P(\text{Defective})} = \frac{0.03 \cdot 0.98}{0.95 \cdot 0.02 + 0.03 \cdot 0.98} = 0.6069.

StarStarStarStar

An online filter tries to detect offensive comments in a chat. It has a 90% success rate of flagging offensive comments and a 5% error rate of flagging non-offensive comments. If 20% of the comments are offensive, what is the probability that a comment is not offensive given that it has been flagged?

StarStarStarStar

The probability that a comment is not offensive given it's been flagged is:

P(Not OffensiveFlagged)=P(FlaggedNot Offensive)P(Not Offensive)P(Flagged)=0.050.800.900.20+0.050.80=0.040.22=0.1818. P(\text{Not Offensive} | \text{Flagged}) = \frac{P(\text{Flagged} | \text{Not Offensive}) \cdot P(\text{Not Offensive})}{P(\text{Flagged})} = \frac{0.05 \cdot 0.80}{0.90 \cdot 0.20 + 0.05 \cdot 0.80} = \frac{0.04}{0.22} = 0.1818.

StarStarStarStar

A deck of cards contains a mix of red and blue cards. 70% of the red cards are numbered, while only 30% of the blue cards are numbered. If you have an equal number of red and blue cards, what is the probability that a randomly drawn card is blue, given that it is numbered?

StarStarStarStar

The probability that a card is blue given that it is numbered is:

P(BlueNumbered)=P(NumberedBlue)P(Blue)P(Numbered)=0.300.500.700.50+0.300.50=0.150.35+0.15=0.150.50=0.30. P(\text{Blue} | \text{Numbered}) = \frac{P(\text{Numbered} | \text{Blue}) \cdot P(\text{Blue})}{P(\text{Numbered})} = \frac{0.30 \cdot 0.50}{0.70 \cdot 0.50 + 0.30 \cdot 0.50} = \frac{0.15}{0.35 + 0.15} = \frac{0.15}{0.50} = 0.30.

StarStarStarStar

You have two coins; one is a regular coin and the other is a fake coin with heads on both sides. You choose a coin at random and flip it, getting a head. What is the probability that you chose the regular coin?

StarStarStarStar

The probability of choosing the regular coin, given that you got heads, is:

P(RegularHeads)=P(HeadsRegular)P(Regular)P(Heads)=(1/2)(1/2)(1/2)(1/2)+(1)(1/2)=1/43/4=13. P(\text{Regular} | \text{Heads}) = \frac{P(\text{Heads} | \text{Regular}) \cdot P(\text{Regular})}{P(\text{Heads})} = \frac{(1/2) \cdot (1/2)}{(1/2) \cdot (1/2) + (1) \cdot (1/2)} = \frac{1/4}{3/4} = \frac{1}{3}.

StarStarStarStar

In a factory, two machines A and B manufacture bolts. Machine A makes 30% of the bolts, and of its bolts, 1% are defective. Machine B makes rest of the bolts, and of its bolts, 2% are defective. What is the probability that a bolt was made by Machine A given that it is defective?

StarStarStarStar

The probability that a defective bolt was made by Machine A is:

P(Machine ADefective)=P(DefectiveMachine A)P(Machine A)P(Defective)=0.010.300.010.30+0.020.70=0.0030.017=0.1765. P(\text{Machine A} | \text{Defective}) = \frac{P(\text{Defective} | \text{Machine A}) \cdot P(\text{Machine A})}{P(\text{Defective})} = \frac{0.01 \cdot 0.30}{0.01 \cdot 0.30 + 0.02 \cdot 0.70} = \frac{0.003}{0.017} = 0.1765.

StarStarStarStar

A medical test for a disease has a 99% accuracy rate for both positive and negative results. If 1% of the population actually has the disease, what is the probability that a person has the disease if they tested positive?

StarStarStarStar

The probability of having the disease given a positive test result is:

P(DiseasePositive)=P(PositiveDisease)P(Disease)P(PositiveDisease)P(Disease)+P(PositiveNo Disease)P(No Disease)=.99.01.99.01+.01.99=.0099.0198=.50. P(\text{Disease} | \text{Positive}) = \frac{P(\text{Positive} | \text{Disease}) \cdot P(\text{Disease})}{P(\text{Positive} | \text{Disease}) \cdot P(\text{Disease}) + P(\text{Positive} | \text{No Disease}) \cdot P(\text{No Disease})} = \frac{.99 \cdot .01}{.99 \cdot .01 + .01 \cdot .99} = \frac{.0099}{.0198} = .50.

StarStarStarStar

In a memory game, there are 8 pairs of cards face down, including 1 pair of ace cards. If you flip one card and it is an ace, what is the probability that by randomly flipping one more card, it will be the matching ace?

StarStarStarStar

The probability that the next card flipped is the matching ace is:

P(Matching Ace1st Ace)=P(1st Ace and Matching Ace)P(1st Ace)=1/151/16=1615×116=115. P(\text{Matching Ace} | \text{1st Ace}) = \frac{P(\text{1st Ace and Matching Ace})}{P(\text{1st Ace})} = \frac{1/15}{1/16} = \frac{16}{15} \times \frac{1}{16} = \frac{1}{15}.

StarStarStarStar

In a bag of 100 marbles, 60 are red and 40 are blue. You draw a marble and it turns out to be red. If you draw another marble without replacing the first, what is the probability that the second marble will also be red?

StarStarStarStar

The probability that the second marble is red given that the first is red is:

P(2nd Red1st Red)=P(1st Red and 2nd Red)P(1st Red)=59996010060100=5999=0.5959. P(\text{2nd Red} | \text{1st Red}) = \frac{P(\text{1st Red and 2nd Red})}{P(\text{1st Red})} = \frac{\frac{59}{99}\cdot \frac{60}{100}}{\frac{60}{100}} = \frac{59}{99} = 0.5959.

StarStarStarStar

A rare disease affects 1 in 10,000 people in a large population. A test for the disease is 99.5% accurate for detecting the disease (true positive rate) and is also 99.5% accurate for declaring a non-diseased individual free of the disease (true negative rate). What is the probability that an individual really has the disease given they have tested positive?

StarStarStarStar

The probability that an individual has the disease given a positive test result is:

P(DiseasePositive)=P(PositiveDisease)P(Disease)P(Positive)=0.9950.00010.9950.0001+0.0050.9999=0.00009950.005098505=0.0195. P(\text{Disease} | \text{Positive}) = \frac{P(\text{Positive} | \text{Disease}) \cdot P(\text{Disease})}{P(\text{Positive})} = \frac{0.995 \cdot 0.0001}{0.995 \cdot 0.0001 + 0.005 \cdot 0.9999} = \frac{0.0000995}{0.005098505} = 0.0195.

StarStarStarStar

A password system uses a series of three characters, each can be a lowercase letter or a digit. An attacker knows that the second character is a letter. What is the probability that the first character is a digit given that the attacker correctly guesses the password on the first try?

StarStarStarStar

The probability that the first character is a digit given a correct guess on the first try is:

P(DigitCorrect Guess)=P(Correct GuessDigit)P(Digit)P(Correct Guess)=1/(102636)10/361/(363636)=126. P(\text{Digit} | \text{Correct Guess}) = \frac{P(\text{Correct Guess} | \text{Digit}) \cdot P(\text{Digit})}{P(\text{Correct Guess})} = \frac{1/(10 \cdot 26 \cdot 36) \cdot 10/36}{1/(36 \cdot 36 \cdot 36)} = \frac{1}{26}.

StarStarStarStar

Suppose there are three equally likely diseases that could cause a particular symptom. Disease A has a 10% prevalence in the population, Disease B has a 20% prevalence, and Disease C has a 30% prevalence. If a test for the symptom has a 5% false positive rate, what is the probability that a random individual with positive test results actually has Disease A?

StarStarStarStar

The probability of having Disease A given a positive test result is:

P(Disease APositive)=P(PositiveDisease A)P(Disease A)P(Positive)=00.10P(PositiveDisease A)0.10+P(PositiveDisease B)0.20+P(PositiveDisease C)0.30+P(PositiveNo Disease)P(No Disease)=0. P(\text{Disease A} | \text{Positive}) = \frac{P(\text{Positive} | \text{Disease A}) \cdot P(\text{Disease A})}{P(\text{Positive})} = \frac{0 \cdot 0.10}{P(\text{Positive} | \text{Disease A}) \cdot 0.10 + P(\text{Positive} | \text{Disease B}) \cdot 0.20 + P(\text{Positive} | \text{Disease C}) \cdot 0.30 + P(\text{Positive} | \text{No Disease}) \cdot P(\text{No Disease})} = 0.
Since the test has a 5% false positive rate, the numerator is zero (no true positives for Diseases A, B, C).

StarStarStarStar

You receive an email and you want to know the probability that it's spam, given that it contains the word 'free'. Spam emails contain the word 'free' 80% of the time, and this word appears in 5% of all emails. Overall, 10% of all emails are spam. What is the probability that the email is spam?

StarStarStarStar

The probability that an email is spam given that it contains 'free' is:

P(Spam’free’)=P(’free’Spam)P(Spam)P(’free’)=0.800.100.800.10+0.050.90=0.080.125=0.64. P(\text{Spam} | \text{'free'}) = \frac{P(\text{'free'} | \text{Spam}) \cdot P(\text{Spam})}{P(\text{'free'})} = \frac{0.80 \cdot 0.10}{0.80 \cdot 0.10 + 0.05 \cdot 0.90} = \frac{0.08}{0.125} = 0.64.

Know
0
Still learning
Click to flip
Know
0
Logo

© Hypatia.Tech. 2024 All rights reserved.