Difference between revisions of "Truth table proofs"

From Computer Science
Jump to: navigation, search
Line 1: Line 1:
Truth tables are used to show all possible values that a given logical expression might take. For example, the following gives the definition of the logical AND operation.
+
Truth tables are used to show all possible values that a given logical expression might take.  
 +
 
 +
=Examples=
 +
==Definition of AND==
 +
The following gives the definition of the logical AND operation.
  
 
{| class="wikitable"  
 
{| class="wikitable"  
Line 14: Line 18:
 
|}
 
|}
  
A truth table can also be used to prove a logical identity. The following proves DeMorgan's law that ¬ (A ∧ B) is equivalent to (¬ A) ∨ (¬ B). Notice that the truth values for these (the last two columns in the table) are always the same.
+
==Proof of one of De Morgan's laws==
 +
A truth table can also be used to prove a logical identity. The following proves De Morgan's law that ¬ (A ∧ B) is equivalent to (¬ A) ∨ (¬ B). Notice that the truth values for these (the last two columns in the table) are always the same.
  
 
{| class="wikitable"
 
{| class="wikitable"
 
|-  
 
|-  
! A !! B !! A ∧ B !! ¬ (A ∧ B) !! (&not A) ∨ (&not B)
+
! A !! B !! A ∧ B !! ¬ (A ∧ B) !! (¬ A) ∨ (¬ B)
 
|-
 
|-
 
| false || false || false || true || true
 
| false || false || false || true || true
Line 28: Line 33:
 
| true || true || true || false || false
 
| true || true || true || false || false
 
|}
 
|}
 +
 +
==Disproof of a logical fallacy==
 +
Truth tables can also be used to disprove a logical fallacy. For example, one fallacy is to assume the converse of an implication holds.  If you know that (A → B) is true, and you know that B is true, the fallacy would be to then conclude that A must also be true.  Note that the statement - "if an animal is a mammal then it is also a vertebrate" - is true. If we have an animal that is a vertebrate (for example, a dog), it would be a fallacy to now conclude that the animal must also be a mammal.
 +
 +
Consider this truth table.
 +
{| class="wikitable"
 +
|-
 +
! A !! B !! A → B (which is equivalent to ¬ A ∨ B)
 +
|-
 +
| false || false || true
 +
|-
 +
| false || true || true
 +
|-
 +
| true || false || false
 +
|-
 +
| true || true || true
 +
|}
 +
In the
 +
 +
 +
=Assignment=

Revision as of 15:03, 29 August 2022

Truth tables are used to show all possible values that a given logical expression might take.

Examples

Definition of AND

The following gives the definition of the logical AND operation.

A B A ∧ B
false false false
false true false
true false false
true true true

Proof of one of De Morgan's laws

A truth table can also be used to prove a logical identity. The following proves De Morgan's law that ¬ (A ∧ B) is equivalent to (¬ A) ∨ (¬ B). Notice that the truth values for these (the last two columns in the table) are always the same.

A B A ∧ B ¬ (A ∧ B) (¬ A) ∨ (¬ B)
false false false true true
false true false true true
true false false true true
true true true false false

Disproof of a logical fallacy

Truth tables can also be used to disprove a logical fallacy. For example, one fallacy is to assume the converse of an implication holds. If you know that (A → B) is true, and you know that B is true, the fallacy would be to then conclude that A must also be true. Note that the statement - "if an animal is a mammal then it is also a vertebrate" - is true. If we have an animal that is a vertebrate (for example, a dog), it would be a fallacy to now conclude that the animal must also be a mammal.

Consider this truth table.

A B A → B (which is equivalent to ¬ A ∨ B)
false false true
false true true
true false false
true true true

In the


Assignment