All problems
Sequential Test Threshold
Problem
Decide whether a p-value passes a Bonferroni-style sequential test after a given number of looks: p_value < alpha / looks.
Return False when looks <= 0.
Hint
Each additional peek at the data tightens the significance threshold.
Test cases
case 1
in: [0.01,0.05,3]
expected: true
case 2
in: [0.02,0.05,3]
expected: false
case 3
in: [0.001,0.05,1]
expected: true
case 4
in: [0.05,0.05,1]
expected: false
Starter codePython
def passes_sequential_test(p_value, alpha, looks):
# Your code here
pass4 test cases · run your code against them in the editor