Conditional logic ...comparison? How does this work?

Ok, so I got a question during an exam the other day, and I got it wrong, but I just don't get why. at all.

They gave us three conditional statements:

A. (x == y && x != z) || (x !=y && x == z)

B. (x == y || x == z) && (x !=y || x != z)

C. (x == y) != (x == z)


And then they asked us which ones were equivalent. I said none, they said all. I don't really need an answer to this specific question of course, I'm not asking that I know that'd be not great but I'd just like an example of the type of logic I should be thinking about when doing this type of problem, I just feel like I missed something here..

I know this sounds like I'm asking for a handout or something but please please answer me I just need some help understanding this problem, I just don't get it.
Let A stand for x == y and B stand for x == z

Then the statements are:

(A & !B) | (!A & B)
(A | B) & (!A | !B)
!(A == B)

And so the truth table would be:

A  B   (A & !B) | (!A & B)   (A | B) & (!A | !B)    !(A == B)
T  T            F                    F                  F
T  F            T                    T                  T
F  T            T                    T                  T
F  F            F                    F                  F

Last edited on
So basically just always make truth tables? Ok, that was surprisingly simple I feel dumb now lol Thank you! :)
Last edited on
Topic archived. No new replies allowed.