[Math] How many bits strings are there of length n consisting entirely of 1’s

combinatorics

I've seen this question in a discrete maths text book :

How many bits strings are there of length n consisting entirely of 1's
? and the answer is :

Answer for that question is :

n+1 (including empty string )

What is empty string here? Why isn't 'n' is the answer?

And for another question :

How many bit strings of length n, where n is a positive integer, start
and end with 1?

The answer is :

2^(n-2)

Why the answer is not 2^(n-2) +1 ? ( As said in previous question about adding empty string )

Best Answer

The book probably thinks:

  • Every bit in an empty string is a $1$

  • The empty string does not start (or end) with a $1$

The first question may have been about strings of length up to $n$. It is certainly true that the empty string has no bits which are not $1$.

For the second I would give the answer $0$ for $n=0$ and the answer $1$ for $n=1$, as I would argue that the single bit string 1 both starts and ends with a $1$ and so should be counted.