Computer Science I / Truth Tables and Logical Equivalence
Practice question · Put in order

Order the steps of the foolproof procedure for deciding whether two boolean expressions are equivalent.

Hints
  1. Both expressions have to be evaluated over the same set of rows before any comparison is possible.
  2. The verdict is the last step, and it depends on all rows, not on finding one row that agrees.
Show the answer
  1. List every combination of the input variables, giving 2 to the power n rows
  2. Evaluate the first expression on each row and record its output column
  3. Evaluate the second expression on the same rows and record its output column
  4. Compare the two output columns row by row
  5. Declare the expressions equivalent only if the columns agree on every single row
Why

The input rows must be fixed first, or the two columns are not comparable. Agreement on every row is required: a single differing row is enough to prove non-equivalence, whereas agreement on some rows proves nothing. This exhaustive check is why the truth table is called the complete specification of a function.

Read the lesson: Truth Tables and Logical Equivalence →

Practise Truth Tables and Logical Equivalence

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Truth Tables and Logical Equivalence