Skip to content

Truth table exercises with answers: 4 variables

Ten formulas over A, B, C and D, sixteen rows each. Build the table, list the TRUE rows and check them against the engine's table under each problem; with sixteen rows, the fastest honest method is to describe the TRUE set by conditions and then count.

A is the most significant bit and D the least, so the rows run from 0, all FALSE, to 15, all TRUE; row 8 is A = TRUE, B = FALSE, C = FALSE, D = FALSE and row 3 is A = FALSE, B = FALSE, C = TRUE, D = TRUE. The solutions describe each TRUE set by the conditions that produce it and name the rows that are easy to miss, such as the row that two groups share and must be counted once.

The functions are the ones that come up in digital design and in rules with four conditions: two ANDs joined by OR, four-input parity, a product of two sums, agreement of two pairs, two implications in conjunction, a three-of-four quorum, a comparison on a binary digit, a double NOR, and an XOR of two ANDs. Counting the FALSE rows is often quicker than counting the TRUE ones; the solutions say which is easier for each.

1. Build the truth table of (A AND B) OR (C AND D) and list the TRUE rows. (A AND B) OR (C AND D)
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUETRUE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSETRUE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A AND B) OR (C AND D)

Classification: contingent

Seven rows: the four with A = TRUE, B = TRUE (whatever C and D are), plus the other three with C = TRUE, D = TRUE, namely with A = FALSE, B = FALSE, with A = FALSE, B = TRUE and with A = TRUE, B = FALSE. The row with all four TRUE belongs to both groups and is counted once.

2. Build the truth table of A XOR B XOR C XOR D and list the TRUE rows. A XOR B XOR C XOR D
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUETRUE
2FALSEFALSETRUEFALSETRUE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSETRUE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSETRUE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSEFALSE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUEFALSE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

A XOR B XOR C XOR D

Classification: contingent

Parity again: TRUE on the eight rows with an odd number of TRUE inputs, the four with exactly one TRUE input and the four with exactly three. Both the all-FALSE row and the all-TRUE row are FALSE.

3. Build the truth table of (A OR B) AND (C OR D) and list the TRUE rows. (A OR B) AND (C OR D)
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUETRUE
6FALSETRUETRUEFALSETRUE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUETRUE
10TRUEFALSETRUEFALSETRUE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSEFALSE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A OR B) AND (C OR D)

Classification: contingent

Nine rows: one of A, B must be TRUE and one of C, D must be TRUE. The FALSE rows are the four with A = FALSE, B = FALSE and the four with C = FALSE, D = FALSE, minus the all-FALSE row counted in both: seven in all.

4. Build the truth table of (A <-> B) AND (C <-> D): on which rows do both pairs agree? (A <-> B) AND (C <-> D)
#ABCDf
0FALSEFALSEFALSEFALSETRUE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUETRUE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUEFALSE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUEFALSE
12TRUETRUEFALSEFALSETRUE
13TRUETRUEFALSETRUEFALSE
14TRUETRUETRUEFALSEFALSE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A <-> B) AND (C <-> D)

Classification: contingent

Both pairs must agree, A with B and C with D: four rows, all FALSE; A = FALSE, B = FALSE, C = TRUE, D = TRUE; A = TRUE, B = TRUE, C = FALSE, D = FALSE; all TRUE.

5. Build the truth table of A AND NOT B AND (C OR D) and list the TRUE rows. A AND NOT B AND (C OR D)
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUEFALSE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUETRUE
10TRUEFALSETRUEFALSETRUE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSEFALSE
13TRUETRUEFALSETRUEFALSE
14TRUETRUETRUEFALSEFALSE
15TRUETRUETRUETRUEFALSE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

A AND NOT B AND (C OR D)

Classification: contingent

A must be TRUE, B FALSE and at least one of C, D TRUE: three rows, A = TRUE, B = FALSE with C = FALSE, D = TRUE, with C = TRUE, D = FALSE or with C = TRUE, D = TRUE.

