Estimate the sample size needed per group to detect a difference between two proportions p1 and p2 with a two-sided test, using zα/2=1.96 (5% significance) and zβ=0.84 (80% power).
Implement solve(p1, p2).
Returns. Return an int, rounded up. Both rates must lie in [0,1] and must differ; otherwise ValueError is raised.
Example 1
Input:
solve(0.1, 0.15)
Output:
685
Example 2
Input:
solve(0.5, 0.6)
Output:
387
No results yet
Run your code to check it against the examples, or submit to run every test.