Skip to content
DeepForgeby svx
All problems
MediumProbabilitypr-176

P-hacking Detection Lite

Problem

Probability of at least one false positive across m independent hypothesis tests each run at significance level alpha:

FWER = 1 - (1 - alpha)^m.

This is the family-wise error rate that p-hacking inflates. Return 0.0 for invalid inputs.

Hint

Complement of all tests being non-significant.

Test cases

case 1
in: [0.05,1]
expected: 0.050000000000000044
case 2
in: [0.05,20]
expected: 0.6415140775914581
case 3
in: [0.01,100]
expected: 0.6339676587267709
case 4
in: [0.05,0]
expected: 0
Starter codePython
def family_wise_error_rate(alpha, m):
    # Your code here
    pass

4 test cases · run your code against them in the editor