levo

Theory of Computation

Sets and Set Notation

  • 2 things to know
  • Paper 1

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.

What is inside Levo

Six ways to work the same material.

1Closed book
2Open book
3Closed book

See a huge jump in your memorisation

Answer cold, learn it, then prove it stuck. Levo tracks the jump between your first attempt and your last.

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

Cram a whole paper in one sitting

Sort every topic into what you know and what you do not, then drill only the weak ones.

A driver is .
softwarehardwarestorage

Blank Blitz consolidates the facts

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

AThe integer 5 is 0101.
B0.75 is 1/2 + 1/4.
CThe fraction bits are 1100.

Build It trains answer structure

Assemble a full-mark answer from its marking points, in the order an examiner wants them.

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

Test It catches misconceptions

Spot the fault in a statement. The traps are the mistakes students actually make.

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.

Attempt a question from memory, write the correct version, then attempt it again. Levo records the jump between your first attempt and your last, and brings each question back on the day you are due to forget it.

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