# permutations of binary sequences

What is the proof that there are $2^n$ distinct binary codes of length n I know this progression also applies to the decimal ($10^n$) and hex ($16^n$) systems but how can this be shown?

You have $n$ positions that can take the value $0$ or $1$. Then, you have two ways of filling the first position, two for the second.. etc... Hence the total number is $\underbrace {2 \times 2 \dots \times 2}_n = 2^n$.