Let $ b_0 $ be a length $ n $ bit string of Hamming weight $ w_0 $. The sum $$ \sum_{wt(b)=w} (-1)^{b ~\cdot~ b_0} $$ over all length $ n $ bit strings $ b $ of some fixed Hamming weight $ w $ has $ \binom{n}{w} $ many terms. I would like a formula to compute this in a happier/ more efficient way. I've derived and used this formula successfully for the case of $ w_0< w $ $$ \sum_{wt(b)=w} (-1)^{b ~\cdot~ b_0}= \sum_{k=0}^{w_0} (-1)^k \binom{w_0}{k} \binom{n-w_0}{w-k} $$ where we think of $ k $ as the number of places in which each bit string $ b $ over laps with the fixed bit string $ b_0 $. Is this formula correct? Does anyone know any other/ better formulas? How do I generalize this formula for the case $ w_0> w $?
Is there a nice way to think of this in terms of inner products on binary vector spaces?