coins with probabilities of heads. Find probability of exactly heads. = probability of heads in first coins. Transition: . Base: (no coins, 0 heads).
Answer: . This is the classic probability DP pattern. Each coin contributes independently, and we track the cumulative count. Each coin contributes independently. The product of individual probabilities gives the combined probability.