1. (Bayesian). A new test for multinucleoside-resistant (MNR) human immunodeficiency virus type 1 (HIV-1) variants was recently developed. The test maintains 96% sensitivity, meaning that, for those with the disease, it will correctly report “positive” for 96% of them. The test is also 98% specific, meaning that, for those without the disease, 98% will be correctly reported as “negative.” MNR HIV-1 is considered to be rare (albeit emerging), with about a .1% or .001 prevalence rate. Given the prevalence rate, sensitivity, and specificity estimates, what is the probability that an individual who is reported as positive by the new test actually has the disease? If the median cost (consider this the best point estimate) is about $100,000 per positive case total and the test itself costs $1000 per administration, what is the total first-year cost for treating 100,000 individuals?

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

  1. (Binomial). The probability of your organization receiving a Joint Commission inspection in any given month is .05. What is the probability that, after 24 months, you received exactly 2 inspections? What is the probability that, after 24 months, you received 2 or more inspections? What is the probability that your received fewer than 2 inspections? What is the expected number of inspections you should have received? What is the standard deviation?

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
  1. (Poisson). You are modeling the family practice clinic and notice that patients arrive at a rate of 10 per hour. What is the probability that exactly 3 arrive in one hour? What is the probability that more than 10 arrive in one hour? How many would you expect to arrive in 8 hours? What is the standard deviation of the appropriate probability distribution? 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?

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.

  1. (Hypergeometric). Your subordinate with 30 supervisors was recently accused of favoring nurses. 15 of the subordinate’s workers are nurses and 15 are other than nurses. As evidence of malfeasance, the accuser stated that there were 6 company-paid trips to Disney World for which everyone was eligible. The supervisor sent 5 nurses and 1 non-nurse. If your subordinate acted innocently, what was the probability he/she would have selected five nurses for the trips? How many nurses would we have expected your subordinate to send? How many non-nurses would we have expected your subordinate to send?

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
  1. (Geometric). The probability of being seriously injured in a car crash in an unspecified location is about .1% per hour. A driver is required to traverse this area for 1200 hours in the course of a year. What is the probability that the driver will be seriously injured during the course of the year? In the course of 15 months? What is the expected number of hours that a driver will drive before being seriously injured? Given that a driver has driven 1200 hours, what is the probability that he or she will be injured in the next 100 hours?

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
  1. You are working in a hospital that is running off of a primary generator which fails about once in 1000 hours. What is the probability that the generator will fail more than twice in 1000 hours? What is the expected value?

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
  1. A surgical patient arrives for surgery precisely at a given time. Based on previous analysis (or a lack of knowledge assumption), you know that the waiting time is uniformly distributed from 0 to 30 minutes. What is the probability that this patient will wait more than 10 minutes? 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? What is the expected waiting time?

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

  1. Your hospital owns an old MRI, which has a manufacturer’s lifetime of about 10 years (expected value). Based on previous studies, we know that the failure of most MRIs obeys an exponential distribution. What is the expected failure time? What is the standard deviation? What is the probability that your MRI will fail after 8 years? Now assume that you have owned the machine for 8 years. Given that you already owned the machine 8 years, what is the probability that it will fail in the next two years?

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

```