{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

MIT6_042JF10_lec07

# MIT6_042JF10_lec07 - "mcs-ftl 2010/9/8 0:40 page 213#219 7...

This preview shows pages 1–3. Sign up to view the full content.

7 “mcs-ftl” — 2010/9/8 — 0:40 — page 213 — #219 Relations and Partial Orders A relation is a mathematical tool for describing associations between elements of sets. Relations are widely used in computer science, especially in databases and scheduling applications. A relation can be defined across many items in many sets, but in this text, we will focus on binary relations, which represent an association between two items in one or two sets. 7.1 Binary Relations 7.1.1 Definitions and Examples Definition 7.1.1. Given sets A and B , a binary relation R W A ! B from 1 A to B is a subset of A ± B . The sets A and B are called the domain and codomain of R , respectively. We commonly use the notation aRb or a ² R b to denote that .a; b/ 2 R . A relation is similar to a function. In fact, every function f W A ! B is a rela- tion. In general, the difference between a function and a relation is that a relation might associate multiple elements of B with a single element of A , whereas a func- tion can only associate at most one element of B (namely, f .a/ ) with each element a 2 A . We have already encountered examples of relations in earlier chapters. For ex- ample, in Section 5.2 , we talked about a relation between the set of men and the set of women where mRw if man m likes woman w . In Section 5.3 , we talked about a relation on the set of MIT courses where c 1 Rc 2 if the exams for c 1 and c 2 cannot be given at the same time. In Section 6.3 , we talked about a relation on the set of switches in a network where s 1 Rs 2 if s 1 and s 2 are directly connected by a wire that can send a packet from s 1 to s 2 . We did not use the formal definition of a relation in any of these cases, but they are all examples of relations. As another example, we can define an “in-charge-of” relation T from the set of MIT faculty F to the set of subjects in the 2010 MIT course catalog. This relation contains pairs of the form . h instructor-name i ; h subject-num i / 1 We also say that the relationship is between A and B , or on A if B D A .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
214 “mcs-ftl” — 2010/9/8 — 0:40 — page 214 — #220 Chapter 7 Relations and Partial Orders (Meyer, 6.042), (Meyer, 18.062), (Meyer, 6.844), (Leighton, 6.042), (Leighton, 18.062), (Freeman, 6.011), (Freeman, 6.881) (Freeman, 6.882) (Freeman, 6.UAT) (Eng, 6.UAT) (Guttag, 6.00) Figure 7.1 Some items in the “in-charge-of” relation T between faculty and sub- ject numbers. where the faculty member named h instructor-name i is in charge of the subject with number h subject-num i . So T contains pairs like those shown in Figure 7.1 . This is a surprisingly complicated relation: Meyer is in charge of subjects with three numbers. Leighton is also in charge of subjects with two of these three numbers—because the same subject, Mathematics for Computer Science, has two numbers (6.042 and 18.062) and Meyer and Leighton are jointly in-charge-of the subject. Freeman is in-charge-of even more subjects numbers (around 20), since as Department Education Officer, he is in charge of whole blocks of special sub- ject numbers. Some subjects, like 6.844 and 6.00 have only one person in-charge.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}