Search code examples
booleanboolean-logicboolean-expressionboolean-operationsboolean-algebra

Difficulty resolving TRUE FALSE question using boolean


I'm having some difficulty with a problem I think.

If X = true and Y = true

((X AND Y)' AND (X' OR Y') ' ) '

I get back true. When I put it in Wolfram Alpha it gave me back false. But I think it may have had a ' by it as well? So I'm not really sure. I'm new to this and hoping for some clarification. My thinking was that:

((TRUE AND TRUE) ' AND (TRUE' OR TRUE') ' ) '

((FALSE AND FALSE) AND (FALSE OR FALSE) ' ) '

((FALSE) AND (FALSE) ' ) '

((FALSE) AND (TRUE)) '

((FALSE)) '

((TRUE))

Can someone please tell me if this is correct?


Solution

  • The ultimate result TRUE is correct, your calculation is wrong though.

    If ' is the boolean negation which turns true to false and vice versa, you have made a mistake: you did not apply De Morgan's laws.

    (A AND B)' = A' OR B'
    (A OR B)' = A' AND B'
    

    In particular

    ((FALSE) AND (TRUE))' = FALSE' OR TRUE'
    

    which is still TRUE.

    Complete simplification of the expression is possible without making use of that law though, just by knowing how AND and OR are defined for two given booleans:

    ((TRUE AND TRUE)' AND (TRUE' OR TRUE')')' =
    (TRUE' AND (FALSE OR FALSE)')' =
    (FALSE AND FALSE')' =
    (FALSE AND TRUE)' =
    FALSE' =
    TRUE
    

    We can generalize even further: for any X and Y it is (now using the aforementioned law):

    ((X AND Y)' AND (X' OR Y')')' =
    ((X AND Y)' AND (X AND Y))' =
    (Z' AND Z)' =
    FALSE' =
    TRUE
    

    (with Z = X AND Y)

    So independent of how you choose X and Y, the result is TRUE.