Question: PLEASE DO IT IN PYTHON AND ACTUALLY WRITE THE CODE. THANK YOUUU Use the methods or functions inherent in the language and / or using

PLEASE DO IT IN PYTHON AND ACTUALLY WRITE THE CODE. THANK YOUUU
Use the methods or functions inherent in the language and/or using methods or
functions you create. Like previous assignments, dont hard code a solution you
did on paper as the output.
Create a program for the following:
1. Write code that determines if a relation (R) of ordered pairs is reflexive or not
& then if it is not, finds the reflexive closure of R (R*). The output should be:
a) R ={...}
b) R is or is not reflexive
c) R* if it is not reflexive
d) Show the code works for the relation {(1,1),(4,4),(2,2),(3,3)} on the
set {1,2,3,4}.
e) Show the code works for the relation {(a,a),(c,c)} on the set {a,b,c,d}.
2. Write code that determines if a relation (R) of ordered pairs is symmetric or
not & then if it is not, finds the symmetric closure of R (R*). The output
should be:
a) R ={...}
b) R is or is not symmetric
c) R* if it is not symmetric
d) Show the code works for the relation {(1,2),(4,4),(2,1),(3,3)} on the
set {1,2,3,4}.
e) Show the code works for the relation {(1,2),(3,3)} on the set
{1,2,3,4}.
3. Write code that determines if a relation (R) of ordered pairs is transitive or not
& then if it is not, finds the transitive closure of R (R*) using Warshalls
Algorithm. The output should be:
a) R ={...}
b) R is or is not transitive
c) R* if it is not transitive
d) Show the code works for the relation {(a,b),(d,d),(b,c),(a,c)} on the
set {a,b,c,d}.
e) Show the code works for the relation {(1,1),(1,3),(2,2),(3,1),(3,2)} on
the set {1,2,3}.
4. Write code that determines if a relation (R) of ordered pairs is an equivalence
relation or not and the reason why. The output should be:
a) R ={...}
b) R is or is not an equivalence relation
c) The reasons why, if it is not an equivalence relation (i.e., it is not
reflexive, and/or it is not symmetric, and/or it is not transitive).
d) Show the code works for the relation {(1,1),(2,2),(2,3)} on the set
{1,2,3}.
e) Show the code works for the relation {(a,a),(b,b),(c,c),(b,c),(c,b)} on
the set {a,b,c}.
5. Write code that determines if a relation (R) of ordered pairs is a poset of the
set (S) or not and the reason why. The output should be:
a) S ={...}
b) R ={...}
c)(S,R) is or is not a poset
d) The reason why, if it is not poset (i.e., it is not reflexive, and/or it is
not antisymmetric, and/or it is not transitive.
e) Show the code works for the relation {(1,1),(1,2),(2,2),(3,3),(4,1),
(4,2),(4,4)} on the set {1,2,3,4}.
f) Show the code works for the relation {(0,0),(0,1),(0,2),(0,3),(1,
0),(1,1),(1,2),(1,3),(2,0),(2,2),(3,3)} on the set {0,1,2,3}.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!