Question: PLEASE DO IT IN PYTHON AND ACTUALLY WRITE THE CODE. THANK YOU! Label each output with a description, e . g . , 1 a

PLEASE DO IT IN PYTHON AND ACTUALLY WRITE THE CODE. THANK YOU!
Label each output with a description, e.g.,1a. Union of R1 and R2
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. For the relations:
R 1={(1,1),(2,2),(3,3)} and R2={(1,1),(1,2),(1,3),(1,4)}
perform the following set operations and display the results:
a) R1\cup R2
b) R1\cap R2
c) R1 R2
d) R2 R1
2. Display S R, where:
R is the relation from A ={1,2,3} to B ={1,2,3,4} with
R ={(1,1),(1,4),(2,3),(3,1),(3,4)}
S is the relation from B ={1,2,3,4} to C ={0,1,2} with
S ={(1,0),(2,0),(3,1),(3,2),(4,1)}
3. For R ={(1,1),(1,4),(2,3),(3,1),(3,4)}, show R 2.
4. For the relation R ={(x, y)| x + y =0} on the set {-10,...,-1,0,1,...,10}:
a) Show R as a set of ordered pairs.
b) Show whether R is reflexive or not.
c) Show whether R is symmetric or not.
d) Show whether R is antisymmetric or not.
e) Show whether R is transitive or not.
Hint: For No.2 and 3 you will need to create a function/method that takes the
composite of two relations.

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!