De Morgan's rules explained

前端 未结 8 1084
春和景丽
春和景丽 2020-11-27 04:58

Could you please explain the De Morgan\'s rules as simply as possible (e.g. to someone with only a secondary school mathematics background)?

8条回答
  •  一整个雨季
    2020-11-27 05:32

    "He doesn't have either a car or a bus." means the same thing as "He doesn't have a car, and he doesn't have a bus."

    "He doesn't have a car and a bus." means the same thing as "He either doesn't have a car, or doesn't have a bus, I'm not sure which, maybe he has neither."

    Of course, in plain english "He doesn't have a car and a bus." has a strong implication that he has at least one of those two things. But, strictly speaking, from a logic standpoint the statement is also true if he doesn't have either of them.

    Formally:

    • not (car or bus) = (not car) and (not bus)
    • not (car and bus) = (not car) or (not bus)

    In english, 'or' tends to mean a choice, that you don't have both things. In logic, 'or' always means the same as 'and/or' in English.

    Here's a truth table that shows how this works:

    First case: not (cor or bus) = (not car) and (not bus)

     c | b || c or b | not (c or b) || (not c) | (not b) | (not c) and (not b)
    ---+---++--------+--------------++---------+---------+--------------------
     T | T ||    T   |      F       ||    F    |    F    |        F
    ---+---++--------+--------------++---------+---------+--------------------
     T | F ||    T   |      F       ||    F    |    T    |        F
    ---+---++--------+--------------++---------+---------+--------------------
     F | T ||    T   |      F       ||    T    |    F    |        F
    ---+---++--------+--------------++---------+---------+--------------------
     F | F ||    F   |      T       ||    T    |    T    |        T
    ---+---++--------+--------------++---------+---------+--------------------
    

    Second case: not (car and bus) = (not car) or (not bus)

     c | b || c and b | not (c and b) || (not c) | (not b) | (not c) or (not b)
    ---+---++---------+---------------++---------+---------+--------------------
     T | T ||    T    |       F       ||    F    |    F    |        F
    ---+---++---------+---------------++---------+---------+--------------------
     T | F ||    F    |       T       ||    F    |    T    |        T
    ---+---++---------+---------------++---------+---------+--------------------
     F | T ||    F    |       T       ||    T    |    F    |        T
    ---+---++---------+---------------++---------+---------+--------------------
     F | F ||    F    |       T       ||    T    |    T    |        T
    ---+---++---------+---------------++---------+---------+--------------------
    

提交回复
热议问题