Browse Definitions :
Definition

# truth table

### What is a truth table?

A truth table is a breakdown of all the possible truth values returned by a logical expression. A truth value is typically either true or false, or 1 or 0. In some cases, the value might be based on another binary system, such as on and off or open and closed, but these are not as common. Truth tables are used in Boolean algebra and in other areas of mathematics and science that rely on Boolean logic to show the possible outcomes of an expression or operation in terms of its truth or falseness.

A logical expression includes one or more Boolean functions that determine the logic used in calculating the expression's truth or falseness. The most common Boolean functions are AND, OR and NOT, which are described in the table.

 Function Type Logic Symbols used to represent the function in calculations AND Logical conjunction Evaluates to true if both statements are true ·      Ascending wedge (∧) ·      Asterisk (*) ·      Dot (⋅) OR Logical inclusive disjunction Evaluates to true if one or both statements are true ·      Descending wedge (∨) ·      Plus sign (+) ·      Vertical bar (|) NOT Logical negation Evaluates to true when the statement is false, and evaluates to false when the statement is true ·      Dash with tail preceding statement (¬x) ·      Tilde preceding statement (~x) ·      Exclamation mark preceding statement (!x) ·      Single quote following statement (x') ·      Overline above statement (x̅)

Boolean functions can be used in any combination to define an expression's intended logic. The functions follow their own rules of precedence. The NOT function takes precedence over the other functions, which means it is evaluated first. The AND function takes precedence over the OR function. Parentheses can be used to override the rules of precedence to better control the expression's logic. As calculations within the parentheses are evaluated first.

In addition to Boolean functions, a logical expression includes variables that represent possible truth values. The functions are applied directly to the variables to define the expression's logic. For example, given the variables A and B, you can deduce the following logic:

• A ∧ B = false, except when A = true and B = true
• A ∧ B = true if A = true and B = true
• A ∨ B = true, except when A = false and B = false
• A ∨ B = false if A = false and B = false
• If A = false, then ¬A = true
• If A = true, then ¬A = false

A truth table provides a method for mapping out the possible truth values in an expression and to determine their outcomes. The table includes a column for each variable in the expression and a row for each possible combination of truth values. It also includes a column that shows the outcome of each set of values.

Consider the expression A ∧ B. The expression uses the AND Boolean function to connect the variables A and B. The possible outcomes from this expression can be mapped out in a truth table. The truth table would include a column for each variable, a column for the outcome, and a row for each possible value combination. In the following truth table, the letter T represents true (or 1) and the letter F represents false (or 0). See truth table 1:

 A B A ∧ B T T T T F F F T F F F F

The expression has four possible truth value combinations. The first row of values (after the heading) shows a value of true for each variable. The final column (highlighted in blue) also shows a true value. This means that the expression returns true when both variables are true. However, the subsequent rows indicate that the expression returns false for all other value combinations. In other words, if only one variable is true or neither of them is true, the expression evaluates to false. This is because the expression includes the AND operator, which states that both statements must be true for the expression to evaluate to true.

Not surprisingly, changing the expression's Boolean function affects the results. For example, the expression A ∨ B uses the OR function to connect the two variables. Although there are still only four possible value combinations, the results are much different, as shown in the following truth table. Now the expression evaluates to false only if both A and B are false. See truth table 2:

 A B A ∨ B T T T T F T F T T F F F

You can also use truth tables when working with the NOT operator. For example, the expression ¬A specifies the logical negation of A. Because there is only one variable, the truth table requires only one column for that variable, along with the outcome column. See truth table 3:

 A ¬A T F F T

The table requires only two value rows because there are only two possible values: true and false. Because the NOT operator is used, the expression returns false if A is true and returns true if A is false.

Truth tables can also be used for expressions that include Boolean functions other than OR, AND or NOT. For example, an expression might contain a function such as the conditional (→), biconditional (↔) or XOR exclusive disjunction (⊻ or ⊕). In addition, truth tables are often used to map out possible combinations of logic gate input and their expected output. Logic gates carry out logical operations in electronic circuits by processing binary input and producing a single output.

### Working with compound logical expressions

A truth table can be especially useful when working with more complex expressions that include multiple variables and Boolean functions. Consider the expression ¬(A ∨ B) ∧ (¬C ∨ D). It includes the variables A, B, C and D, as well as the functions AND, OR and NOT. To create a truth table for this expression, you should first create a column for each variable, a column for the final output and a row for each possible value combination (along with the header row). See truth table 4:

 A B C D ¬(A ∨ B) ∧ (¬C ∨ D)

You can calculate the number of value rows needed by using the formula 2n, where n is the number of variables in the expression. In this case, there are four variables so there are 16 value rows (24 = 16). After you create your initial shell, you can then fill in the possible value combinations for each row, based on the four variables. See truth table 5:

 A B C D ¬(A ∨ B) ∧ (¬C ∨ D) T T T T T T T F T T F T T T F F T F T T T F T F T F F T T F F F F T T T F T T F F T F T F T F F F F T T F F T F F F F T F F F F

See truth table 6:

 A B C D ¬(A ∨ B) ∧ (¬C ∨ D) T T T T F T T T F F T T F T F T T F F F T F T T F T F T F F T F F T F T F F F F F T T T F F T T F F F T F T F F T F F F F F T T T F F T F F F F F T T F F F F T

From the truth table results, you can see that the expression returns a value of true only under three conditions:

• A = false, B = false, C = true, D = true
• A = false, B = false, C = false, D = true
• A = false, B = false, C = false, D = false

Creating the initial truth table shell is typically a straightforward process. Most of the real work comes when calculating the expression for each value row. For this reason, it can sometimes be useful to extend the truth table to include a breakdown of the expression's individual calculations, such as those included in parentheses or negated with a NOT function. For example, the following truth table adds four columns to the table, one for each of the expression's individual calculations. See truth table 7:

 A B C D A ∨ B ¬(A ∨ B) ¬C (¬C ∨ D) ¬(A ∨ B) ∧ (¬C ∨ D) T T T T T F F T F T T T F T F F F F T T F T T F T T F T T F F T F T T F T F T T T F F T F T F T F T F F F F T F F T T F T T F T F F F T F T T F F T T T T F F T F F T T F T F F F F F T F T T F T T F F T F F T F T T F F F T T F T F T T F F T F F T F F F F F F T F T T T T F F F F F T T T T

The new columns are outlined in a heavier border. Each of these columns shows the output for that calculation, based on the possible value combinations. For example, the A ∨ B column for the first row shows a value of true when both A and B are true, but the ¬(A ∨ B) column (the first column highlighted in yellow) shows a value of false because the calculation adds the NOT function.

The calculation represented by ¬C column also uses the NOT function, so the value of the C variable is negated. (True evaluates to false, and false evaluates to true.) This output is used in the calculation represented by the (¬C ∨ D) column (the second column highlighted in yellow).

The two columns highlighted in yellow represent the two main parenthetical calculations in the outer expression. You can use these columns to calculate your final expression. You do not have to highlight the columns in this way, but such an approach can make it easier to calculate the value of the final expression. Because the expression connects these two calculations with an AND function, both columns must show a value of true for the expression as a whole to evaluate to true.

This was last updated in December 2022

• remote infrastructure management

Remote infrastructure management, or RIM, is a comprehensive approach to handling and overseeing an organization's IT ...

Port address translation (PAT) is a type of network address translation (NAT) that maps a network's private internal IPv4 ...

• network fabric

'Network fabric' is a general term used to describe underlying data network infrastructure as a whole.

• DNS over HTTPS (DoH)

DNS over HTTPS (DoH) is a relatively new protocol that encrypts domain name system traffic by passing DNS queries through a ...

• governance, risk and compliance (GRC)

Governance, risk and compliance (GRC) refers to an organization's strategy for handling the interdependencies among the following...

• total risk

Total risk is an assessment that identifies all the risk factors associated with pursuing a specific course of action.

• enterprise IT (enterprise-class IT)

Enterprise-class IT (also known as enterprise-grade, or enterprise IT) is hardware, software and other IT services designed to ...

• microtargeting

Microtargeting (also called micro-niche targeting) is a marketing strategy that uses consumer data and demographics to identify ...

A business process is an activity or set of activities that accomplish a specific organizational goal. Business processes should ...

• employee onboarding and offboarding

Employee onboarding involves all the steps needed to get a new employee successfully deployed and productive, while offboarding ...

• skill-based learning

Skill-based learning develops students through hands-on practice and real-world application.

• gamification

Gamification is a strategy that integrates entertaining and immersive gaming elements into nongame contexts to enhance engagement...

• Microsoft Dynamics 365

Dynamics 365 is a cloud-based portfolio of business applications from Microsoft that are designed to help organizations improve ...

• Salesforce Commerce Cloud

Salesforce Commerce Cloud is a cloud-based suite of products that enable e-commerce businesses to set up e-commerce sites, drive ...

• Salesforce DX

Salesforce DX, or SFDX, is a set of software development tools that lets developers build, test and ship many kinds of ...

Close