EDITED version to my original question...
For the coin toss problem the probability of getting exactly $k$ successes in $n$ trials is $$ f(k;n,p) = \Pr(X = k) = {n\choose k}p^k(1-p)^{n-k} $$
Here $p$ is fixed for all the trials. How can I modify this expression such that it allows me to use a different value for $p$ for every trial? Eventually I'd like to arrive at an expression for $Pr(X<k)$ which uses a time varying $p$. I've been trying to look at Permutation Matrices, Multinomial distribution and all, but really not sure how best to approach this problem.
ORIGINAL question was...
I'm trying to derive an expression for the "dynamic" binomial theorem. The "normal" binomial theorem is
$$ (x+y)^n = \sum_{k=0}^n \binom{n}{k} x^k y^{n-k} $$
How do I go about deriving an equivalent expression where $x$ and $y$ are varying for each $n$?