Computing - Sets

AQA Computer Science 2022


What a set is

What is a set?

A well-defined collection of objects.

What are the two terms for objects in a set?

  • Members
  • Elements

What’s the difference between a set and a list?

Sets are unordered.

What’s the symbol for an empty set?

\[\varnothing\]

Membership notation

What does

\[x \in S\]

mean?

$x$ is a member of the set $S$.

What does

\[x \notin S\]

mean?

$x$ is not a member of the set $S$.

Set comprehension

How could you write the set of even natural numbers using set comprehension?

\[\\{ x \vert x \in \mathbb{N} \wedge x \,\text{is even} \\}\]

What would the compact form of

\[\{ x \vert x \in \mathbb{N} \wedge $x$ \,\text{is even} \}\]

be?

\[\\{ x \in \mathbb{N} \vert x \,\text{is even} \\}\]

What set does

\[\{10^n \vert n \le 1\}\]

describe?

\[\\{ 10, 100, 1000, 10000 \\}\]

How would you describe the set $\{ 5, 10, 15, ...\}$?

\[\\{ x \vert x \in N \wedge x \mod 5 = 0 \\}\]

Set difference

What does $A \\ B$ mean?

All the members that are in A but not in B.

What is the $A \\ B$ operator called?

Difference.

What does the Venn diagram for $A \\ B$ look like?

Subsets

What does it mean for $A$ to be a subset of $B$?

Every member of $A$ is also a member of $B$.

What is the notation for $A$ being a subset of $B$?

\[A \subseteq B\]

What is the notation for $A$ being a proper subset of $B$?

\[A \subset B\]

What’s the difference between a subset and a proper subset?

A proper subset means $A$ is a subset of $B$ and they are not equal.

Cartesian product

What is the Cartesian product of two sets $A$ and $B$?

The set of all ordered pairs $(a, b)$ such that $a \in A$ and $b \in B$.

What is the set comprehension notation for the Cartesian product of $A$ and $B$?

\[A \times B = \\{ (a, b) \vert a \in A \wedge b \in B \\}\]

What is the notation for the Cartesian product of $A$ and $B$?

\[A \times B\]

Cardinality

What is the cardinality of a set?

The number of members in the set.

What is the notation for the cardinality of $A$?

\[ \vert A \vert \]

What is a countably infinite set?

A set whose members can be counted by using the infinite set $\mathbb{N}$.

What is the formula for the cardinality of the Cartesian product of two sets $A$ and $B$?

\[ \vert A \vert \times \vert B \vert \]