Total Width of a Confidence Interval
Ridgeline is drafting datasheets and one column is headed "certified range, total span". Everywhere else the lab quotes a plus-or-minus figure, so this column needs the whole distance from the bottom of the interval to the top, in one number.
Each sensor on the datasheet has its own planned reading count, its own rig noise and its own certified confidence level, arriving as a critical value. Notice that the datasheets are being written before any sensor has been measured - which is fine, because the number this column wants does not depend on what the readings turn out to be.
Task: Print the total width of the confidence interval, top endpoint minus bottom endpoint, rounded to 2 decimals. The conventions: this is the full span and not the half-width; the population standard deviation is known rather than estimated, so the supplied normal critical value applies; the interval is two-sided; and rounding happens once, on the final value.
Input
Three lines: how many times the sensor will be read, the rig's known population standard deviation, and the two-sided critical value for the certified confidence level. The count is a whole number of at least 1; the other two are positive decimals.
Output
One line holding the total span, rounded to 2 decimals and printed the way Python prints a float - 7.84, and 10.3 rather than 10.30.
Example:
Input:
16
8
1.96
Output:
7.84
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