levo

Fundamentals of Programming

Boolean operations

  • 1 thing to know
  • Paper 1
Start revising · £5/month

Overview

Recall questions on the NOT, AND, OR and XOR operations, how XOR differs from OR, evaluating them for given values, and writing compound conditions with them.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Process

Both P and Q are True. Which of P AND Q, P OR Q and P XOR Q are True?

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What does the NOT operation do?

    Model answer

    It inverts a Boolean value: NOT True is False and NOT False is True. It is used to reverse a condition, for example WHILE NOT found.

  2. 2

    What does the AND operation do?

    Model answer

    It gives True only when both of its operands are True, and False in every other case. It is used when two conditions must hold at once, for example age >= 13 AND age <= 19.

  3. 3

    What does the OR operation do?

    Model answer

    It gives True when at least one of its operands is True, and False only when both are False. It is inclusive, so it is still True when both operands are True.

  4. 4

    What does the XOR operation do, and how does it differ from OR?

    Model answer

    Exclusive OR gives True when exactly one of its operands is True, and False when they are both True or both False. It differs from OR only in the both-True case, which OR calls True and XOR calls False. XOR is the 'one or the other but not both' operator, and it has the useful property that applying the same value twice returns the original.

  5. 5

    A is True and B is False. Evaluate NOT A, A AND B, A OR B and A XOR B.

    Model answer

    NOT A is False. A AND B is False, because B is not True. A OR B is True, because A is True. A XOR B is True, because exactly one of the two is True.

  6. 6

    Both P and Q are True. Which of P AND Q, P OR Q and P XOR Q are True?

    Model answer

    P AND Q is True and P OR Q is True, but P XOR Q is False, because exclusive OR requires exactly one operand to be True and here both are.

Other ways to work this

The same content, four other ways.

Everything in your subscription

Runs, plus a mode for every other kind of session.

1Flash
2Imposter
3Fade
4Brain dump

Learn every subtopic in runs of four questions

Facts flash and fade, a wrong word hides in some of them, and a brain dump decides which questions are locked in.

Fundamentals of Programming
Fundamentals of Data Structures
Fundamentals of Algorithms
Theory of Computation

Cram the night before, weakest topic first

A quick scan finds your weakest topics. Recall each fact you missed three times in a row.

A driver is .
softwarehardwarestorage

Blank Blitz consolidates the facts

Rapid timed gap-fills on the terms and numbers you need to recall without thinking.

✓What it iscovered
~Why it happenspartly there
How long it lastsnot there yet

Explain It tests your understanding

Explain a concept in your own words and see which of its points you covered.

Head means the first single element of a non-empty list.
TrueFalse

Test It catches misconceptions

Spot the fault in a statement. The faults are the mistakes students make most often.

721941163128510

Brain Breaks between sessions

Short focus games to reset attention, so the next set lands better than the last.

Every question in Fundamentals of Programming, on a schedule.

Learn it in runs of four questions, each ending on a brain dump against the clock. Every question you lock in comes back the next day, then at longer gaps, each time just before you would forget it.

Or £46 a year, about £3.83 a month. Cancel anytime.