Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-165

Test Information Total

Problem

Return the sum of item informations over a list of [a, b] item parameter pairs at theta. Return 0.0 for an empty item list.

Hint

Item informations add because the items are conditionally independent.

Test cases

case 1
in: [0,[[1,0],[1,1],[1,-1]]]
expected: 0.6432238664829637
case 2
in: [0,[]]
expected: 0
case 3
in: [1,[[1.5,0]]]
expected: 0.3355795171582489
case 4
in: [0,[[2,1]]]
expected: 0.419974341614026
case 5
in: [2,[[1,0],[1,0]]]
expected: 0.20998717080701323
Starter codePython
import math
def test_information_total(theta, items):
    # Your code here
    pass

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