Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-391

Random Walk Variance After Steps

Problem

For a random walk with independent increments of variance sigma^2, the position after n steps has variance n sigma^2.

Given the increment variance and n, return the variance.

Hint

Independent increments add their variances.

Test cases

case 1
in: [1,100]
expected: 100
case 2
in: [4,25]
expected: 100
case 3
in: [0.5,8]
expected: 4
Starter codePython
def random_walk_variance_after_steps(step_variance, n):
    # Your code here
    pass

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