Common problems combined count Summary

① $ a_1 + a_2 + \ dots + a_n = r $ of the stops.
$ a_i, r \ in \ mathbb {Z} _ {\ ge 0} $

Baffles law. $ \ Binom {n + r} {r} $

② $ a_1 + a_2 + \ dots + a_n \ le r $ of the stops.
$ a_i, r \ in \ mathbb {Z} _ {\ ge 0} $

$ a_1 + a_2 + \ dots + a_n \ le r $ and $ a_1 + a_2 + \ dots + a_n + a_ {n + 1} = r $ correspondence solution.
$ \ binom {n + r} {r} $

③ arranged offset number
satisfying the recurrence D_n = $ (n--. 1) (n-D_ {-}. 1 + n-D_ {- 2}) $
$ $ 0 = D_1, D_2 = $ $. 1.

④ $ a_1 + a_2 + \ dots + a_n \ le r $ and $ a_i \ le k $ of the stops.
Inclusion-exclusion principle.
$ A $ set so that represents all satisfied + a_2 + + a_n set $ a_1 \ dots \ le r $ sequence of.
$ $ A_i set so satisfied by $ a_1 + a_2 + \ dots + a_n \ le r $ and $ a_i> k $ a set of sequences.
For $ T \ sse \ {1, 2, \ dots, n \} $, defined $ A_T = \ cap_ {i \ in T} A_i $, then $ | A_T | = \ binom { n + r - | T | (k + 1)} {r - | T | (k + 1)} $.
The inclusion and exclusion, the answer is
$ \ sum_ {T \ in \ {1, \ dots, n \}} (-1) ^ {| T |} | A_T | = \ sum_ {i = 0} ^ {n} \ binom {n} {i} \ binom {n + r - i (k + 1)} {r - i (k + 1)} $.

Guess you like

Origin www.cnblogs.com/Patt/p/11817441.html