Re:From Tower of Hanoi to Counting Bits (2011)
by tromp on Monday March 02, 2020 @03:51AM
(#22462757)
I never constructed a proof either, but it would rest on the observation that the i'th smallest disc (i=1..no_of_discs)
moves every 2^i-th step in the same direction (+1 mod 3 for odd i and -1 mod 3 for even i).
Eh?
> We will be dealing with arbitrary precision integers (bignums) in the problem, so let us also make a few assumptions:
> Addition or subtraction of an m-bit integer and an n-bit integer (m <= n) takes O(n) time.
> Counting the number of 1-bits in an n-bit integer takes O(n) time.