Session 02 - Sets

Mathematics for Master Students

Author

Dr. Tobias Vlcek

Recap & Your Questions

Session 01 in a Nutshell

  • Number sets form a hierarchy: \(\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\)
  • Intervals like \([0, 500]\) describe connected ranges of reals
  • \(\sum\) and \(\prod\) are compact loops for adding and multiplying
  • Indices carry meaning: \(x_{ij}\) = flow from warehouse \(i\) to customer \(j\)
  • Implication \(p \Rightarrow q\) is a one-way street: only the contrapositive is equivalent
  • Negation swaps quantifiers: \(\neg\,(\forall x: P(x)) \Leftrightarrow \exists x: \neg P(x)\)

Common Issues in the Homework

  • Counting terms: \(\sum_{i=3}^{10} x_i\) has \(10 - 3 + 1 = 8\) terms, not \(7\): both endpoints count!
  • Over-strong negation: negating “some warehouse operates above \(90\%\) capacity” gives “every warehouse runs at at most \(90\%\)”, not “every warehouse is idle”
  • Converse error: from “certified \(\Rightarrow\) passed audit” and a supplier that passed the audit, nothing follows about its certification

. . .

Which tasks gave you trouble? Bring them up now: we take the time to go through them before we move on to today’s topic.

Warm-Up: One More Negation

NoteQuestion

Negate: “Some delivery route is unprofitable.”

. . .

Every delivery route is profitable.”: negation swaps \(\exists\) into \(\forall\) and negates the inside.

. . .

WarningCommon Mistake

“Some route is profitable” is not the negation: both statements can easily be true at the same time.

Today’s Plan

  • Set basics: elements, subsets, and cardinality
  • Set operations: union, intersection, difference, complement
  • Products & power sets: ordered pairs, routes, and selections
  • Sets in business: segmentation and feasible sets

Set Basics

What Is a Set?

A set is an unordered collection of distinct objects, called its elements.

  • Transport modes: \(M = \{\text{road}, \text{rail}, \text{waterway}, \text{ocean}, \text{air}\}\)
  • Order does not matter: \(\{1, 2, 3\} = \{3, 1, 2\}\)
  • No duplicates: \(\{1, 2, 2, 3\} = \{1, 2, 3\}\)

. . .

Think of a set as a bag: what matters is only what is inside, not in which order it went in, and never twice.

Element Notation

Membership is the most basic set statement:

  • \(a \in A\): “\(a\) is an element of \(A\)
  • \(a \notin A\): “\(a\) is not an element of \(A\)
  • \(\text{rail} \in M\), but \(\text{drone} \notin M\)
  • From Session 1: \(3 \in \mathbb{N}\), while \(-3 \notin \mathbb{N}\) (but \(-3 \in \mathbb{Z}\))

. . .

Every “is it in or not?” question has a clear yes/no answer: that is what makes a set well-defined.

Describing Sets

Two standard ways to write a set down:

  • Listing the elements: \(A = \{2, 4, 6, 8\}\)
  • Set-builder notation: \(A = \{x \in \mathbb{N} : x \text{ is even and } x \leq 8\}\)
  • Read “\(:\)” as such that: some books write “\(\mid\)” instead
  • For infinite sets, listing fails, set-builder still works: \(\{x \in \mathbb{N} : x \text{ is even}\}\)

. . .

Set-builder notation is a filter: start from a base set, keep only the elements passing the condition, exactly what a database query does.

The Empty Set

The empty set \(\emptyset = \{\}\) contains no elements at all.

  • The set of all shipments that arrived before they were sent: \(\emptyset\)
  • \(\emptyset\) is a subset of every set: it has no element that could be missing
  • An empty result is an answer, not an error: “no customer matches the filter”

. . .

WarningCommon Mistake

\(\emptyset \neq \{0\}\): the set containing zero has one element. The empty set has none.

Subsets

\(A \subseteq B\): every element of \(A\) is also in \(B\) (“\(A\) is a subset of \(B\)”).

  • \(\{2, 3\} \subseteq \{1, 2, 3\}\), and also \(\{1, 2, 3\} \subseteq \{1, 2, 3\}\)
  • Proper subset \(A \subset B\): \(A \subseteq B\) and \(A \neq B\)
  • Session 1’s hierarchy \(\mathbb{N} \subset \mathbb{Z} \subset \mathbb{Q} \subset \mathbb{R}\) is a chain of proper subsets
  • For every set: \(A \subseteq A\) and \(\emptyset \subseteq A\)

. . .

