Question: How to prove this combinatorial summation :

$$ \sum\_{i = 1}^{n} (-1)^i k^{n-i} \binom{n}{i} = (k-1)^n - k^n $$

here k is a constant positive integer.

I've hadn't any luck with proving this nor do i know the approach to this summation. I found this formula using wolfram alpha.

Answer: 
By the Binomial Theorem, we have,

$$(-1 + k)^{n} = \sum\_{i = 0}^{n}{n\choose i} (-1)^{i} k^{n - i}.$$

Can you finish from here?
Recognizing that adding $k^n$ to both sides gives you an instance of the binomial theorem is definitely the nicest approach, but there actually is another that isn’t *too* bad.

Since the righthand side is negative, it’s natural to multiply through by $-1$ first to get

$$\sum\_{i=1}^n(-1)^{i+1}k^{n-i}\binom{n}i=k^n-(k-1)^n\,,$$

whose lefthand side looks very much like an inclusion-exclusion calculation, so let’s see if there’s an easy combinatorial argument hiding here.

The righthand side is clearly the number of functions $f$ from $[n]$ to $[k]$ such that $f(i)=k$ for some $i\in[n]$. For $i\in[n]$ let $F\_i$ be the set of functions from $[n]$ to $[k]$ such that $f(i)=k$. Then by a straightforward inclusion-exclusion calculation we have

$$\begin{align\*}
k^n-(k-1)^n&=\left|\bigcup\_{i=1}^nF\_i\right|\\
&=\sum\_{\varnothing\ne I\subseteq[n]}(-1)^{|I|+1}\left|\bigcap\_{i\in I}F\_i\right|\\
&=\sum\_{i=1}^n(-1)^{i+1}\binom{n}ik^{n-i}\,,
\end{align\*}$$

since there are $\binom{n}i$ subsets of $[n]$ of cardinality $i$, and the functions in $\bigcap\_{i\in I}F\_i$ can assume any value in $[k]$ at each of the $n-i$ integers in $[n]\setminus I$.