1

I don't understand how to interpret the left side. You can look at it as constructing a binary string by setting the first n ones in the first n+k spots and then appending an arbitrary string of length n-k but this doesn't count strings with less than n ones and this overcounts some strings.

  • Look at the first $n+1$ ones in the first $n+k+1$, including the last one. They are not double counted any more. – Empy2 Feb 01 '25 at 11:36

1 Answers1

4

Think about the binary strings of length $2n$ like this. Let $n+k+1$ be the first time there are $n+1$ '$0$'s or '$1$'s. This would mean that the $(n+k+1)^{th}$ element is exactly the element that has appeared $n+1$ times. Otherwise, it would not be the first time $n+1$ elements of this type has appeared. This could either be $0$ or $1$ ($2$ choices).
This means that $\binom{n+k}{n}$ is the number of ways of picking the other $n$ places where it appeared in the first $n+k$ positions ($\binom{n+k}{n}$ choices). The rest can be either $0$ or $1$, which gives $2^{n-k-1}$ choices.

We have not counted the case where both $0$ and $1$ appear exactly $n$ times. This is just $\binom{2n}{n}$. Summing gives us required identity.

Umesh Shankar
  • 3,391
  • 1
  • 6
  • 23