Lecture 5 - Relations - Relations(Computer Science Notes...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Relations (Computer Science Notes) Relations A relation R on a set A is a subset of A × A R is a set of ordered pairs of elements from A. If R contains the pair (x, y), we say that x is related to y, or xRy in shorthand. We’ll write x/Ry to mean that x is not related to y For example, suppose we let A = {2, 3, 4, 5, 6, 7, 8}. We can define a relation W on A by xWy if and only if x ≤ y ≤ x + 2. Then W contains pairs like (3, 4) and (4, 6), but not the pairs (6, 4) and (3, 6). Under this relation, each element of A is related to itself. So W also contains pairs like (5, 5) We can define another relation S on A by saying that xSy is in S if x ≡ y (mod 3) X Y Properties of Relations: Reflexive Reflexive: every element is related to itself, elements related to themselves have self- loops Irreflexive: no element is related to itself Neither reflexive nor irreflexive: some elements are related to themselves but some aren’t The familiar relations ≤ and = on the real numbers are reflexive, but < is irreflexive R is reflexive if xRx for all x A R is irreflexive if x/Rx for all x A not reflexive: there is an x A, x/Ry Symmetric and Antisymmetric
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/16/2011 for the course CS 173 taught by Professor Erickson during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 2

Lecture 5 - Relations - Relations(Computer Science Notes...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online