O'Reilly logo

Art of Computer Programming, Volume 4A, The: Combinatorial Algorithms, Part 1 by Donald E. Knuth

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

(b) The hinted labeling, call it P(c), has 1s on the path corresponding to c, and 0s elsewhere; thus it is balanced. The general animating function can be written

Image

so it is balanced if and only if cm = 0.

[Incidentally, the set S = {P(0)} {P(k) P(k + 2e) | k ≥ 0 and 2e > k} provides an interesting basis for all possible balanced labelings: A labeling is balanced if and only if it is {q | q Q} for some Q S. This exclusive-or operation is well defined even though Q might be infinite, because only finitely many 1s appear at each node.]

(c) The function P(c) in (b) has this form, because xP(c) = x x c. Its inverse, xS(c) = ((x c) + ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required