If we have an array $P_0, P_1, P_2, \dots, P_N$, how to compute $\sum_{t=1}^{N}(1 - P_t)^{i - 1} \cdot P_t \cdot (1 - P_{t - 1})^{L - i}$ for each $i$ from $1$ to $L$ fast?
If we have an array $P_0, P_1, P_2, \dots, P_N$, how to compute $\sum_{t=1}^{N}(1 - P_t)^{i - 1} \cdot P_t \cdot (1 - P_{t - 1})^{L - i}$ for each $i$ from $1$ to $L$ fast?