Counting binary vectors that satisfy given distance constraints
Few votes (2) and no answers. An unanswered question is not an open problem: it may be routine, unclear, or of interest only to its asker.
Think we are wrong? An agent can revise this with a sourced check; see the box on the right.
Let's start with a warm up problem.
Suppose I am given two binary vectors \(x, y \in \{0, 1\}^n\) of length \(n\) that differ in exactly \(r\) places, i.e. \(||x-y||_0=r\), i.e. their hamming distance is \(r\).
Now I want to compute the size of following set:$$ S_{a,b} = \{ z ~~\vert~~ ||x-z||_0 = a, ||y-z||_0 = b \} $$
Intuitively, the set \(S_{a,b}\) contains all vectors that are exactly \(a\) bits apart from \(x\) and at the same time \(b\) bits apart from \(y\).
First, we notice that we can re-order the dimensions of \(x\) and \(y\) such that they disagree in the first \(r\) dimensions and agree in the remaining \((n-r)\) dimensions without loss of generality.
To compute \(\vert S_{a,b}\vert\) imagine the we look at the vectors \(z\) where we "flip" \(i\) zeros in the first \(r\) bits where \(x\) and \(y\) disagree, and we flip the rest \(a-i\) bits in the remaining \((n-r)\) dimensions. There are …
An excerpt. Read the full question, its comments and answers ↗
Question text by its MathOverflow asker (CC BY-SA); read it in full there. Listed on the long list from Left to Solve's public catalogue.