The constraints are $f(0,0)=1, f(0,k)=0\space \forall k \neq 0, f(N,k)=0 \space \forall k>N\space0\leq p\leq 1$ .
When working on a probability problem, I came across this recursion when working with random walks. For symmetric random walks, with $p=\frac{1}{2}$, I found a closed form solution of $2^{-N}*$ ${N}\choose{\lfloor{\frac{k}{2}}\rfloor} $. To do so, I wrote out the first few terms, noticed a pattern, then used induction. I cannot find a nice pattern writing out the first few terms of the general form with $p$.
My gut instinct is that I will get something with binomial coefficients, since this recurrence relation looks an awful lot like the recurrence relation for binomial coefficients, and the solution for $p=\frac{1}{2}$ has binomial coefficients. Does anyone have any insights or suggestions?
I also will add, I tried turning this into a PDE and I tried some generating function approaches, but the initial/boundary conditions have given me difficulty.
$f(n,d)$ is the probability that, when you repeat $n$ independent events that have a probability of success of $p$, and a probability of failure of $1-p$, that the number of successes minus the number of failures is $d$.
Let $s$ be the number of successes and $f$ be the number of failures. Since $s+f=n$ and $s-f=d$, it follows that $s=(n+d)/2$. Therefore, we need $(n+d)/2$ successes out of $n$ independent events with probability $p$. This is answered by a binomial distribution. Therefore, $$ f(n,d)=\binom{n}{(n+d)/2}p^{(n+d)/2}(1-p)^{(n-d)/2}\;. $$
However, there is an exception. If $n$ and $d$ have opposite parities, then it is impossible for the difference between the number of successes and failures to be $d$. In this case, $f(n,d)=0$.