banner



How To Use Bayes Theorem To Analyze Data

Bayer's Theorem Examples with Solutions

\( \) \( \) \( \) \( \)

Bayes' theorem to find provisional porbabilities is explained and used to solve examples including detailed explanations. Diagrams are used to requite a visual caption to the theorem. Also the numerical results obtained are discussed in club to sympathize the possible applications of the theorem.

Bayes' theorem

From law of total probability diagram of the law of totatl probability Pin it! Share on Facebook

\( P(A) = \sum_{i=one}^{n} P(A | E_i) P(E_i) \)

The definition of

conditional probability is used to write

\( \) \( \)\( \)\( \) \( P(A) P(E_i | A) = P(E_i) P(A | E_i) \)
which gives \( \) \( \)\( \)\( \)
\( P(E_i | A) = \dfrac{P(E_i) P(A | E_i)}{P(A)} \)

Substitute \( P(A) \) by the in a higher place sum to write Bayes' theorem as follows

\[ P(E_i | A) = \dfrac{P(E_i) P(A | E_i)}{\sum_{i=1}^{northward} P(A | E_i) P(E_i)} \]

Use of Bayes' Thereom Examples with Detailed Solutions

Example i below is designed to explain the utilize of Bayes' theorem and also to interpret the results given by the theorem.
Case i
One of ii boxes contains 4 blood-red balls and 2 green balls and the second box contains 4 green and two cherry-red balls. By design, the probabilities of selecting box 1 or box 2 at random are 1/3 for box 1 and two/3 for box two.
A box is selected at random and a ball is selected at random from it.
a) Given that the ball selected is red, what is the probability it was selected from the offset box?
b) Given that the ball selected is ruddy, what is the probability information technology was selected from the second box?
c) Compare the results in parts a) and b) and explain the respond.

Solution to Case one

Let us call the starting time box B1 and the second box B2
Permit event E1 be "select box 1" and upshot E2 "select box 2".
Let event R exist "select a red ball".
All the higher up data is included in the diagram below.

diagram for Bayes' theorem in example 1 Pin it! Share on Facebook
The probabilities of selecting i of the 2 boxes would are given (above) past
\( P(E_1) = 1/3\) and \( P(E_2) = 2/3 \)
The conditional probability that a selected ball is cherry given that it is selected from box i is given by
\( P(R | E_1) = 4/6 = 2/3\) , 4 balls out of 6 are crimson in box 1
The conditional probability that a selected ball is scarlet given that it is selected from box 2 is given by
\( P(R | E_2) = ii/six = 1/three\) , 2 assurance out of 6 are red in box 2
a)
The question is to find the conditional probability that the ball is selected from box one given that it is red, is given past Bayes' theorem.
\( P(E_1|R) = \dfrac{P(R | E1) P(E1) }{ P(R | E1) P(E1) + P(R | E2) P(E2) } \)

\( = \dfrac{ 2/three * i/3}{two/3 * one/three + 1/three * 2/three} = one/two \)
b)
The question is to find the conditional probability that the ball is selected from box ii given that it is ruby-red, is given by Bayes' theorem.
\( P(E_2|R) = \dfrac{P(R | E2) P(E2) }{ P(R | E1) P(E1) + P(R | E2) P(E2) } \)

\( = \dfrac{ 1/3 * two/3}{2/3 * 1/3 + 1/3 * 2/3} = one/2 \)
c)
The 2 probabilities calculated in parts a) and b) are equal.
Although in that location are more red balls in box 1 than in box 2 (twice equally much), the probabilities calculated above are equal considering the probabilities of selecting box two is higher (twice equally much) than the probability of selecting box 1. Bayes' theorem takes all the data into consideration.

Example 2
1% of a population have a sure disease and the remaining 99% are gratuitous from this disease. A test is used to detect this affliction. This test is positive in 95% of the people with the illness and is also (falsely) positive in 2% of the people gratuitous from the illness.
If a person, selected at random from this population, has tested positive, what is the probability that she/he has the illness?

Solution to Example 2

Let D be the event "have the disease" and FD be the event "costless from the disease"
Let the result TP exist the event that the "test is positive".
A diagram with all the above information is shown beneath.

diagram for Bayes' theorem in example 2 Pin it! Share on Facebook
The probability that a person has the affliction given that information technology has tested positive is given by Bayes' theorem:
\( P(D | TP) = \dfrac{P(TP | D) P(D) }{ P(TP | D) P(D) + P(TP | ND) P(ND) } \)

\( \quad \quad \quad = \dfrac{95\% ane\%}{95\% one\% + ii\% 99\% } = 0.32\)

Although a person tests positive, the probability of having the affliction is quite low.
Explanation
Annotation that even when a person tests positive that does not mean that she/he has the disease; and that is considering the number of affliction complimentary (99%) is much higher that those who have the disease (1%).
Let us clarify the results obtained above using some physical numbers.
Suppose that chiliad people are tested
disease Free are: \( 99\% \times 1000 = 990\) and    \( ii\% \times 990 = 19.eight \approx twenty\) test positive
People with illness: \( one\% \times g = ten\) and    \( 95\% \times 10 = 9.5 = ix.5 \approx ten\) test positive
Of all those who tested positive which are    twenty + ten = 30    only 10 take the disease.
Percentage of those who test positive merely do not have the disease is give past: ix.5 / (19.8 + ix.v) = 0.32
which is the probability \( P(D | TP) \) computed above.

