06.03.2017 Views

Mathematics for Computer Science

e9ck2Ar

e9ck2Ar

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

“mcs” — 2017/3/3 — 11:21 — page 599 — #607<br />

15.2. Counting Sequences 599<br />

15.2.1 The Product Rule<br />

The Product Rule gives the size of a product of sets. Recall that if P 1 ; P 2 ; : : : ; P n<br />

are sets, then<br />

P 1 P 2 P n<br />

is the set of all sequences whose first term is drawn from P 1 , second term is drawn<br />

from P 2 and so <strong>for</strong>th.<br />

Rule 15.2.1 (Product Rule). If P 1 ; P 2 ; : : : P n are finite sets, then:<br />

jP 1 P 2 P n j D jP 1 j jP 2 j jP n j<br />

For example, suppose a daily diet consists of a breakfast selected from set B, a<br />

lunch from set L, and a dinner from set D where:<br />

B D fpancakes; bacon and eggs; bagel; Doritosg<br />

L D fburger and fries; garden salad; Doritosg<br />

D D fmacaroni; pizza; frozen burrito; pasta; Doritosg<br />

Then BLD is the set of all possible daily diets. Here are some sample elements:<br />

.pancakes; burger and fries; pizza/<br />

.bacon and eggs; garden salad; pasta/<br />

.Doritos; Doritos; frozen burrito/<br />

The Product Rule tells us how many different daily diets are possible:<br />

jB L Dj D jBj jLj jDj<br />

15.2.2 Subsets of an n-element Set<br />

D 4 3 5<br />

D 60:<br />

The fact that there are 2 n subsets of an n-element set was proved in Theorem 4.5.5<br />

by setting up a bijection between the subsets and the length-n bit-strings. So the<br />

original problem about subsets was tran<strong>for</strong>med into a question about sequences—<br />

exactly according to plan! Now we can fill in the missing explanation of why there<br />

are 2 n length-n bit-strings: we can write the set of all n-bit sequences as a product<br />

of sets:<br />

f0; 1g n WWD f0; 1g f0; 1g f0; 1g :<br />

„ ƒ‚ …<br />

n terms<br />

Then Product Rule gives the answer:<br />

jf0; 1g n j D jf0; 1gj n D 2 n :

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

Saved successfully!

Ooh no, something went wrong!