All problems
Beta Density at Point
Problem
The beta pdf is x^(a - 1) (1 - x)^(b - 1) / B(a, b) with B(a, b) = Gamma(a) Gamma(b) / Gamma(a + b).
Given x in (0, 1), a, and b, return the density using math.gamma.
Hint
The normalizing constant is the beta function.
Test cases
case 1
in: [0.5,2,2]
expected: 1.5
case 2
in: [0.25,1,1]
expected: 1
case 3
in: [0.8,5,2]
expected: 2.4576
Starter codePython
def beta_pdf_value(x, a, b):
# Your code here
pass3 test cases · run your code against them in the editor