Relations on Sets - PowerPoint PPT Presentation

1 / 15
About This Presentation
Title:

Relations on Sets

Description:

In our earlier example, the relation R would be the set ... It is mainly done just to point out that a function is only one type of relation. ... – PowerPoint PPT presentation

Number of Views:238
Avg rating:3.0/5.0
Slides: 16
Provided by: alliso80
Category:

less

Transcript and Presenter's Notes

Title: Relations on Sets


1
Section 10.1
  • Relations on Sets

2
What Is a Relation?
  • There are lots of kinds of relationships in the
    world some between people, some between
    objects.
  • Were going to discuss the relationship between
    objects in sets.
  • Well define a relationship.
  • Then we can figure out whether two objects have
    the relationship were looking for or not.

3
Example of a Relation
  • Let A 1, 3, 5 and B 2, 4, 6. Let us say
    that an element x in A is related to an element y
    in B if x lt y. Well write x R y as shorthand
    for x is related to y. Then
  • 1 lt 2, so 1 R 2
  • 1 lt 4, so 1 R 4
  • 1 lt 6, so 1 R 6
  • and so on..

4
Example of a Relation
  • We use x R y to say that x is not related to y in
    the way we desire. So here,
  • 3 R 2 because 3 lt 2
  • 5 R 2 because 5 lt 2
  • 5 R 4 because 5 lt 4
  • and so on..

5
Example of a Relation
  • Recall that the Cartesian product
  • A x B (a, b) a ? A and b ? B.
  • The set of ordered pairs (a, b) such that a R b
    is a subset of A x B
  • (1, 2), (1, 4), (1, 6), (3, 4), (3, 6), (5, 6).

6
Definition of Relation
  • Let A and B be sets. A relation R from A to B is
    a subset of A x B.
  • Given an ordered pair (x, y) in A x B, x is
    related to y by R, written x R y, if, and only
    if, (x, y) is in R.
  • Symbolically, x R y ? (x, y) ? R and x R y ? (x,
    y) ? R
  • In our earlier example, the relation R would be
    the set
  • (1, 2), (1, 4), (1, 6), (3, 4), (3, 6), (5, 6).

7
Another Relation
  • Let A and B be Z and define a binary relation O
    from A to B as follows
  • for all (m, n) ? Z x Z, m O n ? m-n is odd.
  • In other words,
  • O (m, n) m and n are integers and m-n is odd
  • Then 3 O 0, 2 O 5, and 4 O 3, but 4 O 2.

8
Another Relation
  • Let ? x, y and define a binary relation R
    from ?3 to ?3 as follows For all strings s and t
    in ?3, s R t ? the last character of s is the
    same as the last character of t.
  • xyy R yxy
  • xyx R xxx
  • xyx R xyy

9
Functions and Relations
  • A function F from a set A to a set B is a
    relation from A to B that satisfies the following
    two properties
  • For every element x in A, there is an element y
    in B such that (x, y) ? F.
  • For all elements x in A and y and z in B, if (x,
    y) ? F and (x, z) ? F, then x z.

10
So.What Is This New Definition?
  • Its really the same definition that we had for
    functions before recast in terms of relations.
    It is mainly done just to point out that a
    function is only one type of relation.
  • Everything that was a function before you saw
    this definition is still a function.
  • If something was not a function before, then it
    is not a function now.

11
The Inverse of a Relation
  • Here we dont need the same sort of restrictions
    we see with functions (where you need a bijection
    in order to have an inverse).
  • Why not? If were looking at a relation from A
    to B, then
  • not every element x of A needs to have an element
    y such that x R y and
  • any element x in A can be related to more than
    one element of B.

12
The Inverse of a Relation
  • Let R be a relation from A to B. Define the
    inverse relation R-1 from B to A as follows
  • R-1 (y, x)? B x A(x, y) ? R.

13
Example
  • Find the inverse of the relation we considered at
    the beginning of class. So. let A 1, 3, 5
    and B 2, 4, 6, and let us say that x R y if x
    lt y. Recall that
  • R (1, 2), (1, 4), (1, 6), (3, 4), (3, 6), (5,
    6).
  • Then R-1 is a relation from B to A defined as
    follows y R x if y gt x. Thus,
  • R-1 (2, 1), (4, 1), (6, 1), (4, 3), (6, 3),
    (6, 5).

14
N-ary Relations and Relational Databases
  • Given sets A1, A2, , An, an n -ary relation R on
    A1 x A2 x x An is a subset of A1 x A2 x x An.
  • These are used to keep track of information that
    has more than one component in databases (i.e.,
    records at a hospital).

15
What Is Coming Up
  • On Fridays class, we will cover Section 10.2
    reflexivity, symmetry, and transitivity.
  • On Mondays class, we will have a review session
    for the final (our final is the 29th from
    8-1050). I will include suggested problems for
    Chapter 10 in the review material. A review
    sheet will be posted to our web site.
  • On Wednesdays class and next Fridays class if
    necessary, we will cover Section 10.3
    (equivalence relations).
  • With any remaining time, I will discuss how this
    class ties into CS3500 (Theory I).
Write a Comment
User Comments (0)
About PowerShow.com