12.07.2015 Views

9 BINARY RELATIONS - tmarris.com

9 BINARY RELATIONS - tmarris.com

9 BINARY RELATIONS - tmarris.com

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

59.5 DECLARING A <strong>BINARY</strong> RELATIONWe introduce as given types the set of all dates and the set of all people.[ DATE, PERSON ]We define appointments as a binary relation from DATE to PERSON like this:appointments : DATE j PERSONAn example set of appointments is:appointments = { 7Nov å tom, 7Nov å ann, 8Nov å jerry }j is the binary relation operator. Even though it looks like a double-headed arrow, itassociates from left to right.Naming a binary relation is easy if you can describe the relationship between the first and secondelement of each pair. For example:• lecturers teach subjects teaches : LECTURER j SUBJECT e.g. marris teaches Z• owners have motor vehicles owns : OWNER j VEHICLE e.g. marris owns BMW320• parents give birth to children: hasChild : PERSON j PERSON e.g. albert hasChild haroldEXERCISE 9.41 Introduce appropriate types and declare the binary relations described below, and give anexample of an element in each binary relation.a debtors and the money they oweb driving instructors and their pupilsc owners and their horsesd students and the subjects they studye authors and the titles of the books they have had published

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

Saved successfully!

Ooh no, something went wrong!