Formula for Bayes’ Theorem
\[ P(A|B) = \frac{P(B|A)*P(A)}{P(B)} \]
P(D) = 0.001
P(T|D) = 0.96
P(N|ND) = 0.98
From the following decision tree, we can find P(T)
– 0.001 -> D -0.96 -> (T)
– 0.001 -> D -0.04 -> (N)
– 0.999 ->ND -0.02 -> (T)
– 0.999 ->ND -0.98 -> (N)
P(T) = P(D and T) + P(N and T)
P(T) = (0.001)(0.96) + (0.999)(0.02)
P(T) = 0.02094
The probability that an individual who is reported as positive by the new test actually has the disease is 4.58%:
\[ P(D|T) = \frac{P(T|D)*P(D)}{P(T)}\\ = \frac{0.96*0.001}{0.02094}\\ = 0.04584527\]
Number of individuals = 100,000
P(D|T) = 0.04584
Number of indiviual who is positive acutally has the disease = 0.04584 * 100,000 = 4,584
Cost per positive case = $100,000
Total cost per positive case = 4,584 * $100,000 = $458,400,000
Test cost per administration = $1,000
Total first year cost = $458,400,000 + $1,000
Total first year cost = $458,401,000
Formula for Binomial
\[ P(X = x ) = nCx*p^x*(1-p)^{(n-x)} \]
x (number successes) = 2
n (number of trials) = 24
p (probability of success) = 0.05
# Probability for Exactly 2 inspections [P(X=2)]:
x = 2
n = 24
p = 0.05
P2 <- dbinom(x,n,p)
P2
## [1] 0.2232381
# Probability for 2 or more inspections [P(X>=2)]:
# P(X>=2) = 1- [P(X=0)+P(X=1)]
# pbinom will provide the area to the left, we need to find the area to the right (>1)
# We need to use 1 subtract the result
P_2_or_more <- (1-pbinom(x-1,n,p))
P_2_or_more
## [1] 0.3391827
# Probability for fewer than 2 inspections [P(X<2)]:
# P(X<2) = [P(X=0)+P(X=1)]
P_less_than_2 <- pbinom(x-1,n,p)
P_less_than_2
## [1] 0.6608173
# Expected number of inspections
# E(x) = n * P
Ex = n*p
Ex
## [1] 1.2
# Standard Deviation
# SD = sqrt(np(1-p))
SD = sqrt((n*p*(1-p)))
SD
## [1] 1.067708
Formula for Poisson
\[ P(X = x) = \frac{e^{-\lambda}*\lambda^{x}}{x!} \]
x (number successes) = 3
Mean(lamda) = 10
# Probability for exactly 3 arrive [P(X=3)]
x1 = 3
lamda = 10
p_exact_3 = dpois(x1, lamda)
p_exact_3
## [1] 0.007566655
# Probability for more than 10 arrive [P(x>10)]
# P(X>10) = 1-[P(X=0)+P(X=1)+...+P(X=10)]
x10 = 10
lamda = 10
# ppois will provide the area to the left, we need to find the area to the right (>10)
# We need to use 1 subtract the result
p_more_10 = 1-ppois(x10, lamda)
p_more_10
## [1] 0.4169602
# How many would you expect to arrive in 8 hours?
Ev = lamda * 8
Ev
## [1] 80
# standard deviation is the square root of the mean (lambda)
SD2 = sqrt(lamda)
SD2
## [1] 3.162278
If there are three family practice providers that can see 24 templated patients each day, what is the percent utilization and what are your recommendations?
The family clinc has three practice providers that can see 24 patients each day If we are expecting 80 patients arrive each day (Assume each provider operate 8 hours per day)
Percent Utilization = 80/72 * 100% = 111%
The clinc need to hire more providers.
Formula for Hypergeometric
\[ P(X = x) = \frac{kCx*(N-kCn-x)}{NCn} \]
Success in Sample (x) = 5
Number of Trials (n) = 6
Success in Population (k) = 15
Size of Population (N) = 30
# Probability for selecting five nurses for the trips [P(X=5)]
result <- dhyper(5, 15, 15, 6)
result
## [1] 0.07586207
# How many nurses would we have expected your subordinate to send?
# Expected value = nk/N
EvN = 6*15/30
EvN
## [1] 3
# How many non-nurses would we have expected your subordinate to send?
# Expected value = n(N-k)/N
EvN = 6*15/30
EvN
## [1] 3
Probaility = 0.001
Success = 1200
P(at least one success) = 1 - P(failure in one trail)^n
The probability that the driver will be seriously injured during the course of the year is:
1 - (1-0.001)^1200 = 0.6989866
In the course of 15 months?
1 - (1-0.001)^(1200*1.25)
## [1] 0.7770372
What is the expected number of hours that a driver will drive before being seriously injured?
# Expected Value = 1/p
1/0.001
## [1] 1000
Given that a driver has driven 1200 hours, what is the probability that he or she will be injured in the next 100 hours?
(1 - (1 - 0.001)^100)
## [1] 0.09520785
x (number successes) = 2
Mean(lamda) = 1
Expected Value is equal to Lambda = 1
# Probability for fail more than twice in 1000 hours [P(>2)]
x6 = 2
lamda6 = 1
p_e_2 = 1-ppois(x6, lamda6)
p_e_2
## [1] 0.0803014
This is a uniform distribution question
The probability density function is:
F(x) = 1/(30-0) = 1/30
The probability that this patient will wait more than 10 minutes
P(X>30) = P(10<x<30) = (30-10) * (1/30) = 0.6667
If the patient has already waited 10 minutes, what is the probability that he/she will wait at least another 5 minutes prior to being seen?
Original 30 mins interval - 10 mins already waited = 20 mins
The probability for waiting at least another 5 mins (>=5) for the remaining interval is:
P(x>= 5| Waited 10 mins) = (20-5)*(1/20) = 3/4 = 0.75
Expected Wait time = mean = (0+30)/2 = 15 minutes
This is an exponential distribution
u = 10 years
lambda = 1/u = 0.1
\[ f(x) = \lambda e^{-\lambda x} \]
What is the expected failure time?
Expected failure time = 1/lambda
= 1/0.1 = 10 years
What is the standard deviation?
The standard deviation is equal to the mean for exponential distributions which is 10 years
What is the probability that your MRI will fail after 8 years?
P(X>8) = e^(-0.1*8)
exp(-0.1*8)
## [1] 0.449329
Given that you already owned the machine 8 years, what is the probability that it will fail in the next two years?
P(9<x<10) = P(x<10) - P(x<9)
P(9<x<10) = [1-e^(-0.1*10)] - [1-e^(-0.1*9)]
p10 = 1-exp(-0.1*10)
p9 = 1-exp(-0.1*9)
p910 = p10-p9
p910
## [1] 0.03869022
```