Relations, operations, structures
description
Transcript of Relations, operations, structures
![Page 1: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/1.jpg)
Relations, operations, structures
![Page 2: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/2.jpg)
Motivation
• To evidence memners of some set of objects including its attributes (see relational databases)
• For evidence relations between members of some set
![Page 3: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/3.jpg)
Definition
• Relation among sets A1,A2,…,An is any subset of cartesian product A1xA2x…xAn.
• n-ntuple relation on set A is a subset of cartesian product AxAx…xA.– Unary relation – attribut of the item– Binary relation – relation between items
![Page 4: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/4.jpg)
Relation types
• Reflexive relation: for any x from A holds x R x
• Symetrical relation: for any x,y from A holds: if x R y, then y R x
• Transitive relation: for any x,y,z from A holds: if x R y and y R z, then x R z
![Page 5: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/5.jpg)
Relation types
• Non symetric relation: there exist at leat one pair x,y from A so that x R y, but not y R x
• Antisymetric relation: for any x,y from A holds: if x R y and y R x, then x=y
• Asymetric relation: for any x,y from A holds: if x R y, then not y R x
![Page 6: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/6.jpg)
Ralation completness
• Complete relation: for any x,y from A either x R y, or y R x
• Weakly complete relation: for any different x,y from A either x R y, or y R x
![Page 7: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/7.jpg)
Equivalence
• Relation– Reflexive– Symetrical– Tranzitive
• Divides the set into classes of equivalence
![Page 8: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/8.jpg)
Ordering
• Quasiordering– Reflexive– Tranzitive
• Partial ordering– Reflexive– Tranzitive– Antisymetrical
![Page 9: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/9.jpg)
Ordering
• Weak ordering– Reflexive– Tranzitive– Complete
• (Complete) ordering– Reflexive– Tranzitive– Antisymetrical– Complete
![Page 10: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/10.jpg)
Uspořádání
![Page 11: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/11.jpg)
Crisp ordering
• Crisp partial ordering• Crisp weak ordering• crisp (complete) ordering– Not reflexive
![Page 12: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/12.jpg)
Relation recording
• Items enumeration:• {(Omar,Omar), (Omar,Ramazan),
(Omar,Kadir), (Omar,Turgut), (Omar,Fatma), (Omar,Bulent), (Ramazan,Ramazan), (Ramazan,Kadir), (Ramazan,Turgut), (Ramazan,Bulent), (Kadir,Kadir), (Kadir,Bulent), (Turgut,Turgut), (Turgut,Bulent), (Fatma,Fatma), (Fatma,Bulent), (Bulent,Bulent)}.
![Page 13: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/13.jpg)
Relation recording
• TableOmar Ramazan Kadir Turgut Fatma Bulent
Omar 1 1 1 1 1 1Ramazan 0 1 1 1 0 1Kadir 0 0 1 1 0 1Turgut 0 0 1 1 0 1Fatma 0 0 0 0 1 1Bulent 0 0 0 0 0 1
![Page 14: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/14.jpg)
Relation graph
![Page 15: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/15.jpg)
Hasse diagram
• Only for transitive relation
![Page 16: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/16.jpg)
Operation
• Prescription for 2 or more items to find one result
• n-nary operation on the set A is (n+1)-nary relation on the set A so that if (x1,x2,…xn,y) is in the relation and a (x1,x2,…,xn,z) is in the relation then y=z.
![Page 17: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/17.jpg)
Operation -arity
• 0 (constante)• 1 (function)• 2 (classical operation)• 3 or more
![Page 18: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/18.jpg)
Attributes of binary operations
• Complete: for any x,y there exist x y⊕• Comutative: x y = y x⊕ ⊕• Asociative: (x y) z = x (y z)⊕ ⊕ ⊕ ⊕• Neutral item: there exist item ε, so that
x⊕ε = ε x = x⊕• Inverse items: for any x there exist y, so that
x y = ⊕ ε
![Page 19: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/19.jpg)
Algebra
• Set• System of operations• Systém of attributes (axioms), for these
operations
![Page 20: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/20.jpg)
Semigroup, monoid
• Arbitary set• Operation ⊕– Semigroup• Complete• Asociative
– Monoid• Complete• Asociative• With neutral item
![Page 21: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/21.jpg)
Group
• Operation ⊕– Complete– Asocoative– With neutral item– With inverse items
• Abel group– Comutative
![Page 22: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/22.jpg)
Group examples
• Integers and adding• Non zero real numbers and multipling• Permutation of the finite set• Matrices of one size• Moving of Rubiks cube
![Page 23: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/23.jpg)
Ring
• Set with 2 operations and – By the operation it is an o Abel group– Operation is complete, comutative, asociate, with
neutral item• Inverse items does not need to exist to the operation
– distributive: x (y z)=(x y) ( y z)• Examples– Integers and addind, multipling– Modular classes of integers with the number n.
![Page 24: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/24.jpg)
Division ring
• Set T with 2 operation and – T and forms Abel group with neutral item ε– T-{ε} and forms Abel group
• In addition to a ring there is a need of existence of the inverse items to (it means „posibility of dividing“)
• Examples: fractions, real numbers, complex numbers, modular class by dividing with the prime number p, logical operations AND and OR
![Page 25: Relations, operations, structures](https://reader035.fdocuments.us/reader035/viewer/2022081514/56814793550346895db4c4a5/html5/thumbnails/25.jpg)
Lattice• Set S with 2 operations (union) and (intersect)– and are comutative and asociative– Holds distributive rules
• a (b c) = (a b) (a c)• a (b c) = (a b) (a c)
– Absorbtion: a (b a)=a, a (b a)=a– Idenpotence a a = a, a a = a
• Examples– Propositional calculus and logical operators AND and OR– Subsets of given set and operations of union and
intersection– Members of partialy ordered set and operations of
supremum and infimum.