Problem 1

  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?

Let A be the positive test result

\[ A : \text{Positive test Result} \]

Let B be the HIV vaiants

\[ B_{pos}: \text{Positive for HIV variant} \] \[ B_{neg}: \text{Negative for HIV variant} \]

Therefore,

\[ P( B_{pos} | A) = \frac{P(A|B_{pos}) \cdot P(B_{pos})}{P(A)} \] Simplify above formula:

\[ P( B_{pos} | A) = \frac{P(A|B_{pos}) \cdot P(B_{pos})}{P(A|B_{pos}) \cdot P(B_{pos}) + P(A|B_{neg}) \cdot P(B_{neg}) } \]

$ P(A|B_{pos}) = .96 $, the sensitivity. $ P(A|B_{neg}) = 1 - .98 = .02 $, one minus the specificity. $ P(B_{pos}) = .001 $, the prevalence rate. $ P(B_{neg}) = .1 - .001 = 999 $.

P_B_pos = (.96*.001)/((.96*.001)+(.02*.999)) 

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?

cost_to_test = 100000 * 1000
expected_positive_cost = .001 * 100000 *100000

total = cost_to_test + expected_positive_cost

print(total)
## [1] 1.1e+08

\[ The \ total \ expected \ cost \ is \begin{equation} \ $ \ 1.1 \ * \ 10^{8} \end{equation}. \]

Problem 2

  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?

What is the probability that, after 24 months, you received exactly 2 inspections?

dbinom(x = 2, size = 24, prob = .05)
## [1] 0.2232381

What is the probability that, after 24 months, you received 2 or more inspections?

1 - (dbinom(x = 2, size = 24, prob = .05))
## [1] 0.7767619

What is the probability that your received fewer than 2 inspections?

dbinom(x = 0, size = 24, prob = .05) + dbinom(x = 1, size = 24, prob = .05)
## [1] 0.6608173

What is the expected number of inspections you should have received?

24 * .05
## [1] 1.2

What is the standard deviation?

sqrt(24 * .05 * (1-.05))
## [1] 1.067708

Problem 3

  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?

What is the probability that exactly 3 arrive in one hour?

dpois(x = 3, lambda =  10, log = FALSE)
## [1] 0.007566655

What is the probability that more than 10 arrive in one hour?

dpois(x = 10, lambda =  10, log = FALSE)
## [1] 0.12511

How many would you expect to arrive in 8 hours?

8 * 10
## [1] 80

What is the standard deviation of the appropriate probability distribution?

sqrt(10)
## [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?

Since we there are 3 family practices that can see 24 patient which equivalent to 72 patients per day between the 3 family practices, but we are expected to see 80 patients within 8 hours. Therefore, we have more patients to see which is more than what the family practice can handle. 72 slots for patients compare to actually seeing 80 patients mean that there’s 11.1111111 % over utilization. That mean the 3 family practices are seeing 111% of patients per day, my recommendation would be for them to expand by opening a 4th family practice with more staffs, or higher more help for the current 3 practices and open more availability slots to see more patients.

Problem 4

  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?

what was the probability he/she would have selected five nurses for the trips?

dhyper(x = 5, m = 15, n = 15, k = 6, log = FALSE)
## [1] 0.07586207

How many nurses would we have expected your subordinate to send?

5 * 15 / 30
## [1] 2.5

How many non-nurses would we have expected your subordinate to send?

6 - ( 5 * 15 / 30)
## [1] 3.5

Problem 5

  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?

What is the probability that the driver will be seriously injured during the course of the year?

1 - pgeom(q = 1200, prob = .001,lower.tail = TRUE, log.p = FALSE)
## [1] 0.3007124

What is the probability that the driver will be seriously injured in the course of 15 months?

## number of hours in one month
month = 1200 / 12  

print(month)
## [1] 100
## calculating number of hours in 15 months
x = 100 * 15

print(x)
## [1] 1500

In the course of 15 months?

1 - pgeom(q = 1500, prob = .001, lower.tail = TRUE, log.p = FALSE)
## [1] 0.2227398

What is the expected number of hours that a driver will drive before being seriously injured?

1 / .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?

pgeom(q = 100, prob = .001, lower.tail = TRUE, log.p = FALSE)
## [1] 0.09611265

Problem 6

  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?

What is the probability that the generator will fail more than twice in 1000 hours?

1 - ppois(q = 2, lambda = 1, lower.tail = TRUE, log.p = FALSE)
## [1] 0.0803014

What is the expected value?

Ans. The expected value is 1 which the number of times the generator fails within 1000 hours known as lambda.

Problem 7

  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?

What is the probability that this patient will wait more than 10 minutes?

when lower tail is TRUE

punif(q = 10, min = 0, max = 30, lower.tail = TRUE, log.p = FALSE)
## [1] 0.3333333

when lower tail is FALSE

punif(q = 10, min = 0, max = 30, lower.tail = FALSE, log.p = FALSE)
## [1] 0.6666667

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?

when lower tail is TRUE

P10 <- punif(q = 10, min = 0, max = 30, lower.tail = TRUE, log.p = FALSE)
P15 <- punif(q = 15, min = 0, max = 30, lower.tail = TRUE, log.p = FALSE)

P15 / P10
## [1] 1.5

When lower tail is FALSE

P10 <- punif(q = 10, min = 0, max = 30, lower.tail = FALSE, log.p = FALSE)
P15 <- punif(q = 15, min = 0, max = 30, lower.tail = FALSE, log.p = FALSE)

P15 / P10
## [1] 0.75

What is the expected waiting time?

Ans. The expected waiting time is the minimum plus the maximum divide 2.

(0 + 30) / 2
## [1] 15

Problem 8

  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?

What is the expected failure time?

Ans. The expected failure time is the expected value which is 10.

What is the standard deviation?

Ans. The standard deviation is also 10.

What is the probability that your MRI will fail after 8 years?

When lower tail is TRUE

pexp(q = 8, rate = .1, lower.tail = TRUE, log.p = FALSE)
## [1] 0.550671

When lower tail is FALSE

pexp(q = 8, rate = .1, lower.tail = FALSE, log.p = FALSE)
## [1] 0.449329

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?

(pexp(q = 10,rate = .1, lower.tail = TRUE, log.p = FALSE) - pexp(q = 8, rate = .1, lower.tail = TRUE, log.p = FALSE)) * (pexp(q = 8, rate = .1, lower.tail = FALSE, log.p = FALSE)) / (pexp(q = 8, rate = .1, lower.tail = FALSE, log.p = FALSE))
## [1] 0.08144952