Chapter 2 Sets Homework 3 Given U = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } as a set universe and the sets : A = { 1, 2, 3, 4, 5 }, B = { 4, 5, 6, 7 }, C = { 5,

Slides:



Advertisements
Similar presentations
Representing Relations
Advertisements

Chapter 2 Revision of Mathematical Notations and Techniques
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 5 Dr.-Ing. Erwin Sitompul
CSE115/ENGR160 Discrete Mathematics 04/26/12 Ming-Hsuan Yang UC Merced 1.
Chapter 3 Relations. Section 3.1 Relations and Digraphs.
Representing Relations Using Matrices
Discrete Mathematics Lecture # 16 Inverse of Relations.
Discrete Mathematics Lecture#11.
1 Section 7.1 Relations and their properties. 2 Binary relation A binary relation is a set of ordered pairs that expresses a relationship between elements.
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Applied Discrete Mathematics Week 10: Equivalence Relations
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Lecture 14 Relations CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Homework Review notes Complete Worksheet #1. Homework Let A = {a,b,c,d}, B = {a,b,c,d,e}, C = {a,d}, D = {b, c} Describe any subset relationships. 1.
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
Digraphs and Relations Warm Up. The Divisibility Relation Let “|” be the binary relation on N×N such that a|b (“a divides b”) iff there is an n ∈ N such.
Discrete Mathematics Relation.
Relations. Important Definitions We covered all of these definitions on the board on Monday, November 7 th. Definition 1 Definition 2 Definition 3 Definition.
CS 103 Discrete Structures Lecture 19 Relations. Chapter 9.
Discrete Mathematics Lecture # 15 Types of Relations (contd.)
Relation. Combining Relations Because relations from A to B are subsets of A x B, two relations from A to B can be combined in any way two sets can be.
Discrete Structures – CNS2300
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Unit II Discrete Structures Relations and Functions SE (Comp.Engg.)
Representing Relations Using Matrices A relation between finite sets can be represented using a zero-one matrix Suppose R is a relation from A = {a 1,
Chapter Relations and Their Properties
Relations Section 9.1, 9.3—9.5 of Rosen Spring 2012
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
RelationsCSCE 235, Spring Introduction A relation between elements of two sets is a subset of their Cartesian products (set of all ordered pairs.
Relations and Functions ORDERED PAIRS AND CARTESIAN PRODUCT An ordered pair consists of two elements, say a and b, in which one of them, say a is designated.
Discrete Mathematics 3. MATRICES, RELATIONS, AND FUNCTIONS Lecture 6 Dr.-Ing. Erwin Sitompul
Section 9.3. Section Summary Representing Relations using Matrices Representing Relations using Digraphs.
Section 9.1. Section Summary Relations and Functions Properties of Relations Reflexive Relations Symmetric and Antisymmetric Relations Transitive Relations.
Chapter8 Relations 8.1: Relations and their properties.
Relations Chapter 9 Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
The Relation Induced by a Partition
Discrete Mathematical
Relations and Their Properties
Citra Noviyasari, S.Si, MT
Chapter 5 Relations and Operations
Relations.
CSE 2813 Discrete Structures
Partial Orderings CSE 2813 Discrete Structures.
Relations Binary relations represent relationships between the elements of two sets. A binary relation R from set A to set B is defined by: R  A 
Equivalence Relations
Relations Chapter 9.
Partial Orderings.
Lecture # 14 Types of Relations
Relations and Digraphs
Representing Relations
Dr. Ameria Eldosoky Discrete mathematics
CSE115/ENGR160 Discrete Mathematics 04/28/11
CSNB 143 Discrete Mathematical Structures
Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive,
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 9 Relations Slides are adopted from.
Applied Discrete Mathematics Week 10: Equivalence Relations
Relations and Their Properties
8.1 Relations and Their Properties
Relations and their Properties
Properties of Relations
Discrete Math (2) Haiming Chen Associate Professor, PhD
Chapter 8 (Part 2): Relations
Agenda Lecture Content: Relations (Relasi)
Lecture # 16 Inverse of Relations
4.4 Properties of Relations
Presentation transcript:

Chapter 2 Sets Homework 3 Given U = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } as a set universe and the sets : A = { 1, 2, 3, 4, 5 }, B = { 4, 5, 6, 7 }, C = { 5, 6, 7, 8, 9 }, D = { 1, 3, 5, 7, 9 }, E = { 2, 4, 6, 8 }, F = { 1, 5, 9 }. Determine: A  C A  B A  F (C  D)  E (F – C) – A

Chapter 2 Sets Solution to Homework 3 Given U = { 1, 2, 3, 4, 5, 6, 7, 8, 9 } as a set universe and the sets : A = { 1, 2, 3, 4, 5 }, B = { 4, 5, 6, 7 }, C = { 5, 6, 7, 8, 9 }, D = { 1, 3, 5, 7, 9 }, E = { 2, 4, 6, 8 }, F = { 1, 5, 9 }. Determine: A  C = { 1,2,3,4,5,6,7,8,9 } = U A  B = { 4,5 } A  F = { 6,7,8,9 }  { 1,5,9 } = { 9 } (C  D)  E = { 1,3,6,8 }  { 2,4,6,8 } = { 1,2,3,4 } (F – C) – A = { 1 } – { 1,2,3,4,5 } = 

Cardinality of the Set Union Chapter 2 Sets Cardinality of the Set Union For any sets A and B, the following set equation apply: A  B = A + B – A  B A  B = A + B – 2A  B A  B A  B

Example 1: Cardinality of the Set Union Chapter 2 Sets Example 1: Cardinality of the Set Union Example: In a poll among 40 students, it comes out that 32 of them prefer Internet Explorer, 18 students like Mozilla Firefox more, and 2 students do not like either of the browsers. Determine: The number of students who like Internet Explorer or Mozilla Firefox. The number of students who like Internet Explorer or Mozilla Firefox, but not both of them. Solution: Define U = { The number of students participating in the poll} A = { The number of students who like Internet Explorer } B = { The number of students who like Mozilla Firefox } Then U= 40, A= 32, B= 18, A  B= 2

Example 1: Cardinality of the Set Union Chapter 2 Sets Example 1: Cardinality of the Set Union The number of students who like Internet Explorer or Mozilla Firefox. A  B = U – A  B = 40 – 2 = 38 The number of students who like Internet Explorer or Mozilla Firefox, but not both of them. A  B = A + B – A  B = 32 + 18 – 38 = 12 A  B = A + B – 2A  B= 32 + 18 – 212 = 26 | | | |

Cardinality of the Set Union Chapter 2 Sets Cardinality of the Set Union For any sets A, B, and C the following set equation apply: A  B  C = A + B + C – A  B – A  C – B  C + A  B  C

Example 2: Cardinality of the Set Union Chapter 2 Sets Example 2: Cardinality of the Set Union Example: Among integers between (and including) 101 and 600, how many numbers are not divisible by 4 and not also by 5 or divisible by 4 and 5? Solution: Define U = { The number of integers between (and including) 101 and 600 } A = { Members of U, divisible by 4 } B = { Members of U, divisible by 5 } Then U= 500 A= 500/4 = 125 B= 500/5 = 100 A  B = 500/20 = 25

Example 2: Cardinality of the Set Union Chapter 2 Sets Example 2: Cardinality of the Set Union Then U= 500 A= 500/4 = 125 B= 500/5 = 100 A  B = 500/20 = 25 A  B = A + B – 2A  B = 125 + 100 – 225 = 175 A  B = U – A  B = 500 – 175 = 325 |

Chapter 3 Relation and Function Relations A relation R from set A to set B is a subset of the Cartesian product A  B. Notation: R  (A  B) a R b is the notation for (a,b)  R, with the meaning “relation R relates a with b.” a R b is the notation for (a,b)  R, with the meaning “relation R does not relate a with b.” Set A is denoted as the domain of R. Set B is denoted as the range of R.

Chapter 3 Relation and Function Relations Example: Given A = { Amir, Budi, Cora } B = { Discrete Mathematics (DM), Data Structure and Algorithm (DSA), State Philosophy (SP), English III (E3) } A  B = { (Amir,DM), (Amir, DSA), (Amir,SP), (Amir,E3), (Budi,DM), (Budi, DSA), (Budi,SP), (Budi,E3), (Cora,DM), (Cora, DSA), (Cora,SP), (Cora,E3) } Suppose R is a relation that describes the subjects taken by a student in a certain semester, where: R = { (Amir,DM), (Amir, SP), (Budi,DM), (Budi,E3), (Cora,SP) } It can be seen that: R  (A  B) A is the domain of R, B is the range of R (Amir,DM)  R or Amir R DM (Amir,DSA)  R or Amir R DSA

Relations Example: Take P = { 2,3,4 } Q = { 2,4,8,9,15 } Chapter 3 Relation and Function Relations Example: Take P = { 2,3,4 } Q = { 2,4,8,9,15 } If the relation R from P to Q is defined as: (p,q)  R if p is the factor of q, then the followings can be obtained: R = { (2,2),(2,4),(2,8),(3,9),(3,15),(4,4),(4,8) }.

Representation of Relations Chapter 3 Relation and Function Representation of Relations Arrow Diagrams

Representation of Relations Chapter 3 Relation and Function Representation of Relations Tables

Representation of Relations Chapter 3 Relation and Function Representation of Relations Matrices Suppose R is a relation between A = { a1,a2, …,am } and B = { b1,b2, …,bn }, then the relation R can be presented by the matrix M = [mij]. where:

Representation of Relations Chapter 3 Relation and Function Representation of Relations Matrices a1 = Amir, a2 = Budi, a3 = Cora, and b1 = DM, b2 = DSA, b3 = SP, b4 = E3 p1 = 2, p2 = 3, p3 = 4, and q1 = 2, q2 = 4, q3 = 8, q4 = 9, q5 = 15 a1 = 2, a2 = 3, a3 = 4, a4 = 8, a5 = 9

Representation of Relations Chapter 3 Relation and Function Representation of Relations Directed Graph (Digraph) Relation on one single set can be represented graphically by using a directed graph or digraph. Digraphs are not defined to represent a relation from one set to another set. Each member of the set is marked as a vertex (node), and each relation is denoted as an arc (bow). If (a,b)  R, then an arc should be drawn from vertex a to vertex b. Vertex a is called initial vertex while vertex b terminal vertex. The pair of relation (a,a) is denoted with an arch from vertex a to vertex a itself. This kind of arc is called a loop.

Representation of Relations Chapter 3 Relation and Function Representation of Relations Directed Graph (Digraph) Example: Suppose R = { (a,a),(a,b),(b,a),(b,c),(b,d),(c,a),(c,d),(d,b) } is a relation on a set { a,b,c,d }, then R can be represented by the following digraph:

Chapter 3 Relation and Function Binary Relations The relations on one set (from one member to another member in the same set) is also called binary relation. A binary relation may have one or more of the following properties: Reflexive and Irreflexive Transitive Symmetric Anti-symmetric

Binary Relations Reflexive and Irreflexive Chapter 3 Relation and Function Binary Relations Reflexive and Irreflexive Relation R on set A is reflexive if (a,a)  R for each a  A. Relation R on set A is not reflexive if there exists a  A such that (a,a)  R. Relation R on set A is irreflexive if (a,a)  R for each a  A. Relation R on set A is not irreflexive if there exists a  A such that (a,a)  R. Example: Suppose set A = { 1,2,3,4 }, and a relation R is defined on A, then: R = { (1,1),(1,3),(2,1),(2,2),(3,3),(4,2),(4,3),(4,4) } is reflexive because there exist members of the relation with the form (a,a) for each possible a, namely (1,1), (2,2), (3,3), and (4,4). R = { (1,1),(2,2),(2,3),(4,2),(4,3),(4,4) } is not reflexive since (3,3)  R, and also not irreflexive because (1,1), (2,2), and (3,3)  R.

Chapter 3 Relation and Function Binary Relations If a relation is reflexive, then the digraph is characterized by the loop on each vertex.

Chapter 3 Relation and Function Binary Relations Example: Given a relation “divide without remainder” for a set of positive integers, is the relation reflexive or not? Each positive integer can divide itself without remainder  (a,a)  R for each a  A  the relation is reflexive Example: Given two relations on a set of positive integers N: S : x + y = 4, T : 3x + y = 10 Are S and T reflexive or not? Irreflexive or not? S is not reflexive, because although (2,2) is a member of S, there exist (a,a)  S for a  N, such as (1,1), (3,3), .... S is not irreflexive because (2,2) is a member of S. T is not reflexive because there is even no single pair (a,a)  T that can fulfill the relation. T is thus irreflexive.

Binary Relations Transitive Chapter 3 Relation and Function Binary Relations Transitive Relation R on set A is transitive if (a,b)  R and (b,c)  R, then (a,c)  R for all a, b, c  A.

Chapter 3 Relation and Function Binary Relations Example: Suppose A = { 1, 2, 3, 4 }, and a relation R is defined on set A, then: R = { (2,1),(3,1),(3,2),(4,1),(4,2),(4,3) } is transitive. R = { (1,1),(2,3),(2,4),(4,2) } is not transitive because (2,4) and (4,2)  R, but (2,2)  R, also (4,2) and (2,3)  R, but (4,3)  R. R = { (1,2), (3,4) } is transitive because there is no violation against the rule { (a,b)  R and (b,c)  R }  (a,c)  R. Table for part a.

Chapter 3 Relation and Function Binary Relations Example: Is the relation “divide without remainder” on a set of positive integers transitive or not? It is transitive. Suppose that a divides b without remainder and b divides c without remainder, then certainly a divides c without remainder. { a R b  b R c }  a R c Example: Given two relations on a set of positive integers N: S : x + y = 4, T : 3x + y = 10 Are S and T transitive or not? S is not transitive, because i.e., (3,1) and (1,3) are members of S, but (3,3) and (1,1) are not members of S. T = { (1,7),(2,4),(3,1) }  not transitive because (3,7)  R.

Binary Relations Symmetric and Anti-Symmetric Chapter 3 Relation and Function Binary Relations Symmetric and Anti-Symmetric Relation R on set A is symmetric if (a,b)  R, then (b,a)  R for all a,b  A. Relation R on set A is not symmetric if there exists (a,b)  R such that (b,a)  R. Relation R on set A such that if (a,b)  R and (b,a)  R then a = b for (a,b)  A, is called anti-symmetric. Relation R on set A is not anti-symmetric if there exist different a and b such that (a,b)  R and (b,a)  R. Symmetric Anti-Symmetric

Chapter 3 Relation and Function Binary Relations Example: Suppose A = { 1, 2, 3, 4 }, and a relation R is defined on set A, then: R = { (1,1),(1,2),(2,1),(2,2),(2,4),(4,2),(4,4) } is symmetric, because if (a,b)  R then (b,a)  R also. Here, (1,2) and (2,1)  R, as well as (2,4) and (4,2)  R. is not anti-symmetric, because i.e., (1,2)  R and (2,1)  R while 1  2. R = { (1,1),(2,3),(2,4),(4,2) } is not symmetric, because (2,3)  R, but (3,2)  R. is not anti-symmetric, because there exists (2,4)  R and (4,2)  R while 2  4.

Chapter 3 Relation and Function Binary Relations Example: Suppose A = { 1, 2, 3, 4 }, and a relation R is defined on set A, then: R = { (1,1),(2,2),(3,3) } is symmetric and anti-symmetric, because (1,1)  R and 1 = 1, (2,2)  R and 2 = 2, and (3,3)  R and 3 = 3. R = { (1,1),(1,2),(2,2),(2,3) } is not symmetric, because (2,3)  R, but (3,2)  R. is anti-symmetric, because (1,1)  R and 1 = 1 and, (2,2)  R and 2 = 2.

Chapter 3 Relation and Function Binary Relations Example: Suppose A = { 1, 2, 3, 4 }, and a relation R is defined on set A, then: R = { (1,1),(2,4),(3,3),(4,2) } is symmetric. is not anti-symmetric, because there exist (2,4) and (4,2) as member of R while 2  4. R = { (1,2),(2,3),(1,3) } is not symmetric. is anti-symmetric, because there is no different a and b such that (a,b)  R and (b,a)  R (which will violate the anti-symmetric rule).

Chapter 3 Relation and Function Binary Relations Example: Show that the relation R = { (1,1),(2,2),(2,3),(3,2),(4,2),(4,4)} is not symmetric and not anti-symmetric. R is not symmetric, because (4,2)  R but (2,4)  R. R is not anti-symmetric, because (2,3)  R and (3,2)  R but 2  3.

Chapter 3 Relation and Function Binary Relations Example: Is the relation “divide without remainder” on a set of positive integers symmetric? Is it anti-symmetric? It is not symmetric, because if a divides b without remainder, then b cannot divide a without remainder, unless if a = b. For example, 2 divides 4 without remainder, but 4 cannot divide 2 without remainder. Therefore, (2,4)  R but (4,2)  R. It is anti-symmetric, because if a divides b without remainder, and b divides a without remainder, then the case is only true for a = b. For example, 3 divides 3 without remainder, then (3,3)  R and 3 = 3.

Chapter 3 Relation and Function Binary Relations Example: Given two relations on a set of positive integers N: S : x + y = 4, T : 3x + y = 10 Are S and T symmetric? Are they anti-symmetric? S is symmetric, because take (3,1) and (1,3) are members of S. S is not anti-symmetric, because although there exists (2,2)  R, but there exist also { (3,1),(1,3) }  R while 3  1. T = { (1,7),(2,4),(3,1) }  not symmetric. T = { (1,7),(2,4),(3,1) }  anti-symmetric.

Chapter 3 Relation and Function Homework 4 For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive, transitive, symmetric, and/or anti-symmetric: R = { (2,2),(2,3),(2,4),(3,2),(3,3),(3,4) } S = { (1,1),(1,2),(2,1),(2,2),(3,3),(4,4) } T = { (1,2),(2,3),(3,4) } Represent the relation R, S, and T using matrices and digraphs.

Chapter 3 Relation and Function Homework 4A For each of the following relations on set A = { 1,2,3,4 }, check each of them whether they are reflexive, irreflexive, transitive, symmetric, and/or anti-symmetric: R = { (1,3),(1,4),(2,2),(4,1),(4,3) } S = { (1,1),(1,2),(1,3),(1,4),(2,1),(2,2) } T = { (2,1),(2,2),(3,4),(4,1),(4,4) } For the set B = { h,i,j,k,l }, with at least 4 members of relation, create: A relation V which is reflexive and transitive. A relation W which is irreflexive and symmetric.