09.12.2012 Views

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

Concrete mathematics : a foundation for computer science

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

140 NUMBER THEORY<br />

The problem of counting these configurations was first solved by P. A. Mac-<br />

Mahon in 1892 [212].<br />

There’s no obvious recurrence <strong>for</strong> N (m, n), but we can count the necklaces<br />

by breaking them each into linear strings in m ways and considering the<br />

resulting fragments. For example, when m = 4 and n = 2 we get<br />

RRRR RRRR RRRR RRRR<br />

RRBR RRRB BRRR RBRR<br />

RBBR RRBB BRRB BBRR<br />

RBRB BRBR RBRB BRBR<br />

RBBB BRBB BBRB BBBR<br />

BBBB BBBB BBBB BBBB<br />

Each of the nm possible patterns appears at least once in this array of<br />

mN(m,n) strings, and some patterns appear more than once. How many<br />

times does a pattern a~. . . a,,-, appear? That’s easy: It’s the number of<br />

cyclic shifts ok . . . a,-, a0 . . . ok-1 that produce the same pattern as the original<br />

a0 . . . a,-, . For example, BRBR occurs twice, because the four ways to<br />

cut the necklace <strong>for</strong>med from BRBR produce four cyclic shifts (BRBR, RBRB,<br />

BRBR, RBRB); two of these coincide with BRBR itself. This argument shows<br />

that<br />

mN(m,n) = t<br />

q,,...,a,e,ES, O$k

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!