Skip to content
DeepForgeby svx
All problems
EasyStatisticsst-103

Information Fraction

Problem

Return the information fraction current_n / planned_n for an interim analysis. Return 0.0 when planned_n <= 0.

Hint

It is the proportion of planned information accrued.

Test cases

case 1
in: [50,100]
expected: 0.5
case 2
in: [0,100]
expected: 0
case 3
in: [100,100]
expected: 1
case 4
in: [10,0]
expected: 0
case 5
in: [120,100]
expected: 1.2
Starter codePython
def information_fraction(current_n, planned_n):
    # Your code here
    pass

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