Number of ways of obtaining sum 0 using 1,-1

281 Views Asked by At

Number of ways of obtaining $0$ by summing only $1$ and $-1$ in ordered manner: Let $n$ represent the number of terms

  1. $n=2$: $(1,-1)$ and $(-1,1): 2$
  2. $n=4$: $8$
  3. $n=6$: ...

Is there a general formula?

1

There are 1 best solutions below

0
On

The number of terms must be even, so it’s more convenient to let $a_n$ be the number of such sequences with $2n$ terms. Clearly $n$ of the terms must be $1$ and the other $n$ must be $-1$, and they can occur in any order. Thus, there is one such sequence for each way of choosing $n$ of the $2n$ positions to be filled with $1$s. That number is simply the central binomial coefficient $\binom{2n}n$; for large $n$ this is approximately $\frac{4^n}{\sqrt{\pi n}}$.