Discrete mathematics studies structures that are countable or otherwise distinct and separable, such as sets, graphs and logical statements. These ideas sit at the heart of computer science.
Sets are one of the most important building blocks in discrete mathematics. In this module, you will explore what sets are, how we describe them and how they relate to each other.
"Once you are comfortable with sets, many other topics in discrete mathematics start to feel much more natural."
π What you will learn
- π What discrete mathematics is and why it matters
- π How to define sets and use membership notation like
a β A - π How to talk about the size of a set using cardinality
|A| - π« What the empty set is and how it differs from a set containing the empty set
- π How subsets and proper subsets describe relationships between sets
π What is Discrete Mathematics?
Discrete mathematics is the study of mathematical structures that are countable or otherwise distinct and separable, such as combinations, graphs and logical statements. These structures can be finite or infinite, but they are not continuous like the real numbers.
π What are Sets?
A set is an unordered collection of distinct objects, called elements. If an object a belongs to a set A, we write a β A. If not, we write a β A.
Examples:
Vowels = { a, e, i, o, u }
Students = { Fred, Tom, Mary, Jane }
For infinite or large sets, we often use ellipsis:
A = { 1, 2, 3, 4, 5, ... }
π Cardinality of a Set
Cardinality refers to the number of elements in a set. It is denoted as |A|. Finite sets have a natural number as their cardinality. Infinite sets are simply described as infinite.
π« The Empty Set
The empty set contains no elements. It is written as {} or β
. Be careful: { β
} is not empty. It is a set with one element, namely the empty set.
π Subsets
If all elements of set A are in set B, then we say A β B. If B has extra elements that are not in A, then A is a proper subset and we write A β B. If both sets contain exactly the same elements, then A = B.
β Key takeaway
Set theory underpins functions, relations, logic and many areas of computer science. A solid understanding of sets makes later topics in algorithms, databases and programming languages much easier to grasp.