(De Morgan’s Laws) In this chapter, we discussed the logical operators &&, ||, and !. DeMorgan’s Laws can sometimes make it more convenient for us to express a logical expression. Theselaws state that the expression !(condition1 && condition2) is logically equivalent to the expression(!condition1 || !condition2). Also, the expression !(condition1 || condition2) is logically equivalentto the expression (!condition1 && !condition2). Use De Morgan’s Laws to write equivalent expressions for each of the following, and then write a program to show that both the original expressionand the new expression in each case are equivalent.a) !(x < 5) && !(y >= 7)b) !(a == b) || !(g != 5)c) !((x <= 8) && (y > 4))d) !((i > 4) || (j <= 6))
(De Morgan’s Laws) In this chapter, we discussed the logical operators &&, ||, and !. De
Morgan’s Laws can sometimes make it more convenient for us to express a logical expression. These
laws state that the expression !(condition1 && condition2) is logically equivalent to the expression
(!condition1 || !condition2). Also, the expression !(condition1 || condition2) is logically equivalent
to the expression (!condition1 && !condition2). Use De Morgan’s Laws to write equivalent expressions for each of the following, and then write a
and the new expression in each case are equivalent.
a) !(x < 5) && !(y >= 7)
b) !(a == b) || !(g != 5)
c) !((x <= 8) && (y > 4))
d) !((i > 4) || (j <= 6))
Step by step
Solved in 5 steps with 2 images