Skip to content
DeepForgeby svx
All problems
EasyProbabilitypr-363

Exponential PDF Value

Problem

The exponential density with rate lambda is lambda * exp(-lambda x) for x >= 0 and 0 otherwise.

Given x and the rate, return the density.

Hint

The density is largest at zero.

Test cases

case 1
in: [1,2]
expected: 0.2706705664732254
case 2
in: [0,0.5]
expected: 0.5
case 3
in: [-1,1]
expected: 0
Starter codePython
def exponential_pdf_value(x, rate):
    # Your code here
    pass

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