\(\subseteq\) works like \(\leq\) and \(\subset\) like \(<\): the extra line allows equality.

Set Equality

Two sets are equal if they contain exactly the same elements:

\[A = B \quad \Leftrightarrow \quad A \subseteq B \text{ and } B \subseteq A\]

  • \(\{1, 2, 3\} = \{3, 2, 1\}\): same bag, different listing order
  • To check equality, check both inclusions: a pattern you will see in many courses

Element vs Subset

The classic confusion: \(\in\) relates an element to a set, \(\subseteq\) relates two sets.

Let \(A = \{1, 2, 3\}\):

Statement True? Why
\(2 \in A\) \(2\) is an element of \(A\)
\(\{2\} \subseteq A\) every element of \(\{2\}\) is in \(A\)
\(\{2\} \in A\) the set \(\{2\}\) is not one of the three elements

. . .

WarningCommon Mistake

Writing \(2 \subseteq A\): a number is not a set, so \(\subseteq\) does not apply. Ask first: element or set?

Your Turn: Element or Subset?

NoteQuestion

Let \(B = \{5, 10, 15\}\). Which statements are true: \(\quad 10 \in B, \quad \{5, 15\} \subseteq B, \quad \{10\} \in B, \quad \emptyset \subseteq B\)?

. . .

  • \(10 \in B\): true, \(10\) is an element
  • \(\{5, 15\} \subseteq B\): true, both elements of the left set are in \(B\)
  • \(\{10\} \in B\), false: the elements of \(B\) are numbers, not sets (\(\{10\} \subseteq B\) would be true)
  • \(\emptyset \subseteq B\): true, the empty set is a subset of every set

Cardinality

The cardinality \(|A|\) is the number of elements in \(A\):

  • \(|\{\text{road}, \text{rail}, \text{waterway}, \text{ocean}, \text{air}\}| = 5\)
  • \(|\emptyset| = 0\)
  • \(\mathbb{N}\) has infinitely many elements: its cardinality is not a natural number

. . .

WarningCommon Mistake

Same bars, different meaning: \(|-5| = 5\) is an absolute value (of a number), \(|\{-5\}| = 1\) is a cardinality (of a set). The argument decides.

Sets You Already Know

Session 1 was full of sets, we just did not call them that:

  • The number sets \(\mathbb{N}, \mathbb{Z}, \mathbb{Q}, \mathbb{R}\) are sets
  • Intervals are sets in set-builder notation: \([0, 500] = \{x \in \mathbb{R} : 0 \leq x \leq 500\}\)
  • \(\mathbb{Q} = \{\frac{p}{q} : p, q \in \mathbb{Z}, q \neq 0\}\): set-builder again
  • Today we learn to combine and compare such sets

Set Operations

The Universal Set

Set operations play out inside a universal set \(U\), all objects currently under discussion:

  • Analyzing your customer base? \(U\) = all customers of the company
  • Talking about order quantities? \(U = \mathbb{R}\) or \(U = \mathbb{N}_0\)
  • \(U\) is a modelling choice: state it before you start
  • We need \(U\) in a moment to say what “everything not in \(A\)” means

Venn Diagrams

A Venn diagram shows sets as circles inside the rectangle \(U\):

. . .

Overlap = shared elements, outside the circles = the rest of \(U\): a thinking tool, not just a picture.

Union

\(A \cup B = \{x : x \in A \text{ or } x \in B\}\): everything in at least one of the sets.

. . .

\(\{1, 2\} \cup \{2, 3\} = \{1, 2, 3\}\): the “or” is inclusive, just like in logic; the shared \(2\) appears once.

Intersection

\(A \cap B = \{x : x \in A \text{ and } x \in B\}\): only the elements in both sets.

. . .

\(\{1, 2\} \cap \{2, 3\} = \{2\}\): think of it as applying two filters at once.

Set Difference

\(A \setminus B = \{x : x \in A \text{ and } x \notin B\}\): what is left of \(A\) after removing everything in \(B\).

. . .

\(\{1, 2, 3\} \setminus \{2, 3\} = \{1\}\), and beware: \(A \setminus B \neq B \setminus A\) in general, order matters.

Complement

\(A^c = \{x \in U : x \notin A\}\): everything in \(U\) outside of \(A\), i.e. \(A^c = U \setminus A\).

. . .

