CS 201: Test #3

This is a take-home test. The test is open-book, open-notes; however, you are not to discuss any of the questions with anyone but me. Write your answers neatly; be sure to show your reasoning (for partial credit in case your answer is wrong). The test is due on Tuesday, May 11, by 5pm (hardcopy or email). There are five problems of equal value.

Problem 1. Define the relation R on the set of all integers by i R j <=> (i-j) is even. Prove or disprove: R is an equivalence relation.


Problem 2. Define the relation R on the set of all integers by i R j <=> i is a divisor of j. Which of the properties (reflexive, irreflexive, symmetric, asymmetric, antisymmetric, transitive) does this relation possess? Prove each answer (i.e., show why the property holds or give a counterexample demonstrating that it does not hold).


Problem 3. A graph is said to be complete if there is an edge in it between any two vertices; the complete graph on n vertices is denoted by Kn. A graph is bipartite if we can partition its set of vertices V into two subsets V1 and V2, such that the only edges of the graph are between vertices of V1 and vertices of V2 -- without any edge among the vertices of V1 and without any edge among the vertices of V2. A bipartite graph is complete if there is an edge between any vertex of V1 and any vertex of V2; if V1 has m vertices and V2 has n vertices, we denote the complete bipartite graph on these vertices by Km,n.

  • How many edges does Kn have?
  • Prove that the relation defined on the set of n vertices by the graph Kn is an equivalence relation.
  • How many equivalence classes does this equivalence relation have?
  • How many edges does Km,n have?
  • Assume m,n > 0; verify that the relation defined on the set of m+n vertices by the graph Km,n is not an equivalence relation.

  • Problem 4. Give an example of an equivalence relation on the set of all positive integers that has an infinite number of equivalence classes, with each equivalence class of infinite size. (Hint: it is probably easiest to devise such a class by considering first the classes, then defining the relation from the classes, rather than vice versa; you may also want to define a collection of classes that may not form a partition because they leave some numbers out, then put all remaining number into one class; finally, think of some feature of numbers that you know about and that is shared among an infinity of numbers, then use this feature to define classes and proceed as recommended.)





    Problem 5. The adjacency matrix below describes a directed graph.

         1 2 3 4 5 6 7 8 9 10
       _______________________
     1 | 0 1 0 0 0 0 0 0 0 1 |  
     2 | 0 0 1 0 1 0 0 0 0 0 |  
     3 | 1 0 0 0 0 0 0 0 0 0 |  
     4 | 0 0 0 0 0 1 0 0 0 0 |  
     5 | 0 0 0 0 0 0 0 0 0 1 |  
     6 | 0 0 0 0 0 0 0 1 0 0 |  
     7 | 0 0 0 0 0 0 0 0 1 0 |  
     8 | 0 0 0 1 0 0 0 0 0 0 |  
     9 | 0 0 0 0 0 0 1 0 0 0 |  
    10 | 0 0 1 0 0 0 0 0 0 0 |  
       -----------------------
    
  • Draw the graph.
  • Give the adjacency matrix for the transitive closure of the graph.
  • At what iteration of the outer loop does Warshall's algorithm place a 1 in position (1,5)? in position (2,10)?
  • Does that matrix (the transitive closure matrix) define an equivalence relation (prove or disprove)?
  • Bonus: (harder!) What condition(s) must be placed on a directed graph so that its transitive closure will form an equivalence relation?