2
$\begingroup$

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?

| cite | improve this question | | | | |
$\endgroup$
  • 1
    $\begingroup$ Convinces me at least. :-) $\endgroup$ – mvw Feb 7 '16 at 0:02
  • 2
    $\begingroup$ That is correct. $\endgroup$ – Kaster Feb 7 '16 at 0:02
  • 1
    $\begingroup$ 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. $\endgroup$ – fleablood Feb 7 '16 at 0:13
2
$\begingroup$

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.

| cite | improve this answer | | | | |
$\endgroup$
  • 1
    $\begingroup$ Welcome to MathSE. Please read this tutorial on how to typeset mathematics on this site. $\endgroup$ – N. F. Taussig Feb 7 '16 at 0:11
1
$\begingroup$

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.

| cite | improve this answer | | | | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.