Skip to content
DeepForgeby svx
All problems

Model Rollout Horizon

Problem

Choose a model rollout horizon from per-step model accuracy.

Reliability after h steps is accuracy^h, so the smallest h with accuracy^h <= tolerance is ceil(ln(tolerance) / ln(accuracy)), floored at 1. Return 0 when accuracy or tolerance is outside (0, 1).

Hint

Compounding model error limits how far imagined rollouts stay trustworthy.

Test cases

case 1
in: [0.9,0.5]
expected: 7
case 2
in: [0.5,0.25]
expected: 2
case 3
in: [0.8,0.8]
expected: 1
case 4
in: [0.99,0.9]
expected: 11
case 5
in: [1,0.5]
expected: 0
Starter codePython
import math
def model_rollout_horizon(accuracy, tolerance):
    # Your code here
    pass

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