0

In this answer, the following statement is made:

The number of binary strings of length $2n+1$ with at least $n+1$ ones is clearly $2^{2n}$.

Unfortunately, this isn't clear to me. I would think that the number of such strings is by choosing $n+1$ one's. Thus we have $${{2n+1}\choose{n+1}}2^n.$$

Where am I going wrong, and how can I think about this?

Shean
  • 1,022
  • 1
    If you choose $n+1$ slots out of $2n+1$, place ones on those and zeros elsewhere you get $\binom{2n+1}{n+1}$ strings. Where did that extra factor $2^n$ come from? You can't choose the remaining $n$ bits randomly, because you will be severely overcounting. – Jyrki Lahtonen Jan 03 '25 at 16:18
  • 6
    The claim in block quotes comes from the observation that if you look at any string and its bitwise complement, then exactly one of them will have a majority of ones. Therefore exactly one half of all the strings of $2n+1$ bits have at least $n+1$ ones. – Jyrki Lahtonen Jan 03 '25 at 16:20
  • 1
    That's a good way to think about it, thank you. So then would the formula be $$\sum_{k=n+1}^{2n+1}{{2n+1}\choose{k}}?$$ – Shean Jan 03 '25 at 16:23
  • 3
    Correct. And that sum simplifies to $2^{2n}$ by this argument. – Jyrki Lahtonen Jan 03 '25 at 16:25
  • In total, there are $2^{2n+1}$ strings. The number of strings containing at least $n+1$ ones = the number of strings containing at least $n+1$ zeros = the number of strings containing at most $n$ ones. Therefore what you need is exactly half of the total. – Yimin Jan 03 '25 at 16:28
  • Isn't it easier to say that each sequence either has n+1 ones or n+1 zeros, and these are in 1:1 relationship to each other, so we're looking at precisely half of all binary sequences? – Al.G. Jan 03 '25 at 16:28
  • 1
    Ok, I was thinking there was a middle term, but ${{2n+1}\choose{n}}={{2n+1}\choose{n+1}}$, so the sum breaks evenly. Back to Pascal's triangle for me! – Shean Jan 03 '25 at 16:34
  • Just a doubt! like for the first k =n+1 in summation its says to select n+1 places for 1 among 2n+1 and we all know that if the zero is in the first place of the binary sequence it doesnt really matter so we have to force that 1 must be at first place and take care of that other wise its just 2n terms rather than 2n+1, please correct me – Name not Allowed Jan 03 '25 at 16:42
  • It is literally just $\frac12$ of all words, and there are $2^{2n+1}$ binary strings of length $2n+1.$ – Thomas Andrews Jan 03 '25 at 16:46
  • @ThomasAndrews that I understood, but Isn't our selection of elements is wrong as 1 must be at first place of every sequence but this nCr isnt forcing that ? – Name not Allowed Jan 03 '25 at 16:48
  • A binary number must start with $1.$ The question is about binary strings. Different beast. $0011$ is a different binary string from $11.$ @NamenotAllowed – Thomas Andrews Jan 03 '25 at 16:50
  • @ThomasAndrews Thanks now my doubt is clear – Name not Allowed Jan 03 '25 at 16:52
  • 1
    The notion of a string is not often taught in beginning mathematics, but a string is just a finite sequence of elements of some alphabet set, $\Sigma.$ For binary strings, $\Sigma={0,1}.$ – Thomas Andrews Jan 03 '25 at 16:52

0 Answers0