All problems
Geometric Memoryless Check
Problem
Verify the memoryless property of the geometric distribution:
P(X > n + m | X > n) = P(X > m)
where P(X > k) = (1 - p)^k. Return True when the two sides agree within 1e-9.
Hint
Compute the conditional probability with the survival function.
Test cases
case 1
in: [0.3,4,2]
expected: true
case 2
in: [0.5,1,7]
expected: true
case 3
in: [0.9,0,3]
expected: true
case 4
in: [0.25,10,3]
expected: true
Starter codePython
def geometric_memoryless_check(p, n, m):
# Your code here
pass4 test cases · run your code against them in the editor