Mathematics for Computer Science
e9ck2Ar
e9ck2Ar
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
“mcs” — 2017/3/3 — 11:21 — page 601 — #609<br />
15.3. The Generalized Product Rule 601<br />
Thus, the length-six passwords are in the set F S 5 , the length-seven passwords<br />
are in F S 6 , and the length-eight passwords are in F S 7 . Since these sets<br />
are disjoint, we can apply the Sum Rule and count the total number of possible<br />
passwords as follows:<br />
j.F S 5 / [ .F S 6 / [ .F S 7 /j<br />
D jF S 5 j C jF S 6 j C jF S 7 j<br />
D jF j jSj 5 C jF j jSj 6 C jF j jSj 7<br />
D 52 62 5 C 52 62 6 C 52 62 7<br />
1:8 10 14 different passwords:<br />
Sum Rule<br />
Product Rule<br />
15.3 The Generalized Product Rule<br />
In how many ways can, say, a Nobel prize, a Japan prize, and a Pulitzer prize be<br />
awarded to n people? This is easy to answer using our strategy of translating the<br />
problem about awards into a problem about sequences. Let P be the set of n people<br />
taking the course. Then there is a bijection from ways of awarding the three prizes<br />
to the set P 3 WWD P P P . In particular, the assignment:<br />
“Barack wins a Nobel, George wins a Japan, and Bill wins a Pulitzer prize”<br />
maps to the sequence .Barack; George; Bill/. By the Product Rule, we have jP 3 j D<br />
jP j 3 D n 3 , so there are n 3 ways to award the prizes to a class of n people. Notice<br />
that P 3 includes triples like .Barack; Bill; Barack/ where one person wins more<br />
than one prize.<br />
But what if the three prizes must be awarded to different students? As be<strong>for</strong>e,<br />
we could map the assignment to the triple .Bill; George; Barack/ 2 P 3 . But this<br />
function is no longer a bijection. For example, no valid assignment maps to the<br />
triple .Barack; Bill; Barack/ because now we’re not allowing Barack to receive two<br />
prizes. However, there is a bijection from prize assignments to the set:<br />
S D f.x; y; z/ 2 P 3 j x, y and z are different peopleg<br />
This reduces the original problem to a problem of counting sequences. Un<strong>for</strong>tunately,<br />
the Product Rule does not apply directly to counting sequences of this type<br />
because the entries depend on one another; in particular, they must all be different.<br />
However, a slightly sharper tool does the trick.