Question: Question 5 . ( a ) Suppose R is relation on set X where | X | = n . Briefly explain how we can
Question
a Suppose R is relation on set X where Xn Briefly explain
how we can associate an adjacency matrix MR of size n x n to R
marks
b Write pseudocode for an algorithm that, given an adjacency matrix MR of a relation R returns if R is symmetric and reflexive; and returns otherwise. Analyze the time complexity of your algorithm for the best and worst cases.
c Given an adjacency matrix MR of a relation R write pseudocode for an algorithm that checks whether R is transitive. Discuss the correctness of your code and analyze the times complexity of your algorithm.
d Write pseudocode that computes after M:MRxxMR execute
False if Mij but MRij for some i and j; otherwise
returns True. Analyze the times complexity of your algorithm.
e Compare your the complexity of your algorithms in c and d If we use Strassen algorithm for matrix multiplication, how would it impact the time complexity of d
f Based on your answers for the above items and assuming Strassen'
algorithm for matrix multiplication, write pseudocode that, given
an adjacency matrix MR return if R is an equivalence relation
and otherwise. Analyze the time complexity of your algorithm
for the best and worst cases.
g Use your code to execute all the equivalence relations on a set of size Print or draw all the equivalence relations on a set of size
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
