Exercise
The following table shows the value of an expression based on the values of a
and b
.
Value of a |
Value of b |
Value of expression |
---|---|---|
false |
false |
false |
true |
false |
true |
false |
true |
true |
true |
true |
false |
Which of the following expressions is equivalent to the value of the expression shown in the table?
(A) (a AND b) OR ((NOT a) AND (NOT b))
(B) (a OR b) AND ((NOT a) OR (NOT b))
(C) (a OR (NOT b)) AND (b OR (NOT a))
(D) (a OR (NOT b)) OR (b OR (NOT a))
Solution
(B) (a OR b) AND ((NOT a) OR (NOT b))
The table shows an expression that is true
when exactly one of a
and b
is true
(and the other is false
).
This means at least one of a
and b
must be true
.
a OR b
AND
at least one of a
and b
must be false
.
(NOT a) OR (NOT b)
Combine both parts.
(a OR b) AND ((NOT a) OR (NOT b))