6. Build the truth table of (A -> B) AND (C -> D): which rows survive both implications? (A -> B) AND (C -> D)
#ABCDf
0FALSEFALSEFALSEFALSETRUE
1FALSEFALSEFALSETRUETRUE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUETRUE
4FALSETRUEFALSEFALSETRUE
5FALSETRUEFALSETRUETRUE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUEFALSE
12TRUETRUEFALSEFALSETRUE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSEFALSE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A -> B) AND (C -> D)

Classification: contingent

Remove the four rows with A = TRUE, B = FALSE and the four with C = TRUE, D = FALSE; the row A = TRUE, B = FALSE, C = TRUE, D = FALSE is in both lists, so seven rows go and nine remain.

7. Build the truth table of the three-of-four quorum (A AND B AND C) OR (A AND B AND D) OR (A AND C AND D) OR (B AND C AND D) and list the TRUE rows. (A AND B AND C) OR (A AND B AND D) OR (A AND C AND D) OR (B AND C AND D)
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSEFALSE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A AND B AND C) OR (A AND B AND D) OR (A AND C AND D) OR (B AND C AND D)

Classification: contingent

At least three TRUE inputs: the four rows with exactly one FALSE input and the all-TRUE row, five in all. Each three-input AND term covers one of the first four rows, and all four cover the last.

8. Read A, B, C, D as the bits 8, 4, 2, 1 of a binary digit. Build the table of A OR (B AND (C OR D)) and list the TRUE rows. A OR (B AND (C OR D))
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUETRUE
6FALSETRUETRUEFALSETRUE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSETRUE
9TRUEFALSEFALSETRUETRUE
10TRUEFALSETRUEFALSETRUE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSETRUE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUETRUE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

A OR (B AND (C OR D))

Classification: contingent

The formula is TRUE when the digit is at least 5. The eight rows with A = TRUE (digits 8 to 15) are TRUE at once, and among the rows with A = FALSE only those with B = TRUE and C or D TRUE remain (digits 5, 6 and 7).

9. Build the truth table of NOR(A, B) AND NOR(C, D) and list the TRUE rows. NOR(A, B) AND NOR(C, D)
#ABCDf
0FALSEFALSEFALSEFALSETRUE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUEFALSE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUEFALSE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUEFALSE
12TRUETRUEFALSEFALSEFALSE
13TRUETRUEFALSETRUEFALSE
14TRUETRUETRUEFALSEFALSE
15TRUETRUETRUETRUEFALSE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

NOR(A, B) AND NOR(C, D)

Classification: contingent

Each NOR is TRUE only when both of its inputs are FALSE, so the whole formula is TRUE on a single row, all four FALSE. It equals NOT (A OR B OR C OR D).

10. Build the truth table of (A AND B) XOR (C AND D) and list the TRUE rows. (A AND B) XOR (C AND D)
#ABCDf
0FALSEFALSEFALSEFALSEFALSE
1FALSEFALSEFALSETRUEFALSE
2FALSEFALSETRUEFALSEFALSE
3FALSEFALSETRUETRUETRUE
4FALSETRUEFALSEFALSEFALSE
5FALSETRUEFALSETRUEFALSE
6FALSETRUETRUEFALSEFALSE
7FALSETRUETRUETRUETRUE
8TRUEFALSEFALSEFALSEFALSE
9TRUEFALSEFALSETRUEFALSE
10TRUEFALSETRUEFALSEFALSE
11TRUEFALSETRUETRUETRUE
12TRUETRUEFALSEFALSETRUE
13TRUETRUEFALSETRUETRUE
14TRUETRUETRUEFALSETRUE
15TRUETRUETRUETRUEFALSE

The engine found no law that shortens this expression; it is already as short as its rewriting laws can make it.

(A AND B) XOR (C AND D)

Classification: contingent

Exactly one of the two AND terms must be TRUE: the three rows with A = TRUE, B = TRUE where C and D are not both TRUE, and the three with C = TRUE, D = TRUE where A and B are not both TRUE. The all-TRUE row makes both terms TRUE and is FALSE.

Questions

Is there a shortcut for the XOR chain?

Yes: a chain of XOR is TRUE exactly when an odd number of its inputs is TRUE, so for four inputs you take the four rows with one TRUE input and the four with three. It is not “exactly one TRUE”, and the all-TRUE row is FALSE because four is even.

Related

Guides

Tools

See also

Practice

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.