A truth table is a list of all the possible combinations of input values and the results they lead to. The name comes from the fact that it is a mathematical table that shows all of the possible outcomes of all of the possible facts. Logic problems, like those in Boolean algebra and electronic circuits, usually use truth tables.
Definition of a Truth Table
A truth table is a math table that helps you figure out if a complex statement is true or false. In a truth table, each statement is usually represented by a letter or variable, like p, q, or r. Each statement also has its own column in the table that lists all of the possible truth values. In this lesson, we will look at some examples of truth tables and learn the basic rules for making them.
We might not draw a truth table in our everyday lives, but we still use the same kind of logic that is used to make truth tables to figure out if something is true or false. Say someone tells us, “If it’s raining outside, the football game is off.” We can use rules of logical reasoning to figure out if the statement is true or false and maybe make a plan B.
Steps to solve Truth Table:
Step 1: Learn how truth tables work
A truth table is a way to see all the ways a problem could be solved. For discrete math, you must know how to use truth tables. Here, we’ll look at all of the answers to the simple equation p q.
Step 2: Learn the signs
The first step to getting to the truth table is to figure out what the signs mean. In this particular problem, the “” stands for “not.” “p” and “q” are both things that can change. The “” is the same as the word “and.” This equation can be written as “not p and q,” which means that it is true if p is false and q is true.
Step 3: Formatting the Table
Now, let’s make the table. It is important to look at each part of the problem separately. For this problem, we will break it up into p, p, q, and p q. The picture gives you a good idea of how your table should look.
Step 4: Assigning True and False
Since there are only two variables, there are only four possible answers for each variable. For p, we put T (for true) in half of the spaces and F in the other half (for false).
Step 5: Negation
Since p is the opposite of p, you write the sign that p doesn’t have.
Step 6: Variable “q”
To get all the possible combinations for q, you switch between T and F. Since the equation only cares about p, we can ignore the p column when figuring out if it is true. The “” means that both p and q must be true for the equation to be true.
Step 7: Solving for False in the Last Column
For the first row, p is F and q is T, so if p is F and q is T, then p q is F. Only if both p and q are T does the equation equal T.
Step 8: Find the correct answer in the last column
This means that the third row is the only one with a T.
Step 9: Finishing the Table
Check again to make sure your table is right. To do this, you need to make sure your signs are correct and that the last column is done right. In the last column, you can see the result of all the different ways the variables could be put together.
Step 10: Done
Now that you know how to make a simple truth table, keep doing them. More practise will make you better at doing them.
Examples of Truth Tables
Example 1: Use conjunction to find the logical truth table for a set of values.
If P is F F T F T and Q is F T T T F,
Solution:
P | Q | P ∧ Q |
F | F | F |
F | T | F |
T | T | T |
F | T | F |
T | F | F |
Example 2: Make a truth table for the expressions ~P∨∼Q and ∼(P∧Q).
Solution:
P | Q | ~P | ~Q | ~P∨∼Q | (P∧Q) | ~(P∧Q) |
T | T | F | F | F | T | F |
T | F | F | T | T | F | T |
F | T | T | F | T | F | T |
F | F | T | T | T | F | T |
Example 3: Let S be a part of R that is not empty. Think about the following sentence: P: There is a rational number x in S that is greater than 0. Which of the statements below is the opposite of the statement p?
- A) x > S and x > 0 > x is not a rational statement.
- B) There is a rational number x such that x 0.
- C) There is no rational number x S for which x 0.
- D) Every rational number x S meets the condition x 0.
Solution:
P: There is a rational number x S where x > 0.
P: Every rational number x S meets the condition x 0.
Conclusion
A Truth Table is the name for the table that shows the boolean expression of a logic gate function. A logic gate truth table lists all of the possible inputs to the gate or circuit and the outputs that result from those inputs (s).