# How many strings of n bits are there which differ by exactly m bits?

For example:
If n = 8 and m = 0: ans = 1
If n = 8 and m = 1: ans = 8
If n = 8 and m = 2: ans = ?
If n =256 and m = 3: ans = ?

• Isn't this just $n\choose m$? Perhaps I am misinterpreting the question.. – John Doe Jan 7 at 19:30

Just choose the $$m$$ bits out of $$n$$ to be different, so $$n \choose m$$