All problems

A One-Sided Upper Confidence Bound

easyPythonConfidence Intervals

A hospital's biomedical engineering team is writing the safety case for a ventilator alarm and needs one figure from Ridgeline about a sensor's response time. The question is deliberately lopsided: nobody is harmed by a sensor that answers faster than expected, so the only number the safety case can use is a ceiling - a value the true average response time is not credibly above.

The sensor is read a number of times on a rig whose population standard deviation is a known quantity, and the readings are averaged. Because the claim points one way only, the whole of the tolerated risk sits in the upper tail, and the critical value supplied reflects that: 1.645 for a 95% one-sided bound, 2.326 for a 99% one - not the 1.96 the two-sided certificates use.

Task: Print the one-sided upper confidence bound on the true average response time, rounded to 2 decimals. The conventions: this is a one-sided bound, so no lower endpoint is being claimed and the entire tolerated risk sits above the number printed; the rig's spread is known rather than estimated from the readings, so the supplied normal critical value applies rather than a t value; and rounding happens once, on the final value.

Input

Four lines: the average of the readings, how many readings were taken, the rig's known population standard deviation, and the one-sided critical value for the confidence level required. The count is a whole number of at least 1; the rest are positive decimals.

Output

One line holding the upper bound, rounded to 2 decimals and printed the way Python prints a float - 242.47.

Example:

Input:
240
64
12
1.645

Output:
242.47

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…