Quarry School

Reason with true and false: crash course

about 4 min to listen5 lessons0 questions to tryUnit 2 of 5

Short view. Each lesson's rule, its steps and its trap. Switch to Full for a worked example and a question to try in every lesson.Full view. Each lesson's rule, its steps, one worked example with Watch it solved, the trap, and one question to try.

Starts here no skill from another unit needed first

1 Read a two-state predicate

about 1 minOpen the full lessonOnly this lesson

The rule

This paper model uses one or more labeled slots, each with a known state.

For each slot, record the Boolean answer to “Is this slot free?” Use true for free and false for occupied.

Use the states from one moment and keep them fixed while you work. The rule here covers a fixed set of slots with no missing states. For the whole set, give true if one or more slots are free. Give false if zero slots are free.

How

  1. Write the total number of slots and the number occupied.
  2. Subtract the occupied count from the total. Give true if the free count is one or more. Give false if it is zero.
  3. To check, draw one box per slot and start with every box unmarked. Visit the slots once in label order. Mark each occupied box and leave each free box unmarked. Stop after the last label. Count the unmarked boxes and use that count to answer the question again.

The trap

On the returns cart, the count 1 answers “How many slots are free?” That one free slot makes the answer to “Is at least one slot free?” true. Keep the free count and the predicate result on separate lines.

2 Fill an AND table

about 1 minOpen the full lessonOnly this lesson

The rule

A AND B gives true only when A and B are both true.

If either input is false, the result is false.

How

  1. Draw three columns. Label them A (receipt present), B (name matches) and A AND B (result). Make four rows beneath the labels.
  2. From top to bottom, write false/false, false/true, true/false, true/true. In each pair, put the first value under A and the second under B. Use only true and false for the inputs. Leave the four result spaces blank.
  3. Start at the top and work down. Tick each input that is true. Write true in the result column if the row has two ticks. Write false if it has fewer.
  4. Stop when every row has a result.

The trap

Suppose a visitor has a receipt and gives a name that differs from the tag. Only A gets a tick. That row gives false, so the piece stays at the desk.

3 Fill an OR table

about 1 minOpen the full lessonOnly this lesson

The rule

For two Boolean inputs, A OR B gives true if at least one input is true.

It gives false if both are false.

Assume both input values are known and refer to the same light. The paper model answers whether the resident made a report. Delivery, reading the report, and repairing the light are outside the model.

How

  1. Draw the table on paper with A on the left, B in the middle, and Reported on the right.
  2. Write the input pairs from top to bottom. Write false and false, false and true, true and false, then true and true. Start with all four Reported spaces blank.
  3. Start at the top. Read A first. If A is true, write true in Reported. If A is false, read B and copy it into Reported.
  4. Move down one row at a time. Stop when every Reported space has a value.

The trap

Suppose the resident phones and then emails. Does the email cancel the phone report? The phone report still counts after the email, so keep Reported true in the marked last row, where both inputs are true.

4 Negate a condition

about 1 minOpen the full lessonOnly this lesson

The rule

The input to NOT is the known value you start with, here the value of A.

In this paper model it can be either of the two Boolean values, false or true. Write those values in lowercase and use uppercase NOT to show that you’re reversing a value. The output is the value you get from the rule. For false, write true. For true, write false.

How

  1. Draw a table on paper with rows for CLOSED and OPEN. Add columns for A and NOT A and leave their cells blank.
  2. Start with CLOSED. Check whether that row’s face shows OPEN to fill in A. Then use NOT to write the other value beside it.
  3. Repeat that process for OPEN. Once both rows have a NOT A value, stop filling the table.
  4. Check by using each value in the NOT A column as the input to the rule one more time. From top to bottom, true gives false and false gives true. Compare false, then true, with the original A column. Both rows match.

The trap

Leave the sign alone and work with the value on your paper. Turning the sign would give you a different observation. If the face is covered, stop before writing either value. Find out which face was showing at noon before you choose a row.

5 Check two rules against every input pair

about 1 minOpen the full lessonOnly this lesson

The rule

Compare the two final rule answers on the same row.

If every row matches, the rules are equivalent. If any row differs, record that input pair as a counterexample.

How

  1. Write the four input pairs in order. Leave the result and comparison cells blank.
  2. In the first row, find A OR B. Flip that result and record it under NOT (A OR B).
  3. In the same row, flip A to get NOT A and flip B to get NOT B. Use OR on those two values to fill (NOT A) OR (NOT B).
  4. Compare the answers under NOT (A OR B) and (NOT A) OR (NOT B). Mark the row match or mismatch.
  5. Repeat the calculation and comparison for the remaining rows. Finish the fourth row even if you have already found a counterexample.

The trap

Two matches can look like proof that the rules are equivalent. If you check only false/false and true/true, you miss the mixed rows, where one input is true and the other is false. Each mixed row makes the rules disagree.