Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-420

Win Rate Interval Half Width

Problem

The half width of a normal-approximation interval for a win rate is z * sqrt(p (1 - p) / n).

Given the win rate, the number of comparisons, and the critical z, return the half width.

Hint

It is the standard error scaled by the critical value.

Test cases

case 1
in: [0.6,100,1.96]
expected: 0.09601999791710057
case 2
in: [0.5,400,1.645]
expected: 0.041125
case 3
in: [0.9,50,2.576]
expected: 0.10929042410019278
Starter codePython
def win_rate_interval_half_width(win_rate, n, z):
    # Your code here
    pass

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