Probability, Statistics, Distributed Systems, Software Engineering, Interview Questions.
p^n*E(n) + (sum k=1 to n) nCk * (1-p)^k * p^(n-k) * E(n-k) E(n)*(1-p^n) = 1 + (sum k=1 to n) nCk * (1-p)^k * p^(n-k) * E(n-k) E(n) = (1 + (sum k=1 to n) nCk * (1-p)^k * p^(n-k) * E(n-k))/(1-p^n) base cases are: E(0) = 0 Time complexity of this approach is O(n²). def recursion(n, p, cache, dp): #