Notice the total hamming distance is the sum of the total hamming distance for each of the i-th bits separately. Total hamming distance for the i-th bit = (the number of zeros in the i-th position) * ...