Discrete Mathematics
Homework #4
Submission via eClass.
1. Write a Python code that takes in two variables, x and y, over the universal domain integers.
Then:
A. Performs the propositional function P(x,y) of x+y = y+x. This is done by swapping the values of x
and y. You need to submit an executable that asks to enter two values, then it performs the
arithmetic operations and outputs a green flag if the equality is true else it outputs a red flag. It also
prints the new values for x and y.
B. Consider having two functions F(x,y), and W(y,x). Then perform the arithmetic operations over F
and W:
add, subtract, divide, multiply, modulo
C. Perform the logical operations: Not(x), Not(y), AND, OR, XOR
D. Euclidian gcd(x,y)
F. LCM of x and y with a verification that x*y = gcd * lcm