![]() |
Type classification: this is a lesson resource. |
Welcome! This is a lesson in the Introductory Discrete Mathematics for Computer Science course.
Previous lesson: Introduction to boolean logic
Truth tables are mathematical tables used in logic, to compute the truth values of logical expressions. They are tables of boolean values (values that are either true or false). The boolean domain is the set of all possible boolean values; there are two elements in the boolean domain, true and false. Thus, the boolean domain can be written as {T, F}.
A boolean n-tuple is an array of n boolean values.
Here is your first example of a truth table!
? | ||
---|---|---|
T | T | T |
T | F | T |
F | T | F |
F | F | F |
What operation is performed here?
ANSWER: The operation performed is that the first truth value in the 3-tuple is copied. You can make many types of truth tables, some of which will be shown in this lesson.
A propositional operator is a rule defined by a truth table. Some propositional operators are represented by symbols. You will learn about some of these symbols in this lesson, and more next time.
Your first propositional operator is called the negation operator. It reverses the truth value of the input. The negation operator is a monadic operator, i.e. it operates on an input with only one argument. A dyadic operator operates on an input with two arguments, e.g. p and q.
: The negation operator. Some people call it the NOT operator. However, this is a bit dangerous because words in language tend to be far more vague than logic.
Here is the truth table for the negation operator:
T | F |
F | T |
1. This truth table is constant true, i.e. it always returns true.
Value returned | |
---|---|
T | T |
F | T |
2. This truth table is the identity, i.e. it always returns the value of p.
Value returned | |
---|---|
T | T |
F | F |
3. This truth table, as we have discussed, is the negation.
Value returned | |
---|---|
T | F |
F | T |
4. This truth table is constant false, i.e. it always returns false.
Value returned | |
---|---|
T | F |
F | F |
In general, there are 22n truth tables for an n-tuple operator.
The next lesson is called Logical AND.