Skip to content
DeepForgeby svx
All problems
EasyCalculusca-108

Normal Tail Integral

Problem

Compute the upper tail probability P(Z > z) of the standard normal distribution.

This equals 0.5 * erfc(z / sqrt(2)), where erfc is the complementary error function available in the math module. The value is finite for every finite z.

Hint

Convert the normal integral to the complementary error function by rescaling the variable.

Test cases

case 1
in: [0]
expected: 0.5
case 2
in: [1]
expected: 0.15865525393145705
case 3
in: [1.96]
expected: 0.02499789514822043
case 4
in: [-1]
expected: 0.8413447460685429
case 5
in: [3]
expected: 0.0013498980316300957
Starter codePython
def normal_tail(z):
    # Your code here
    pass

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