//Syed Rais Ahmad //Assignment # 10 Ans 3 Draw a digraph to correspond to following relations on integers 1 to 12 a) x is related to y. If x-y is evenly divisble by 3. Relation R={ <7,1>,<8,2>,<9,3>,<10,4>,<11,5>,<12,6>} Adjacency Matrix: 1 2 3 4 5 6 7 8 9 10 11 12 ------------------------------------------------------------ 1 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 7 1 0 0 0 0 0 0 0 0 0 0 0 8 0 1 0 0 0 0 0 0 0 0 0 0 9 0 0 1 0 0 0 0 0 0 0 0 0 10 0 0 0 1 0 0 0 0 0 0 0 0 11 0 0 0 0 1 0 0 0 0 0 0 0 12 0 0 0 0 0 1 0 0 0 0 0 0 Path Matrix: contains all zeros b) x is related to y. If x+10*y < x*y Relation R={<11,12>,<12,7>,<12,8>,<12,9>,<12,10>,<12,11>,<12,12>} 7 8 9 10 11 12 -------------------------------------------------------- 7 0 0 0 0 0 0 8 0 0 0 0 0 0 9 0 0 0 0 0 0 10 0 0 0 0 0 0 11 0 0 0 0 0 1 12 1 1 1 1 1 1 Path Matrix: 7 8 9 10 11 12 -------------------------------------------------------- 7 0 0 0 0 0 0 8 0 0 0 0 0 0 9 0 0 0 0 0 0 10 0 0 0 0 0 0 11 1 1 1 1 1 1 12 1 1 1 1 1 1 c) x is related to y if the remainder on divison of x by y is 2. Relation R={<5,3>,<6,4>,<7,5>,<8,3>,<8,6>,<9,7>,<10,4>,<10,8>,<11,3>,<11,9>,<12,5>,<12,10>} Adjacency Matrix: 3 4 5 6 7 8 9 10 11 12 -------------------------------------------------------- 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 5 1 0 0 0 0 0 0 0 0 0 6 0 1 0 0 0 0 0 0 0 0 7 0 0 1 0 0 0 0 0 0 0 8 1 0 0 1 0 0 0 0 0 0 9 0 0 0 0 1 0 0 0 0 0 10 0 1 0 0 0 1 0 0 0 0 11 1 0 0 0 0 0 1 0 0 0 12 0 0 1 0 0 0 0 1 0 0 Path Matrix: 3 4 5 6 7 8 9 10 11 12 -------------------------------------------------------- 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 7 1 0 0 0 0 0 0 0 0 0 8 0 1 0 0 0 0 0 0 0 0 9 0 0 1 0 0 0 0 0 0 0 10 1 0 0 1 0 0 0 0 0 0 11 0 0 0 0 1 0 0 0 0 0 12 1 0 0 0 1 0 0 0 0 0