I have two algorithms that solve this problem: Generate all sequences of bits within Hamming distance t. Now I want to compare them theoretically (I do have time measurements, i
At the most general level of time complexity, we have a "worst case" of t = n/2. Now, fix t and gradually increment n. Let's take a starting point of n=8, t=4
C(8 4) = 8*7*6*5*4*3*2*1 / (4*3*2*1 * 4*3*2*1)
= 8*7*6*5 / 24
n <= n+1 ... n choose t is now
C(9 4) = ...
= 9*8*7*6 / 24
= 9/5 of the previous value.
Now, the progression is a little easier to watch.
C( 8 4) = 8*7*6*5 / 24
C( 9 4) = 9/5 * C( 8 4)
C(10 4) = 10/6 * C( 9 4)
C(11 4) = 11/7 * C(10 4)
...
C( n 4) = n/(n-4) * C(n-1 4)
Now, as lemmas for the student: