Ivan and Alexander write lists of integers. Ivan writes all the lists of length $n$ with elements $a_1,a_2,\dots,a_n$ such that $|a_1| + |a_2|+\dots+|a_n| \le k$. Alexander writes all the lists with length $k$ with elements $b_1,b_2,\dots,b_k$ such that $|b_1|+|b_2|+···+|b_k| \le n$. Prove that Alexander and Ivan wrote the same number of lists.
I was having trouble understanding the proof. I get how there are $\binom{k}{r}$ possible. But I don't get how there are $\binom{n}{r} 2^r$ ways, we have $r+1$ integers summing up to $k+1$. Also, I am not sure why total number of lists are $$\sum_{r=0}\binom{n}{r}\binom{k}{r}2^r.$$
We are introducing $c_0$ which is a positive element. So can someone explain the "bijective" way. As in, if we have elements $c_0,\dots,c_r$ summing to $k+1$. How do we get lists Ivan writes?
I think the author made a mistake as they are counting lists for Ivan and not Alexander.
Please help. Any new solution is also appreciated.