Question: Write a program that determines whether a given relation on a set exhibits the following properties: reflexive, symmetric, transitive, and equivalence ( if it satisfies
Write a program that determines whether a given relation on a set exhibits the following properties: reflexive, symmetric, transitive, and equivalence if it satisfies all three properties Please review section of the textbook.
Input:
Take a list of pairs as input, representing a relation on a set. The elements in the pairs represent elements of the set on which the relation is defined.
Output:
Determine if the relation is:
i Reflexive: For every element a in the set, should be in the relation.
ii Symmetric: If is in the relation, then should also be in the relation.
iii. Transitive: If and are in the relation, then should also be in the relation.
iv Equivalence: Satisfied if the relation is reflexive, symmetric, and transitive.
Validate using the following test cases whether each property is satisfied for the relation.
Example test cases:
Test case :
Input:
Output: Reflexive, Symmetric, Transitive, Equivalence
Test case :
Input:
Output: Reflexive, Not Symmetric, Transitive, Not Equivalence
Test case
Input:
Output: Not Reflexive, Not Symmetric, Not Transitive, Not Equivalence.
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
