I am learning about generating functions and I tried to prove some identity using it:
$\sum_{k=p}^n (-1)^k\binom{n}{k}\binom{k}{p} = (-1)^p$ for $n=p$ and $=0$ for else.
Let $n =p$, then I don't even need the generating function to see the equality we have $(-1)^n \binom{n}{n} \binom{n}{n}=(-1)^n$ on the LHs and $(-1)^p=(-1)^n$ on the RHS
Let $n \neq p$ The generating function of the LHS would be $(-1)^k\binom{n}{k}\binom{k}{k} + (-1)^{k+1}\binom{n}{k+1}\binom{k+1}{k}x+...+(-1)^n\binom{n}{n}\binom{n}{n}x^{n-1}$
The generating function on the RHS would be $0+0x+0x^2+...$
Here is my first problem, obviously $(-1)^k \binom{n}{k} \neq 0$ so it seems like that I have misunderstood something. Could someone please explain where my mistake is.