All problems
Calibration Set Size Effect
Problem
Estimate calibration range underestimation: with num_samples samples the expected maximum of a uniform range misses the true max by true_max / (num_samples + 1). A non-positive sample count returns true_max.
The signature is calibration_range_error(true_max, num_samples).
Hint
The expected maximum of n uniform samples is M*n/(n+1), leaving an M/(n+1) gap.
Test cases
case 1
in: [10,99]
expected: 0.1
case 2
in: [5,4]
expected: 1
case 3
in: [1,0]
expected: 1
case 4
in: [3,9]
expected: 0.3
Starter codePython
def calibration_range_error(true_max, num_samples):
# Your code here
pass4 test cases · run your code against them in the editor