Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-408

Characteristic Function Symmetric Sign

Problem

For a random variable taking values +1 and -1 with equal probability, the characteristic function is E[e^{i t X}] = cos(t).

Given t, return the value.

Hint

Average the complex exponentials of opposite signs.

Test cases

case 1
in: [0]
expected: 1
case 2
in: [0.5]
expected: 0.8775825618903728
case 3
in: [1]
expected: 0.5403023058681398
Starter codePython
def characteristic_function_symmetric_sign(t):
    # Your code here
    pass

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