gamesblog

Truth tables

P AND NOT (Q OR R), with P = 1, Q = 0, R = 1 — is it 1 or 0? Evaluate logic expressions and gate circuits, find the inputs that light them, count the 1s.

  • Logic
  • Timed
  • Endless levels

How it plays

Inputs are 1 (true) or 0 (false). NOT flips the value right after it — NOT Q OR P means (NOT Q) OR P; AND is 1 only when both sides are; OR when at least one is; XOR when they differ; → is 0 only when the left side is 1 and the right side 0. Work from the innermost brackets out.

Three kinds of question: what an expression gives for the inputs shown; which of the inputs offered makes it 1; and in how many rows of its full truth table it is 1. The expression can also be written as a circuit, one gate a line.

Levels add operators without end, then XOR and →, then more inputs, and less time. The working shows every gate’s value.

Keys

Space starts and skips ahead · 1–9 pick · Enter submits · Esc stops. On a phone, tap.

What it trains

This practises evaluating boolean expressions and reading truth tables, the skill used in logic, circuits and code. It claims nothing wider.

Learn

How to get better at truth tables: the method, the techniques, what each new level asks of you, and the traps the wrong answers are made of.

Your approach to each question

  1. Read the question: is it the value for these inputs, the inputs that make it 1, or how many rows are 1? Each wants a different method.
  2. Find the outermost operator — the one outside every bracket, or the last gate. That is the one whose rule decides the answer.
  3. For a value, work from the innermost brackets out, or gate by gate in order, writing each 1 or 0 as you go. Stop early when one side already decides it.
  4. For the inputs that make it 1, start at the output and ask what each side must be. For a count, split the expression into parts that share no inputs and count each part.

Techniques and tricks

  • Let one side decide

    AND with a 0 is 0, OR with a 1 is 1, and → is 1 whenever its left is 0 or its right is 1. Check the shorter side first; often you never need the other.

  • NOT binds tight

    NOT applies only to what comes right after it: a letter, or one bracket. NOT Q OR P is (NOT Q) OR P. To push a NOT inside a bracket, flip AND and OR as you go.

    e.g. NOT (P OR Q) is NOT P AND NOT Q: 1 only when both are 0.

  • → fails in one row only

    A → B is 0 only when A is 1 and B is 0. So to make → give 1, either make the left 0 or the right 1; to count its 1s, count its 0s and take them away.

    e.g. (P AND Q) → R over 3 inputs is 0 only for P = 1, Q = 1, R = 0, so 7 of 8 rows are 1.

  • XOR counts the 1s

    XOR is 1 when its two sides differ. A chain of XORs is 1 when an odd number of its inputs are 1. If the output is an XOR and one of its sides is a lone input used nowhere else, exactly half the rows are 1.

    e.g. P XOR Q XOR R is 1 in 4 of 8 rows: 100, 010, 001, 111.

  • Count by fractions

    When the two sides of an operator share no inputs, multiply their shares: AND multiplies them, OR is 1 minus both misses multiplied, NOT is 1 minus. Then multiply by the number of rows.

    e.g. P AND (Q OR R): ½ × ¾ = 3/8. Over 4 inputs that is 6 of 16 rows, and NOT of it is 10.

  • Unused inputs double the count

    An input that appears nowhere in the expression splits every row in two. Count over the inputs that are used, then double for each one that is not.

As the levels climb

  • You start with one operator — AND, OR or NOT — over two inputs. Each level then changes one thing, in turn: one more operator, a new operator, one more input, less time.
  • The new operators arrive in order: XOR, then →. Learn the one row where → is 0, and that XOR is 0 when both sides are 1.
  • Inputs grow up to “Most inputs”, so a table of 4, 8, 16 or more rows. Past 8 rows, never write the table out for a count; use fractions and the unused-input rule.
  • Operators keep coming without end. Long expressions are still trees: find the outermost operator, decide which side matters, and only evaluate what you need.
  • The clock closes to 80%, 65% and 55%. The time is 8 seconds plus 3.5 per operator, plus 2 per table row for the which-inputs and how-many questions.

Traps to avoid

  • The near-miss inputs: on “Which inputs make it 1?”, every wrong option gives 0, and they are picked to differ from the right answer in as few inputs as possible. Find the input that differs and check that one.
  • Counting the 0s: on “How many rows are 1?”, the number of 0 rows sits among the options. Before you answer, ask whether you counted the 1s or the 0s.
  • Half the rows: half the table is often offered as a guess. Pick it only when you have a reason — an XOR on a lone input, or a count that really comes out that way.
  • One out: counts one too high and one too low are offered beside the answer. If you counted row by row, recheck the rows where all inputs are 1 and all are 0, which are easy to skip.
  • XOR read as OR: when both sides are 1, OR gives 1 and XOR gives 0. Slow down on every XOR whose two sides are both true.

How to practise

  • Tick one box at a time in “Kinds of question” — “What does it give?” first, then “Which inputs make it 1?”, then “How many rows are 1?” — and mix them once each is quick.
  • Switch “Written as” to “Gates, one a line” to practise reading a circuit, where the brackets are replaced by names you must follow.
  • Set “Answer counts by” to “Typing the number” so a count has to be exact, rather than picked from near neighbours.
  • Keep “Most inputs” at 3 until the fraction trick is automatic, then raise it towards 6.

Levels

Each question has a clock that comes from the work it asks for. There is no last level: at least one dial turns without end. Your level is judged on your last ten answers, every ten: 90% moves you up, below 80% moves you down, which holds most people near four in five right.

All of it is in the settings beside Start — how many answers a judgement looks at and how often it recalibrates, the thresholds, the time, which questions, how many options, and whether you see each verdict at once or review them together at the judgement. You can also jump to any level.

More logic

All games →