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 200 — #208<br />

200<br />

Chapter 6<br />

State Machines<br />

To prove this, we begin with a definition: a state machine has commuting transitions<br />

if <strong>for</strong> any states p; q; r,<br />

.p ! q AND p ! r/ IMPLIES 9t: q ! t AND r ! t:<br />

(a) Verify that the Flexible Mating Ritual has commuting transitions.<br />

(b) Now conclude from Problem 6.29 that the Flexible Mating Ritual always terminate<br />

with the same set of stable marriages as the day-by-day Ritual.<br />

Exam Problems<br />

Problem 6.31.<br />

Four un<strong>for</strong>tunate children want to be adopted by four foster families of ill repute.<br />

A child can only be adopted by one family, and a family can only adopt one child.<br />

Here are their preference rankings (most-favored to least-favored):<br />

Child<br />

Bottlecap:<br />

Lucy:<br />

Dingdong:<br />

Zippy:<br />

Family<br />

Grinches:<br />

Hatfields:<br />

Scrooges:<br />

McCoys:<br />

Families<br />

Hatfields, McCoys, Grinches, Scrooges<br />

Grinches, Scrooges, McCoys, Hatfields<br />

Hatfields, Scrooges, Grinches, McCoys<br />

McCoys, Grinches, Scrooges, Hatfields<br />

Children<br />

Zippy, Dingdong, Bottlecap, Lucy<br />

Zippy, Bottlecap, Dingdong, Lucy<br />

Bottlecap, Lucy, Dingdong, Zippy<br />

Lucy, Zippy, Bottlecap, Dingdong<br />

(a) Exhibit two different stable matching of Children and Families.<br />

Family Child in 1st match Child in 2nd match<br />

Grinches:<br />

Hatfields:<br />

Scrooges:<br />

McCoys:<br />

(b) Examine the matchings from part a, and explain why these matchings are the<br />

only two possible stable matchings between Children and Families.<br />

Hint: In general, there may be many more than two stable matchings <strong>for</strong> the same<br />

set of preferences.

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

Saved successfully!

Ooh no, something went wrong!