A Stricter 99% Confidence Interval
A hospital group buying Ridgeline's sensors for anaesthesia machines will not accept the standard certificate. Their regulator writes everything at 99% confidence, and they want the sensor certificates to match. For 99% two-sided the normal critical value is 2.576, against 1.96 for the 95% certificates the lab issues by default.
The lab manager reprices several sensors before agreeing to anything, because a wider certificate may fail the customer's own acceptance limits. Each sensor has its own reading count and its own rig noise, and she wants to see both the 95% and the 99% figure for each.
Task: Print the margin of error at the confidence level supplied, rounded to 2 decimals. The conventions: the half-width, not the total span; the rig's spread is known rather than estimated from the readings, so the supplied normal critical value applies rather than a t value; the interval is two-sided; and rounding happens once, on the final value.
Input
Three lines: how many times the sensor was read, the rig's known population standard deviation, and the two-sided critical value for the confidence level being quoted. The count is a whole number of at least 1; the other two are positive decimals.
Output
One line holding the margin of error, rounded to 2 decimals and printed the way Python prints a float - 5.15.
Example:
Input:
25
10
2.576
Output:
5.15
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