Quarry School

Negate a condition

Subject: Computing
Level 1 · FoundationsAbout 3 min read
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Imagine a shop sign that always shows exactly one of its two faces, OPEN or CLOSED.

    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.

    Step

    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.

    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.

    1 In plain words

    Imagine a shop sign that always shows exactly one of its two faces, OPEN or CLOSED. At noon it shows CLOSED. Keep that moment fixed as you work.

    Let A stand for the condition “the sign shows OPEN.” Here a condition is a statement you can mark true if it fits what you see or false if it doesn’t. A is false. Read NOT A as “the sign does not show OPEN.” That statement is true.

    True and false are called truth values. To negate a condition, take its known truth value and write the other one. Use the table to look up the two cases.

    2 Picture it

    SignANOT ACLOSEDfalsetrueOPENtruefalse

    The CLOSED sign gives false for A and true for NOT A. The OPEN sign gives true for A and false for NOT A.

    Read A for each sign face, then reverse its truth value.

    3 Why

    Each row shows one possible view of the sign at noon. Read both statements against the face in that row. The OPEN face fits “the sign shows OPEN,” and the CLOSED face fits “the sign does not show OPEN.” Exactly one statement fits the face in each row.

    4 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.

    5 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.

    6 Trace

    Read the shop sign
    Face at noonANOT AExplanation
    CLOSEDfalsetrueThe sign does not show OPEN. Reading the sentence directly confirms true.
    OPENtruefalseThe sign shows OPEN, so its negation is false.

    7 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.

    Quick checks

    Quick check 1 of 2

    At noon the sign shows OPEN. What are A and NOT A? Reverse the output once more. What do you get?

    Show the steps and the answer
    Answer

    A is true, NOT A is false, and reversing false gives true again.

    Why: OPEN makes A true. The first reversal gives false and the second gives back the starting value.

    Source: Python Software Foundation, Python 3.13 Built-in Types: Boolean Operations

    Quick check 2 of 2

    A desk lamp is known to be on. Let L mean ‘the lamp is on’. What are L and NOT L?

    Show the steps and the answer
    Answer

    L is true and NOT L is false.

    Why: The given on state makes L true. Reversing true gives false.

    Source: Python Software Foundation, Python 3.13 Built-in Types: Boolean Operations

    Sources

    1. Python 3.13 Built-in Types: Boolean Operations. Python Software Foundation. Python Software Foundation License Version 2. Read 26 Nov 2026.