Skip to content
DeepForgeby svx
All problems
EasyInformation Theoryinfo-114

Gaussian Q-Function

Problem

Return the Gaussian Q-function, the tail probability of a standard normal variable:

Q(x) = 0.5 * erfc(x / sqrt(2))

Hint

By symmetry Q(-x) = 1 - Q(x).

Test cases

case 1
in: [0]
expected: 0.5
case 2
in: [1]
expected: 0.15865525393145705
case 3
in: [2]
expected: 0.022750131948179216
case 4
in: [-1]
expected: 0.8413447460685429
Starter codePython
import math
def gaussian_q(x):
    # Your code here
    pass

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