Study · Pearson Edexcel 1CP2 · 1.3.1; 6.5.3
Translate a rule into an expression and test every combination.
About 60 minutes. Predict each figure, then try the green checks before you open them. The Quiz tab is the chapter check. Resources holds the long written questions.
Your learning route
A Boolean expression is true or false. A truth table lists every combination of the inputs and the result of each one. This chapter builds the table for a real rule, then joins the same idea to conditions in Python and to a logic circuit.
Use the figure before you copy a table. Predict the output, then change one input. Three inputs have eight rows. Checking two convenient examples is not a finished table.
The references are Pearson Edexcel 1CP2, section 1.3, together with Boolean conditions in programs. OCR and AQA also assess XOR. That difference is at the end, not hidden inside the Edexcel method.
Learning objectives
By the end of the chapter you should be able to:
- Define AND, OR and NOT, and evaluate them for given inputs
- Build a complete truth table, including intermediate columns
- Translate an English rule into an expression with the brackets in the right place
- Turn a numeric range into a Boolean condition without leaving a gap or doubling the range
- Read a small circuit as an expression, and test whether two expressions match on every row
12.1 A rule has to cover every combination
Test the rule, then the whole table
A person enters when (A OR B) AND NOT C. Predict the result, then check every row. Three inputs need eight rows.
A OR B is false. NOT C is true. Membership does not override a suspension, because NOT C is false whenever C is true.
Row 1: A 0, B 0, C 0 → A OR B 0, NOT C 1, access 0.
Definition: A Boolean value is True or False. With two independent inputs there are 4 rows. With three there are 8, because each new input doubles the combinations. A truth table is finished only when every row has been decided.
A club admits a person who has a membership or a guest pass, and who is not suspended. Let A mean membership, B mean guest pass and C mean suspended. The expression is (A OR B) AND NOT C. The names have to be defined. If C meant "allowed" instead of "suspended", the NOT would be wrong.
Use the figure. Set A and C true and B false. A OR B is true, NOT C is false, and the AND is false. Membership does not override a suspension under this rule. Do not replace the written rule with what you think a club ought to do.
Why This Matters: The expression is the specification. A later question can change one word of the policy, and only some rows change. You need a way to find those rows.
Common Misconception: "OR means one or the other, but not both." In this course OR is inclusive. A member who also holds a guest pass still makes A OR B true.
Examiner tip
Define the inputs in the same sentence as the expression. A bare formula with undefined letters cannot be marked against the story.
Check yourself: For (A OR B) AND NOT C, what is the result when A is true, B is false and C is true?
Retrieval answer
A OR B is true. NOT C is false. True AND false is false. The person does not enter. The suspension wins because it is outside the OR, joined by AND NOT.
12.2 AND, OR and NOT
Definition: AND is true only when both inputs are true. OR is true when either input is true, including when both are true. NOT reverses one Boolean value. In Python the operators are and, or and not. A comparison such as age >= 12 produces a Boolean value that can be combined with them.
| A | B | A AND B | A OR B |
|---|---|---|---|
| False | False | False | False |
| False | True | False | True |
| True | False | False | True |
| True | True | True | True |
There is no "maybe" in this table. If a real system does not know an input, that is a separate problem of missing data. A GCSE truth-table question gives you the inputs. Use True and False, or 1 and 0, as the question does. Do not mix them in one table.
NOT applies to the expression in its reach. NOT (A AND B) is not the same as (NOT A) AND B. Brackets show what is negated. Intermediate columns make the difference visible.
Why This Matters: Most lost marks in this topic are an operator read in the everyday English sense, or a NOT applied to the wrong part. The table is the check.
Common Misconception: "NOT (A AND B) means not A and not B, so I can drop the brackets." Those two expressions are actually equivalent. NOT (A AND B) is equivalent to (NOT A) OR (NOT B), not to (NOT A) AND (NOT B). (NOT A) AND (NOT B) is equivalent to NOT (A OR B). The brackets and the operator both matter. Test all four rows rather than trusting the English.
Examiner tip
When a question says "show that", build both output columns. One matching row is not a proof of equivalence.
Check yourself: Are NOT (A OR B) and (NOT A) AND (NOT B) equivalent?
Retrieval answer
Yes. For inputs 00, 01, 10 and 11, both expressions give 1, 0, 0, 0. Matching on all four rows is the demonstration. Matching on one row would not have been enough.
12.3 Build the eight-row table in order
Definition: List the inputs in a regular order so none are missed. Let A stay false for four rows and true for four. Let B alternate in pairs. Let C alternate every row. Then calculate one operation at a time.
| A | B | C | A OR B | NOT C | (A OR B) AND NOT C |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Access is true on three rows: a guest who is not suspended, a member who is not suspended, and a person who is both a member and a guest and is not suspended. A useful check from the policy: if C is 1, nobody enters. If C is 0, only the "no membership and no pass" row is refused. That check can catch a wrong final column.
If the policy becomes "members only, and not suspended", the expression is A AND NOT C. Guests no longer count. A truth table describes the current rule. It does not decide whether the rule is a good policy.
Why This Matters: The figure's row buttons follow this order. Use them to highlight a row you are unsure about, then write the intermediate columns yourself. Copying only the final bit is how a single NOT error survives.
Common Misconception: "I can stop when I have found one true row." A question that says "complete the truth table" wants every row. A question that says "give one row where the output is true" wants a single example. Read the command.
Examiner tip
Keep the input order you started with. Jumping around makes a repeated or missing combination hard to see.
Check yourself: How many rows of the table above allow access, and what do they have in common?
Retrieval answer
Three rows. In each of them C is 0, and at least one of A or B is 1. Any row with C = 1 is refused, including a member.
12.4 Ranges and circuits
Definition: An age from 12 to 17 inclusive is age >= 12 and age <= 17. Both comparisons must be true, so the join is AND. The outside of that interval is age < 12 or age > 17. Either way of being outside is enough, so the join is OR. The comparisons change as well as the operator. Negating only one side leaves a gap or an overlap.
Test 11, 12, 17 and 18. The value 14 sits safely in the middle and does not prove the endpoints. At 12 and 17 the inclusive rule must be true. At 11 and 18 it must be false.
A logic circuit is the same expression drawn as gates. Inputs enter a gate, and that gate's output can enter the next gate. If X is A OR B and Y is NOT C, the final AND computes X AND Y. Name the intermediate wires in a trace. Two circuits are equivalent when every input row produces the same final output, even if the drawings look different. Changing one AND to an OR can change several rows even if the first row you try still matches.
A heater that runs when the room is cold and either a timer or an override is on has the expression C AND (T OR O), with C, T and O defined as cold, timer and override. The brackets keep the override inside the cold requirement. (C AND T) OR O would let an override heat a room that is not cold. The row C = 0, T = 0, O = 1 distinguishes them: the first expression is 0 and the second is 1.
Why This Matters: Range questions look like programming questions, and they are. The truth table is the reason the boundary tests in the Python chapters exist. A circuit question is the same table drawn differently.
Common Misconception: "age >= 12 or age <= 17 describes 12 to 17." It describes almost every integer. A number below 12 still satisfies age <= 17. A number above 17 still satisfies age >= 12. The join has to be AND.
Examiner tip
For a range, state the result at both endpoints and at one value just outside each end. Four tests, not one friendly value in the middle.
Check yourself: Why does temperature < 5 or temperature > 25 give false at 5 and true at 26?
Retrieval answer
At 5, both comparisons are false, so the OR is false. The value is inside the inclusive interval 5 to 25, not outside it. At 26, temperature > 25 is true, so the OR is true. The OR is the right join because either kind of outsider should be detected.
Independent practice
Original practice · 8 marks. A heater runs when the room is cold and either a timer is active or an override is selected. Define C, T and O for these inputs. Write the expression and complete all eight rows of its truth table. State a row that distinguishes it from (C AND T) OR O.
Worked feedback and 8-mark scheme
The expression is C AND (T OR O) [2]. For input order 000, 001, 010, 011, 100, 101, 110, 111, outputs are 0, 0, 0, 0, 0, 1, 1, 1. Award one mark per correctly completed pair of rows [4]. A distinguishing row is C=0, T=0, O=1 [1]: the specified rule gives 0 but the alternative gives 1 because override is outside the cold requirement [1].
Homework
Original practice · 4 marks. Explain why temperature < 5 or temperature > 25 is suitable for detecting a value outside the inclusive interval 5–25. Give the outcomes for 5 and 26.
Four-mark feedback
Either a value below the lower bound [1] or above the upper bound [1] is invalid. At 5 both comparisons are false, so the result is false [1]. At 26 the upper comparison is true, so the result is true [1].
Design a three-input alarm. Define each input in words, write an expression, and complete the eight-row table. Then change exactly one operator. Mark the rows whose outputs differ and describe one practical consequence in the alarm's story. Keep the original and changed expressions labelled.
How the exam boards differ
Pearson Edexcel 1CP2 section 1.3 expects truth tables for AND, OR, NOT and combinations of them. XOR is not required. The club rule and the heater rule are the right shape of question.
OCR J277 section 2.4 expects AND, OR and NOT, and also XOR. XOR is true when the two inputs are different and false when they are the same. OCR also expects you to draw or complete simple logic diagrams. Use the figure's circuit as the style: name the intermediate output.
AQA 8525 section 3.4 includes Boolean logic with AND, OR, NOT and XOR, and the corresponding gate symbols. AQA may ask you to write a Boolean expression from a diagram or a diagram from an expression. Intermediate labels earn marks when the diagram has more than one gate.
If you sit OCR or AQA, add XOR to the two-input table: outputs 0, 1, 1, 0 for inputs 00, 01, 10, 11. Do not put XOR into an Edexcel answer unless the question defines it.
Sources and further practice
Practice questions and point allocations on this page are original Proof Academy material unless a question is explicitly identified as a past-paper bridge.
- Pearson Edexcel 1CP2 specification, topic 1.3
- OCR GCSE Computer Science J277, section 2.4
- AQA GCSE Computer Science 8525, Boolean logic within the computer-systems and fundamentals content
- PMT papers and mark schemes
When you use an original paper, open its matching mark scheme. A short classroom exercise is not a substitute for a full official task.
Keep your evidence
Export your notes before changing devices.
Notes stay in this browser. The Quiz tab records the chapter check, and Resources holds the long-answer questions.