Relations - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Relations

Description:

Binary Relations ... Such relations play a central role in relational database theory. n-ary relations can be represented as hypergraphs (not a handy visualization) ... – PowerPoint PPT presentation

Number of Views:100
Avg rating:3.0/5.0
Slides: 10
Provided by: peterca3
Category:
Tags: relations

less

Transcript and Presenter's Notes

Title: Relations


1
Relations
2
Ordered Pairs
  • An ordered pair is like a set of 2 elements
    except that order matters (a, b) ? (b, a).
  • Let X Y be sets.
  • The Cartesian product or cross product denoted
  • X ? Y (x, y) x ? X, y ? Y.
  • A binary relation on X to Y is a subset of X ? Y.

3
Ordered Pairs ...
  • Example C (x, y) x,y ?R, x2 y2 lt 1.
  • Is C a relation?
  • If so, on what 2 sets?
  • Describe in English the relationship between x
    and y.
  • Example G (1, 17), (56, 100003) is a
    relation on N ? N.
  • The mathematical definition of relation does not
    require that the ordered pairs have any
    meaningful relationship.

4
Binary Relations
  • Example Let T a, b, c, d, e, f be the set of
    positions on a circuit board where chips are
    placed.
  • Draw a line between any 2 positions whose chips
    are connected by a wire.
  • The set C of ordered pairs of chips that are
    connected by a wire is a relation on T ? T

5
Circuit board example ...
  • (a, b), (b, a),
  • (b, c), (c, b),
  • (b, d), (d, b),
  • (c, d), (d, c),
  • (d, f), (f, d)
  • In this relation, if (x, y) ? C then (y, x) ? C.
  • Such a relation is called symmetric.
  • A relation that is not symmetric is called
    asymmetric.

6
Circuit board example ...
  • If, in the circuit board example, the chips were
    diodes and current runs in only 1 direction, then
    another relation could be the set of ordered
    pairs of chips (x, y) where current runs from x
    to y.
  • Would this relation be symmetric?

7
Antisymmetric
  • A binary relation R ? A?A is antisymmetric when
    aRb ? bRa ? a b.
  • For numbers, which are antisymmetric?
  • a ? b
  • a lt b
  • For sets, which are antisymmetric?
  • A ? B
  • A ? B
  • Is there a difference between asymmetry and
    antisymmetry?

8
Binary relations represented as graphs
  • Turning things around
  • Given a binary relation B ? X ? Y, represent B as
    a directed graph G (X?Y, B)
  • the nodes of the G are the elements of X Y
  • there is an arc from x to y if (x, y) ? B.

9
N-ary Relations
  • Cartesian products are extended to n sets
  • Y X1 ? X2 ? ? Xn.
  • A subset of Y is an n-ary relation.
  • Such relations play a central role in relational
    database theory.
  • n-ary relations can be represented as hypergraphs
    (not a handy visualization).
Write a Comment
User Comments (0)
About PowerShow.com