Zero-One Matrix - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Zero-One Matrix, Representing Relations, Binary Matrix, Matrix and Relation Properties, Symmetric Matrix, Antisymmetric Relation, Intersection of Relations, Composite of Relations, Boolean Product of Matrices

Typology: Slides

2012/2013

Uploaded on 04/27/2013

atasi
atasi 🇮🇳

4.6

(32)

134 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE115/ENGR160 Discrete Mathematics
04/26/12
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Zero-One Matrix - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

CSE115/ENGR160 Discrete Mathematics

9.3 Representing relations

• Can use ordered set, graph to represent sets

• Generally, matrices are better choice

• Suppose that R is a relation from A={a 1 , a 2 , …,

a m} to B={b 1 , b 2 , …, bn }. The relation R can be

represented by the matrix M R =[mij ] where

mij =1 if (a i ,bj ) ∊R,

mij =0 if (a i ,bj ) ∉R,

• A zero-one (binary) matrix

Matrix and relation properties

• The matrix of a relation on a set, which is a square

matrix, can be used to determine whether the

relation has certain properties

• Recall that a relation R on A is reflexive if (a,a)∈R.

Thus R is reflexive if and only if (a i ,a i )∈R for i=1,2,…,n

• Hence R is reflexive iff m ii =1, for i=1,2,…, n.

• R is reflexive if all the elements on the main diagonal

of MR are 1

Symmetric

• The relation R is symmetric if (a,b)∈R implies

that (b,a)∈R

• In terms of matrix, R is symmetric if and only

mji =1 whenever m ij =1, i.e., MR =(MR ) T

• R is symmetric iff M R is a symmetric matrix

Example

• Suppose that the relation R on a set is

represented by the matrix

Is R reflexive, symmetric or antisymmetric?

• As all the diagonal elements are 1, R is

reflexive. As M R is symmetric, R is symmetric.

It is also easy to see R is not antisymmetric

7

Union, intersection of relations

• Suppose R1 and R2 are relations on a set A

represented by M R1 and M R

• The matrices representing the union and

intersection of these relations are

MR1⋃R2 = MR1 ⋁ MR

MR1⋂R2 = MR1 ⋀ MR

Composite of relations

• Suppose R is a relation from A to B and S is a relation

from B to C. Suppose that A, B, and C have m, n, and

p elements with MS , MR

• Use Boolean product of matrices

• Let the zero-one matrices for S∘R, R, and S be

MS∘R =[tij], MR =[rij], and MS =[sij] (these matrices have

sizes m×p, m×n, n×p)

• The ordered pair (a i , c j)∈S∘R iff there is an element bk

s.t.. (a i , bk )∈R and (bk , c j)∈S

• It follows that t ij=1 iff rik=skj=1 for some k

M S∘R = MR ⊙ MS Docsity.com^10

Boolean product (Section 3.8)

• Boolean product A B is defined as

11

,^110
A B
A B Replace x with ⋀ and + with ⋁

Example

• Find the matrix representation of S∘R

13

SR R S

R S

M M M
M M

Powers Rn

• For powers of a relation

• The matrix for R2 is

14

M (^) R n = MR [ n^ ]

R^2 [ R^2 ]

R

M M

M

Example

• The directed graph with vertices a, b, c, and d,

and edges (a,b), (a,d), (b,b), (b,d), (c,a), (c,b),

and (d,b) is shown

16

M R

Example

  • R is reflexive. R is neither symmetric (e.g., (a,b)) nor antisymmetric (e.g., (b,c), (c,b)). R is not transitive (e.g., (a,b), (b,c))
  • S is not reflexive. S is symmetric but not antisymmetric (e.g., (a,c), (c,a)). S is not transitive (e.g., (c,a), (a,b))

17

MR M S