Books also write \(\overline{A}\) or \(A'\): same idea. A handy identity: \(A \setminus B = A \cap B^c\).

Disjoint Sets

\(A\) and \(B\) are disjoint if \(A \cap B = \emptyset\), no shared elements:

. . .

Disjoint sets are how we model clean segmentations: every customer is in exactly one region, no overlaps.

Your Turn: True or False?

NoteQuestion

For any two sets \(A\) and \(B\): is \(\quad A \cup B \subseteq A \quad\) always true?

. . .

  • False: the union is usually bigger than \(A\)
  • \(A\) = premium customers, \(B\) = churned customers: \(A \cup B\) contains churned non-premium customers, who are not in \(A\)
  • The reverse always holds: \(A \subseteq A \cup B\)
  • \(A \cup B \subseteq A\) is only true in the special case \(B \subseteq A\)

How Many in the Union?

Adding \(|A| + |B|\) counts the intersection twice, so subtract it once, the inclusion-exclusion rule:

\[|A \cup B| = |A| + |B| - |A \cap B|\]

. . .

Survey example: of 100 coffee drinkers, 70 take sugar, 60 take cream, 50 take both:

\[|A \cup B| = 70 + 60 - 50 = 80\]

. . .

So \(100 - 80 = 20\) drink their coffee black: the complement \((A \cup B)^c\).

De Morgan’s Laws for Sets

Complement flips union into intersection, and vice versa:

\[(A \cup B)^c = A^c \cap B^c \qquad\qquad (A \cap B)^c = A^c \cup B^c\]

. . .

Business example: \(A\) = delayed shipments, \(B\) = damaged shipments.

“Neither delayed nor damaged” \(= (A \cup B)^c = A^c \cap B^c\) = “on time and intact”.

. . .

This is exactly Session 1’s law \(\neg(p \vee q) \Leftrightarrow \neg p \wedge \neg q\), dressed in set notation.

One Pattern, Two Languages

Set operations are logic on membership statements, \(x \in A \cup B\) means \(x \in A \vee x \in B\):

Logic (Session 1) Sets (today)
\(p \vee q\) (or) \(A \cup B\) (union)
\(p \wedge q\) (and) \(A \cap B\) (intersection)
\(\neg p\) (not) \(A^c\) (complement)
\(p \Rightarrow q\) (implies) \(A \subseteq B\) (subset)

. . .

If you remember the logic rule, you get the set rule for free, and the other way around.

Products & Power Sets

Ordered Pairs

An ordered pair \((a, b)\) is not a set. Here, order does matter:

  • \((a, b) \neq (b, a)\) unless \(a = b\), but \(\{a, b\} = \{b, a\}\) always
  • The route (Hamburg, Munich) is not the route (Munich, Hamburg)
  • Coordinates in the plane are ordered pairs: \((2, 5) \neq (5, 2)\)

. . .

Curly braces \(\{\,\}\) = unordered set, round parentheses \((\,)\) = ordered pair. The bracket type carries the meaning.

The Cartesian Product

\(A \times B = \{(a, b) : a \in A, b \in B\}\): all ordered pairs with the first entry from \(A\), the second from \(B\).

. . .

Example: \(A = \{1, 2\}\) and \(B = \{x, y\}\):

\[A \times B = \{(1, x), (1, y), (2, x), (2, y)\}\]

. . .

Counting: every choice from \(A\) combines with every choice from \(B\), so

\[|A \times B| = |A| \cdot |B|\]

Products Build Route Sets

Let \(W = \{1, 2\}\) be warehouses and \(C = \{1, 2, 3\}\) be customers:

  • \(W \times C\) = the set of all possible routes \((i, j)\): here \(2 \cdot 3 = 6\) of them
  • Session 1’s \(x_{ij}\) is defined for every pair \((i, j) \in W \times C\): the index set of the transportation problem is a Cartesian product
  • \(\mathbb{R} \times \mathbb{R} = \mathbb{R}^2\) is the plane: every graph you will draw in Session 3 lives there

The Power Set

The power set \(\mathcal{P}(A)\) is the set of all subsets of \(A\), including \(\emptyset\) and \(A\) itself.

. . .

Example: \(A = \{1, 2\}\):

\[\mathcal{P}(A) = \{\emptyset, \{1\}, \{2\}, \{1, 2\}\}\]

. . .

WarningCommon Mistake

The elements of \(\mathcal{P}(A)\) are themselves sets: \(\{1\} \in \mathcal{P}(A)\), but \(1 \notin \mathcal{P}(A)\).

How Many Subsets?

\[|\mathcal{P}(A)| = 2^{|A|}\]

  • Why: build a subset by deciding for each element: in or out?
  • Two choices per element, \(|A|\) elements: \(2 \cdot 2 \cdot \dots \cdot 2 = 2^{|A|}\)
  • Business reading: subsets are selections: which suppliers to contract, which products to bundle
  • That count grows fast: 10 candidate suppliers already give \(2^{10} = 1024\) possible selections

Your Turn: Counting Options

NoteQuestion

A carrier may serve any subset of the regions \(\{\text{North}, \text{East}, \text{South}\}\). How many different service portfolios are possible?

. . .

\(2^3 = 8\), the elements of \(\mathcal{P}(\{\text{N}, \text{E}, \text{S}\})\):

\[\emptyset, \{\text{N}\}, \{\text{E}\}, \{\text{S}\}, \{\text{N,E}\}, \{\text{N,S}\}, \{\text{E,S}\}, \{\text{N,E,S}\}\]

. . .

Note that \(\emptyset\) counts: “serve no region at all” is a valid (if unambitious) portfolio.

Sets in Business

Customer Segmentation

Let \(P\) = premium customers, \(C\) = churned customers, \(N\) = newsletter subscribers:

  • \(P \cap C\), premium customers we lost: the win-back campaign list
  • \(C \setminus N\), churned and not reachable by newsletter: needs a phone call
  • \(P^c\), all non-premium customers: the upsell targets
  • Every data filter you will ever build is a set operation: SQL’s AND/OR/NOT are \(\cap\), \(\cup\), \(^c\)

Reading a Set Expression

How to read \(\;(P \cap C) \setminus N\;\)? Work inside out:

  • \(P \cap C\): customers who are premium and churned
  • \(\dots \setminus N\): now remove everyone on the newsletter
  • Result: lost premium customers we cannot reach by newsletter

. . .

WarningCommon Mistake

When \(\cup\) and \(\cap\) mix, grouping changes the set: \(A \cup (B \cap C) \neq (A \cup B) \cap C\) in general: when in doubt, add parentheses.

. . .

You do not need to compute anything to use set notation: most of its value is in making such statements precise.

Feasible Sets in Optimization

Every constraint defines a set of allowed values, and constraints combine by intersection:

  • Order quantity \(q\): capacity allows \(q \leq 500\), so \(q \in [0, 500]\)
  • The supplier requires a minimum order of \(20\): \(q \in [20, \infty)\)
  • The feasible set is the intersection: \([0, 500] \cap [20, \infty) = [20, 500]\)
  • Optimization = picking the best point of the feasible set
  • If the intersection is \(\emptyset\), the problem is infeasible: no plan satisfies all constraints

Sets in Your M.Sc. Courses

  • Data Science: events in probability are sets: \(P(A \cup B)\) uses today’s inclusion-exclusion rule
  • Transportation & Distribution: decision variables are indexed by Cartesian products; feasible regions are intersections
  • Analytical Methods: solution sets of equations and inequalities
  • Whenever a slide says “for all \(x \in S\)”, you now read it fluently

Closing

Key Takeaways

  • A set is an unordered collection of distinct elements: \(\in\) for elements, \(\subseteq\) for sets
  • \(\cup\), \(\cap\), \(^c\) mirror or, and, not: De Morgan works in both worlds
  • Venn diagrams turn set expressions into pictures
  • \(|A \cup B| = |A| + |B| - |A \cap B|\): don’t count the intersection twice
  • \(A \times B\) collects ordered pairs; \(\mathcal{P}(A)\) collects subsets, \(|\mathcal{P}(A)| = 2^{|A|}\)
  • Constraints are sets: feasibility is their intersection

That’s it for today.

Any Questions?

Until the Next Session

  • Work through the Tasks: problems with worked solutions
  • Check yourself with the Self-Test quiz
  • Keep the Cheatsheet next to you while practicing
  • Note down anything unclear: we start next session with your questions

. . .

Draw a Venn diagram whenever a set expression looks confusing: two circles resolve most doubts faster than staring at symbols.

Preview: Session 03: Functions

  • Functions map between sets: every input from one set gets exactly one output in another
  • Domain and range are, you guessed it, sets
  • Linear, quadratic and exponential functions in business
  • Graphs live in \(\mathbb{R} \times \mathbb{R}\), which you met today

. . .

See you there, and bring your questions!

Literature & Further Reading

  • These sessions cover the essentials: textbooks offer more depth and practice
  • Sydsaeter & Hammond: Essential Mathematics for Economic Analysis
  • Jacques: Mathematics for Economics and Business
  • Full recommendations on the tutorial’s literature page