Intersection of Hamming balls of boolean vectors I noticed that a similar question was asked with a little difference, an answer to this wasn't given certainly. Here is the problem: Given two Hamming balls of boolean vectors of size $n$ with centres $a$ and $b$ both with radius $r$ find the power of the set of their intersection, that is $|B(a, r)\cap B(b, r)|$ .By a boolean $n$-vector I mean a vector of length $n$ consisting only of $0$'s and $1$'s. I tried to get this number in a closed form but I think it's impossible, so the answer need not be in a closed form. And the Hamming distance between vectors $a$ and $b$ is $m$.
 A: Let's start with the intersection $S(a,r)\cap S(b,s)$ of two Hamming spheres.
We may assume that $a$ is the zero vector and $$b = (\underbrace{1,\ldots,1}_{m\text{ times}},\underbrace{0\,\ldots,0}_{n-m\text{ times}}).$$
We want to count the vectors $v$ which are at distance $r$ from $a$ and $s$ from $b$.
Distance $r$ from $a$ means that $v$ has exactly $r$ entries equal $1$.
Distance $s$ from $b$ gives that if in the first $m$ entries of $b$ there are exactly $i$ zeros (i.e. exactly $m-i$ ones), in the last $n-m$ entries there must be exactly $s-i$ ones.
So $(m - i) + (s-i) = r$, which implies that $m+s-r$ is even and $i = (m+s-r)/2$.
Hence
$$\left|S(a,r)\cap S(b,s)\right| = \begin{cases}0 & \text{if }m-(s+r)\text{ odd,}\\\binom{m}{(m+s-r)/2}\binom{n-m}{(m-s-r)/2}&\text{if }m\text{ even.}\end{cases}$$
Now we get the size of the intersection of the two Hamming balls as
$$\left|B(a,r)\cap B(b,r)\right| = \sum_{i=0}^r \sum_{\substack{j=0\\m+i-j\text{ even}}}^r \binom{m}{(m+i-j)/2}\binom{n-m}{(m-i-j)/2}.$$
