# How many bit strings of length 8 begin and end with a 1?

A bit string is a finite sequence of $0$’s and $1$’s. How many bit strings of length $8$ begin and end with a $1$?

My answer would be: $2^6$. Because we know, that the bit starts with $1$ and ends with $1$: Which means, that $2$ of the length $8$ is used, also there are $6$ positions remaining, which is $2^6 = 64$.

Is this the correct answer?

• Convinces me at least. :-) – mvw Feb 7 '16 at 0:02
• That is correct. – Kaster Feb 7 '16 at 0:02
• If you want to be 100% sure, you know that there are $2^8$ strings total. By fixing the first you reduce by 1/2 and fixing the last by have again so you have $2^8/2^2 = 2^{8-2} = 2^6$. But seriously... you should be confident in stating that as you have 6 unfixed bits there are $2^6$ possibilities. You are dead to rights and should be confident in that. – fleablood Feb 7 '16 at 0:13

## 2 Answers

Yes the answer $2^6$ is correct. Two bits you know are $1$ already, so there are $8-2=6$ bits left. Each bit can either be a $0$ or a $1$, so you have $2$ possibilities for each slot. Hence, as you concluded correctly, you have $2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 = 2^6$ possible combinations for your string.

• Welcome to MathSE. Please read this tutorial on how to typeset mathematics on this site. – N. F. Taussig Feb 7 '16 at 0:11

Since there is one choice for the first position, one choice for the last position, and two choices for each of the six positions between them, the number of bit strings of length eight that begin and end with a $1$ is $2^6$, so your solution is correct.