Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-352

Poisson CDF Prefix

Problem

The Poisson CDF at k is sum_{j=0}^{k} exp(-lambda) lambda^j / j!.

Given lambda and k, return the probability of at most k events.

Hint

Accumulate the Poisson pmf.

Test cases

case 1
in: [2,1]
expected: 0.4060058497098381
case 2
in: [1,3]
expected: 0.9810118431238463
case 3
in: [0.5,0]
expected: 0.6065306597126334
Starter codePython
def poisson_cdf_prefix(lam, k):
    # Your code here
    pass

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