Before you mark this as a duplicate, please read! I am having trouble understanding the concept (which I need more clarification on than is provided) rather than just the answer:
For any integer $n \ge 2$, let $S_n$ be the number of bitstrings of length $n$ in which the first bit is not equal to the last bit.
The answer is $2^{n-1}$
But why?
In my brain, when you say that the first and last bit are the same, that means you are going to set aside two bits and make sure they are equal, hence $2^{n-2}$. Since we want only the bitstrings that do not start and end with the same bit, we can subtract this from all possible bitstrings, so: $2^{n} - 2^{n-2}$. But this is wrong!
Similarly:
How many bitstrings of length $99$ are there that start with $1010$ and end with $1010$?
Is the answer for this $2^{99-4}$ like above, or is it $2^{99-8}$? If it is the latter, how come?
If you want to set the first and last bit to be the same, yes, set two bits aside, but you still have to decide for it whether you want both of them to be $1$ or $0$, there are $2$ options here.
Hence $$2^n-2\cdot 2^{n-2}=2^n-2^{n-1}=2^{n-1}$$
For your second question, it should be the latter. You remove the $8$ bits and there is no decision to be made for them.