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.

194 BINOMIAL COEFFICIENTS<br />

We can determine h(n, k) by noticing that it is the number of ways to<br />

choose k lucky hat owners, namely (L), times the number of ways to arrange<br />

the remaining n-k hats so that none of them goes to the right owner, namely<br />

h(n - k, 0). A permutation is called a derangement if it moves every item,<br />

and the number of derangements of n objects is sometimes denoted by the<br />

symbol ‘ni’, read “n subfactorial!’ There<strong>for</strong>e h(n - k, 0) = (n - k)i, and we<br />

have the general <strong>for</strong>mula<br />

h(n,k) =<br />

(Subfactorial notation isn’t standard, and it’s not clearly a great idea; but<br />

let’s try it awhile to see if we grow to like it. We can always resort to ‘D,’ or<br />

something, if ‘ni’ doesn’t work out.)<br />

Our problem would be solved if we had a closed <strong>for</strong>m <strong>for</strong> ni, so let’s see<br />

what we can find. There’s an easy way to get a recurrence, because the sum<br />

of h(n, k) <strong>for</strong> all k is the total number of permutations of n hats:<br />

n! = xh(n,k) = t ($(n-k)i<br />

k k<br />

integer n 3 0.<br />

(We’ve changed k to n - k and (,“,) to (L) in the last step.) With this<br />

implicit recurrence we can compute all the h(n, k)‘s we like:<br />

h(n, 0) h(n, 1) h(n,2) h(n,3) h(n,4) h(n,5) h(n, 6)<br />

0 1<br />

1 0 1<br />

2 3 0 1<br />

9 8 6 0 1<br />

20 10 0 1<br />

24645 2l 135 40 15 0 1<br />

For example, here’s how the row <strong>for</strong> n = 4 can be computed: The two rightmost<br />

entries are obvious-there’s just one way <strong>for</strong> all hats to land correctly,<br />

and there’s no way <strong>for</strong> just three fans to get their own. (Whose hat would the<br />

fourth fan get?) When k = 2 and k = 1, we can use our equation <strong>for</strong> h(n, k),<br />

giving h(4,2) = ($h(2,0) = 6.1 = 6, and h(4,l) = (;)h(3,0) = 4.2 = 8. We<br />

can’t use this equation <strong>for</strong> h(4,O); rather, we can, but it gives us h(4,O) =<br />

(;)h(4,0), w h’ rc h is . true<br />

but useless. Taking another tack, we can use the<br />

The art of math-<br />

ematics, as of life,<br />

relation h(4,O) + 8 + 6 + 0 + 1 = 4! to deduce that h(4,O) = 9; this is the value is knowing which<br />

of 4i. Similarly ni depends on the values of ki <strong>for</strong> k < n. truths are useless.

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

Saved successfully!

Ooh no, something went wrong!