All problems
Uniform Order Stats Expected Min and Max
Problem
Expected minimum and maximum of n independent Uniform(0, 1) variables, returned as [E[min], E[max]].
E[min] = 1 / (n + 1) and E[max] = n / (n + 1). Return [0.0, 0.0] for n < 1.
Hint
The k-th smallest uniform has expectation k / (n + 1).
Test cases
case 1
in: [1]
expected: [0.5,0.5]
case 2
in: [2]
expected: [0.3333333333333333,0.6666666666666666]
case 3
in: [9]
expected: [0.1,0.9]
case 4
in: [0]
expected: [0,0]
Starter codePython
def uniform_order_stats_expected(n):
# Your code here
pass4 test cases · run your code against them in the editor