relations
play

Relations Aritra Hazra Department of Computer Science and - PowerPoint PPT Presentation

Relations Aritra Hazra Department of Computer Science and Engineering, Indian Institute of Technology Kharagpur, Paschim Medinipur, West Bengal, India - 721302. Email: aritrah@cse.iitkgp.ac.in Autumn 2020 Aritra Hazra (CSE, IITKGP) CS21001 :


  1. Relations Aritra Hazra Department of Computer Science and Engineering, Indian Institute of Technology Kharagpur, Paschim Medinipur, West Bengal, India - 721302. Email: aritrah@cse.iitkgp.ac.in Autumn 2020 Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 1 / 12

  2. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  3. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  4. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  5. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  6. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Note that, A × B � = B × A , but |A × B| = |A||B| = |B × A| . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  7. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Note that, A × B � = B × A , but |A × B| = |A||B| = |B × A| . Other Properties: Let A , B , C ∈ U (i) A × φ = φ × A = φ Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  8. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Note that, A × B � = B × A , but |A × B| = |A||B| = |B × A| . Other Properties: Let A , B , C ∈ U (i) A × φ = φ × A = φ (ii) A × ( B ∩ C ) = ( A × B ) ∩ ( A × C ) (iii) A × ( B ∪ C ) = ( A × B ) ∪ ( A × C ) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  9. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Note that, A × B � = B × A , but |A × B| = |A||B| = |B × A| . Other Properties: Let A , B , C ∈ U (i) A × φ = φ × A = φ (ii) A × ( B ∩ C ) = ( A × B ) ∩ ( A × C ) (iii) A × ( B ∪ C ) = ( A × B ) ∪ ( A × C ) (iv) ( A ∩ B ) × C = ( A × C ) ∩ ( B × C ) (v) ( A ∪ B ) × C = ( A × C ) ∪ ( B × C ) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  10. Cartesian Product Definition: Cartesian Product or Cross Product of two sets, A and B , denoted as A × B , is defined by, A × B = { ( a , b ) | a ∈ A , b ∈ B} Generically, A 1 × A 2 × · · · × A k = { ( x 1 , x 2 , . . . , x k ) | ∀ i , x i ∈ A i } Ordered Pairs: The elements of ( A × B ) are called ordered pairs. Generically, the elements, ( x 1 , x 2 , . . . , x k ) ∈ A 1 × A 2 × · · · × A k ( k -fold Cartesian product), are called ordered k -tuples. Cardinality: Let, |A 1 | = n 1 , |A 2 | = n 2 , . . . , |A k | = n k . Then, |A 1 × A 2 × · · · × A k | = |A 1 ||A 2 | · · · |A k | = n 1 n 2 · · · n k . Properties: For ( a , b ) , ( c , d ) ∈ A × B , we have ( a , b ) = ( c , d ) if and only if a = b and c = d . Note that, A × B � = B × A , but |A × B| = |A||B| = |B × A| . Other Properties: Let A , B , C ∈ U (i) A × φ = φ × A = φ (ii) A × ( B ∩ C ) = ( A × B ) ∩ ( A × C ) (iii) A × ( B ∪ C ) = ( A × B ) ∪ ( A × C ) (iv) ( A ∩ B ) × C = ( A × C ) ∩ ( B × C ) (v) ( A ∪ B ) × C = ( A × C ) ∪ ( B × C ) (vi) ( A − B ) × C = ( A × C ) − ( B × C ) (vii) A × ( B − C ) = ( A × B ) − ( A × C ) Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 2 / 12

  11. Relations and Examples (Binary) Relation Definition: A (binary) relation, ρ , between two sets, A and B , is defined as, ρ ⊆ A × B . If an ordered pair, ( a , b ) ∈ ρ (or a ρ b ), then the element, a ∈ A , is said to be related to the element, b ∈ B . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 12

  12. Relations and Examples (Binary) Relation Definition: A (binary) relation, ρ , between two sets, A and B , is defined as, ρ ⊆ A × B . If an ordered pair, ( a , b ) ∈ ρ (or a ρ b ), then the element, a ∈ A , is said to be related to the element, b ∈ B . Any subset of ( A × A ) (or A 2 ) is called a relation on A . The relation, ρ = A × B , is called the universal relation . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 12

  13. Relations and Examples (Binary) Relation Definition: A (binary) relation, ρ , between two sets, A and B , is defined as, ρ ⊆ A × B . If an ordered pair, ( a , b ) ∈ ρ (or a ρ b ), then the element, a ∈ A , is said to be related to the element, b ∈ B . Any subset of ( A × A ) (or A 2 ) is called a relation on A . The relation, ρ = A × B , is called the universal relation . Count: Total number of (binary) relations between two sets, A and B (where, |A| = m and |B| = n ), is the number of possible subsets of ( A × B ), i.e. 2 mn . Aritra Hazra (CSE, IITKGP) CS21001 : Discrete Structures Autumn 2020 3 / 12

Recommend


More recommend