levo

Theory of Computation

Sets and Set Notation

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

Overview

Recall questions on what a set is, the two notations for specifying one, and the meaning of the symbols in a set comprehension.

What you need to know

Answer each one before you reveal it.

Your recallNot started
Key term

Is {Ø} the same as Ø?

Key term

Is the set of real numbers countable? Explain the significance of the answer.

Questions from this subtopic

Each one with the model answer underneath.

  1. 1

    What is a set?

    Model answer

    A set is an unordered collection in which no value appears more than once. Because it is unordered, {1, 2, 3} and {3, 1, 2} are the same set, and because each value occurs at most once, writing a value twice adds nothing.

  2. 2

    Give the two notations for specifying a set, with an example of each.

    Model answer

    Either list the members between curly braces — A = {1, 2, 3, 4, 5} — or define them by a property they satisfy, which is set comprehension: A = {x | x ∈ ℕ ∧ x ≥ 1}. The second form says that A contains exactly those x for which the stated condition holds, here every natural number of at least 1. Listing suits small finite sets; comprehension is the only workable option for very large or infinite ones.

  3. 3

    In the set comprehension A = {x | x ∈ ℕ ∧ x ≥ 1}, what does each symbol mean?

    Model answer

    The vertical bar | is read 'such that'. The symbol ∈ is the membership test, so x ∈ ℕ asserts that x belongs to ℕ. ℕ names the natural numbers, {0, 1, 2, 3, 4, …}. The symbol ∧ is logical AND, joining the two conditions, so x ≥ 1 imposes a second requirement: x must be at least 1. Taken as a whole, the expression denotes every x that is both a natural number and no smaller than 1 — that is, {1, 2, 3, 4, …}, with 0 excluded by the second condition.

  4. 4

    Write in set comprehension notation the set of even natural numbers greater than 10, and list its first four elements.

    Model answer

    E = {x | x ∈ ℕ ∧ x > 10 ∧ x mod 2 = 0}. Read: the set of all x such that x is a natural number and x is greater than 10 and x divides exactly by 2. Its first four elements are 12, 14, 16 and 18.

  5. 5

    How does Python let you construct a set, and what is a set comprehension in Python?

    Model answer

    Curly braces build a set object directly, so {1, 2, 3} is a set of three elements. A set comprehension derives a new set from an existing one by stating a rule for its members: evaluating {2 * x for x in {1, 2, 3}} yields {2, 4, 6}, each element being double the corresponding element of the original. Python describes this as a comprehension over {1, 2, 3}, and it is the programming counterpart of the mathematician's {2x | x ∈ {1, 2, 3}}.

  6. 6

    What is the empty set, and what are the two ways of writing it?

    Model answer

    The empty set is the set with no elements. It is written {} or, using the alternative symbol, Ø.

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 Theory of Computation, 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.