Module #4 Assignment
9/18/2023
A. Based on Table 1 What is the probability of:
| B | B1 | |
| A | 10 | 20 |
| A1 | 20 | 40 |
A1. Event A
10/(10 + 20) = 10 / 30 = 1/3
A2. Event B?
20 / (10 + 20) = 20 /30 = 2/3
A3. Event A or B
(1/3) + (2/3) - (10/30) = (3/3) - (10/30) = 1 - 1/3 = 2/3
A4. P(A or B) = P(A) + P(B)
(1/3) + (2/3) = 3/3 = 1
B. Applying Bayes' Theorem
Jane is getting married tomorrow, at an outdoor ceremony in the desert. In recent years, it has rained only 5 days each year. Unfortunately, the weatherman has predicted rain for tomorrow. When it actually rains, the weatherman correctly forecasts rain 90% of the time. When it doesn't rain, he incorrectly forecasts rain 10% of the time.
What is the probability that it will rain on the day of Jane's wedding?
Solution: The sample space is defined by two mutually-exclusive events - it rains or it does not rain. Additionally, a third event occurs when the weatherman predicts rain. Notation for these events appears below.
Event A1. It rains on Jane's wedding.
Event A2. It does not rain on Marie's wedding.
Event B. The weatherman predicts rain.
In terms of probabilities, we know the following:
P( A1 ) = 5/365 =0.0136985 [It rains 5 days out of the year.]
P( A2 ) = 360/365 = 0.9863014 [It does not rain 360 days out of the year.]
P( B | A1 ) = 0.9 [When it rains, the weatherman predicts rain 90% of the time.]
P( B | A2 ) = 0.1 [When it does not rain, the weatherman predicts rain 10% of the time.]
We want to know P( A1 | B ), the probability it will rain on the day of Marie's wedding, given a forecast for rain by the weatherman. The answer can be determined from Bayes' theorem, as shown below.
P( A1 | B ) = P( A1 ) P( B | A1 )
P( A1 ) P( B | A1 ) + P( A2 ) P( B | A2 )
P( A1 | B ) = (0.014)(0.9) / [ (0.014)(0.9) + (0.986)(0.1) ]
P( A1 | B ) = 0.111
Note the somewhat unintuitive result. Even when the weatherman predicts rain, it only rains only about 11% of the time. Despite the weatherman's gloomy prediction, there is a good chance that Marie will not get rained on at her wedding.
B1. Is this answer True or False.
True
B2. Please explain why?
The calculated probability is correct based on Bayes' Theorem. However, this seems counterintuitive because if the weatherman predicts rain, there is a high chance it will rain. According to the provided statistic, the weatherman only falsely predicts rain 10% of the time.
C. Last assignment from our textbook, pp. 55 Exercise # 2.3.
For a disease known to have a postoperative complication frequency of 20%, a surgeon suggests a new procedure. She/he tests it on 10 patients and found there are not complications. What is the probability of operating on 10 patients successfully with the traditional method?
A hint, use dbinom function - it is part of R functions that count Density, distribution function, quantile function, and random generation for the binomial distribution with parameters size and prob.
You will answer this question withdbinom(XXX, size=XXX, prob=XXX)
The result XXXX
Answer:
success <- dbinom(0, size = 10, prob = 0.20) > success [1] 0.1073742 | |
|
Comments
Post a Comment