Problem:
Given integers n and k, along with
p1,p2,..., pn; where pi ε [0, 1]
, you want to determine the probability of obtaining exactlyk
heads whenn
biased coins are tossed independently at random, where pi is the probability that the ith coin comes up heads. Give an O(n2) algorithm for this task. Assume you can multiply and add two numbers in [0, 1] in O(1) time.
Can somebody help me with developing the recurrence relation so that I may code it. (The question comes from back exercise of chapter Dynamic Programming in book "Algorithms By Dasgupta")