Case 3
Three factories produce light bulbs to supply the market. Factory A produces twenty%, 50% of the tools are produced in factories B and 30% in factory C.
2% of the bulbs produced in factory A, 1% of the bulbs produced in manufacturing plant B and 3% of the bulbs produced in mill C are lacking.
A bulb is selected at random in the market and constitute to be defective. what is the probability that this bulb was produced by factory B?

Solution to Case iii

Let \( P(A) = 20\% \), \( P(B) = fifty\% \) and \( P(C) = 30\% \) represent the probabilities that a bulb selected at random is from factory A, B and C respectively.
Let \( P(D) \) exist the probability that a defective bulb is selected.
Let \( P(D | A) = 2\% \), \( P(D | B) = 1\% \) and \( P(D | C) = iii\%\) correspond the

provisional probabilities

that a bulb is defective given that it is selected from factory A, B and C respectively.
We at present summate that the provisional probability that the bulb was produced by factory B given that it is defective written as \( P(B | D) \) and given past Bayes' theorem.

\( P(B | D) = \dfrac{P(D | B) P(B) }{ P(D | A) P(A) + P(D | B) P(B) + P(D | C) P(C)}\)

\( = \dfrac{1\% \times l\%}{ ii\% \times 20\% + 1\% \times fifty\% + 3\% \times 30\%} = 0.2777\)

Although manufactory B produces 50% of the bulbs, the probability that the selected (defective) bulb comes from this factory is low because the bulbs produced by this manufacturing plant have low probability (ane%) of being lacking.

Example 4
A radar system is designed such that the probability of detecting the presence of an aircraft in its range is 98%. Still if no aircraft is nowadays in its range it still report (falsely) that an aircraft is present with a probability of 5%. At whatever time, the probability that an aircraft is present within the range of the radar is 7%.
a) What is the probability that no shipping is present in the range of the radar given that an aircraft is detected?
b) What is the probability that an aircraft is present in the range of the radar given that an aircraft is detected?
c) What is the probability that an shipping is present in the range of the radar given that no aircraft is detected?
d) What is the probability that no aircraft is present in the range of the radar given that no aircraft is detected?

Solution to Case 4

We shall use the complement notations.
Let \( A \) be the event that an aircraft is nowadays and \( A^c \) the upshot complement of \( A \) pregnant no aircraft is present.
The probability of A occurring is given as
\( P(A) = 7\% \)
and
\( P(A^c) = 100\% - 7\% = 93\% \)
Allow \( D \) be the event that an shipping is detected past the radar system and \( D^c \) the complement of \( D \) meaning no shipping is detected.
The conditional probability of that an aircraft is detected given that it is present is given above and is written as
\( P(D | A) = 98%\)
\( P(D | A^c) = five% \)
a)
Put all the above information in a Venn diagram as shown beneath.

diagram for Bayes' theorem in example 4 part a Pin it! Share on Facebook
Use Bayes' theorem to write the probability that no aircraft is nowadays in the range of the radar given that an aircraft is detected

\( P(A^c | D) = \dfrac{ P(D | A^c) P(A^c) }{ P(D | A^c) P(A^c) + P(D | A) P(A)} \)

\( = \dfrac{5\% \times 93\%}{5\% \times 93\% + 98\% \times seven\%} \approx 0.4040\)

b)
Use Bayes' theorem to write the probability that an aircraft is present in the range of the radar given that an aircraft is detected
\( P(A | D) = \dfrac{ P(D | A) P(A) }{ P(D | A) P(A) + P(D | A^c) P(A^c)} \)

\( = \dfrac{98\% \times 7\%}{98\% \times 7\% + 5\% \times 93\%} \approx 0.5960 \)

c)
We first demand to calculate the following probabilities
\( P(D^c | A) = 100\% - 98\% = 2\% \)
\( P(D^c | A^c) = 100\% - 5\% = 95\% \)
Put all the above information in a Venn diagram as shown beneath.

diagram for Bayes' theorem in example 4 part c Pin it! Share on Facebook

Use Bayes' theorem to write the probability that an shipping is nowadays in the range of the radar given that an no aircraft is detected

\( P(A | D^c) = \dfrac{ P(D^c | A) P(A) }{ P(D^c | A) P(A) + P(D^c | A^c) P(A^c)} \)

\( = \dfrac{2\% \times seven\%}{2\% \times 7\% + 95\% \times 93\%} \approx 0.0016\)

d)
Use Bayes' theorem to write the probability that no shipping is present in the range of the radar given that an no aircraft is detected

\( P(A^c | D^c) = \dfrac{ P(D^c | A^c) P(A^c) }{ P(D^c | A^c) P(A^c) + P(D^c | A) P(A)} \)

\( = \dfrac{95\% \times 93\%}{95\% \times 93\% + two\% \times 7\%} \approx 0.9984 \)

NOTE All the above calculations may be done with the help of a tree diagram shown below. Once the tree diagram have all the probabilities, it is easier to use these probabilities in Bayes' theorem in social club to evaluate the final results.

tree diagram for probabilities using Bayes' theorem Pin it! Share on Facebook

More References and links

More on Probabilities .
conditional probability
law of total probability
Binomial Probabilities Examples and Questions
addition rule of probabilities
multiplication rule of probabilities
probability questions
classical formula for probability
mutually exclusive events

How To Use Bayes Theorem To Analyze Data,

Source: https://www.analyzemath.com/probabilities/bayes-theorem.html

Posted by: shiresplesn1976.blogspot.com

0 Response to "How To Use Bayes Theorem To Analyze Data"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel