Truth tables are fundamental to understanding the logical properties of statements in mathematical logic and computer science. They provide a clear and effective way to analyze and present the truth values of compound statements built up from simpler ones using logical connectives like AND, OR, and NOT. Let's explore three practical examples of truth tables to illustrate this concept.

Before delving into the examples, let's briefly recap the truth values for the logical operators. A statement can have two truth values: TRUE (T) or FALSE (F). The NOT operator inverts the truth value, while AND and OR operators behave as follows:

- NOT (A): T if A is F, and F if A is T
- AND (A AND B): T only if both A and B are T, otherwise F
- OR (A OR B): T if at least one of A or B is T, otherwise F
Example 1: NOT Operator

The NOT operator is straightforward, as it simply inverts the truth value of a given statement. Here's an example using the statement "It is raining":
| P (It is raining) | NOT P (It is not raining) |
|---|---|
| T | F |
| F | T |

The truth table for NOT P clearly shows that when the statement "It is raining" is true, the statement "It is not raining" is false, and vice versa.
Sub-topic A: Inverting Multiple Statements
When dealing with multiple statements, the NOT operator can be used to create compound statements. For example, consider the statements "It is raining" (P) and "I have an umbrella" (Q). The statement "It is raining, but I don't have an umbrella" can be represented as (P AND NOT Q).

The truth table for (P AND NOT Q) would list eight possible combinations of T and F for P and Q, illustrating when the statement "It is raining, but I don't have an umbrella" is true or false.
Sub-topic B: Combining NOT with AND and OR
The NOT operator can also be combined with AND and OR to create more complex statements. For instance, the statement "It is raining or it is not snowing" can be represented as (P OR NOT R), where R is the statement "It is snowing".

The truth table for (P OR NOT R) would similarly list eight possible combinations, displaying the truth value of the statement for each case. This example demonstrates how truth tables can help understand the truth values of complex statements involving multiple logical operators.
Example 2: AND Operator




















The AND operator requires both statements to be true for the compound statement to be true. For instance, consider the statements "It is raining" (P) and "I have an umbrella" (Q). The statement "It is raining, and I have an umbrella" can be represented as (P AND Q).
| P (It is raining) | Q (I have an umbrella) | P AND Q (It is raining, and I have an umbrella) |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
The truth table for (P AND Q) shows that the statement is true only when both "It is raining" and "I have an umbrella" are true.
Sub-topic C: AND with More Statements
You can also use the AND operator with more than two statements. For example, consider the statements "It is raining" (P), "I have an umbrella" (Q), and "My car is waterproof" (R). The statement "It is raining, I have an umbrella, and my car is waterproof" can be represented as (P AND Q AND R).
The truth table for (P AND Q AND R) would list 2^3 = 8 possible combinations, illustrating the truth value of the statement for each case, with all three statements needing to be true for the compound statement to be true.
Sub-topic D: Combining AND and OR
The AND operator can be combined with the OR operator to create intricate statements. For example, consider the statements "It is raining" (P) and "I have an umbrella" (Q). The statement "I have an umbrella, or it is raining, and I don't mind getting wet" can be represented as (Q OR (P AND NOT W)), where W is the statement "I mind getting wet".
The truth table for (Q OR (P AND NOT W)) would list 2^3 = 8 possible combinations, revealing the truth value of the statement for each case, illustrating that the statement is true if you have an umbrella or if it is raining and you don't mind getting wet.
Example 3: OR Operator
The OR operator is true if at least one statement is true. For instance, consider the statements "It is raining" (P) and "I have an umbrella" (Q). The statement "I have an umbrella, or it is not raining" can be represented as (Q OR NOT P).
| P (It is raining) | Q (I have an umbrella) | Q OR NOT P (I have an umbrella, or it is not raining) |
|---|---|---|
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
The truth table for (Q OR NOT P) clearly demonstrates that the statement is true if you have an umbrella or if it is not raining.
Truth tables provide a clear and effective way to analyze the truth values of compound statements, helping us understand their logical properties. They are essential tools in mathematical logic and computer science, serving as a foundation for more complex logical analyses. By mastering truth tables and their applications, you can gain a better grasp of boolean logic and its implementations in various fields.