Write the code for each of the problems below, then click on the problem name to see the answer. The code is well-commented so you can understand what each segment does.
Explain
Explain
Using DeMorgan's law to negate an entire boolean expression involves
breaking that expression down into its component parts and negating
each part individually.
The expression: a != b && b == c is made up of three parts
Negating a != b yields
a == b
Negating && yields
||
Negating b == c yields b != c
So the answer is :
!(a != b && b == c) is equivalent to
a == b || b != c
Using DeMorgan's law to negate an entire boolean expression involves
breaking that expression down into its component parts and negating
each part individually.
The expression: x < y || x == z is made up of three parts
Negating x < y yields
x >= y
Negating || yields
&&
Negating y == z yields y != z
So the answer is :
!(x < y || x == z) is equivalent to
x >= y && x != z
Using DeMorgan's law to negate an entire boolean expression involves
breaking that expression down into its component parts and negating
each part individually.
The expression: a == x && b == y && c == z is made up of five parts
Negating a == x yields
a != x
Negating && yields
||
Negating b == y yields b != y
Negating && yields
||
Negating c == z yields c != z
So the answer is :
!(a == x && b == y && c == z) is equivalent to
a != x || b != y || c != z
Using DeMorgan's law to negate an entire boolean expression involves
breaking that expression down into its component parts and negating
each part individually.
The expression: x <= 5 || c != z is made up of three parts
Negating x <= 5 yields
x > 5
Negating || yields
&&
Negating c != z yields c == z
So the answer is :
!(x <= 5 || c != z) is equivalent to
x > 5 && c == z