Sets and Functions in Discrete Math:
Sets and functions form the backbone of discrete mathematics, and understanding sets and functions in discrete math early makes every later QR2 topic — from probability to graph theory — much easier to follow. This guide covers the six core concepts you need, with clear examples for each.
This topic is part of the QR2 curriculum at UCP, and it also lays groundwork for database queries and data structures you’ll encounter in your BS Analytics courses.
1. What Is a Set?
A set is simply a well-defined collection of distinct objects, called elements. For example, A = {2, 4, 6, 8} is the set of the first four even numbers. Sets are usually written with curly brackets, and each element is listed only once.
2. Set Operations
There are three operations you’ll use constantly:
- Union (A ∪ B): all elements in A, B, or both.
- Intersection (A ∩ B): only elements that appear in both A and B.
- Complement (A′): everything in the universal set that is NOT in A.
Example: If A = {1, 2, 3} and B = {2, 3, 4}, then A ∪ B = {1, 2, 3, 4} and A ∩ B = {2, 3}.
3. Venn Diagrams
A Venn diagram is the fastest way to visualize set relationships. Draw two overlapping circles for A and B; the overlapping region is A ∩ B, and everything inside either circle is A ∪ B. For three-set problems, draw three overlapping circles and work from the innermost region outward.
4. Subsets and Power Sets
Set A is a subset of B (A ⊆ B) if every element of A is also in B. A power set is the set of all possible subsets of a set, including the empty set and the set itself. A set with n elements has 2⿠subsets in its power set.
5. What Is a Function?
A function is a rule that assigns each element of one set (the domain) to exactly one element of another set (the range). Think of it as a strict “input → output” machine: one input can never produce two different outputs.

6. Types of Functions
- One-to-one (injective): every output comes from exactly one input — no two inputs share an output.
- Onto (surjective): every element in the range is used by at least one input.
- Bijective: a function that is both one-to-one and onto, meaning it has a perfect one-to-one pairing between domain and range.
Worked example: For f(x) = x + 2, mapping from integers to integers, every input produces a unique output, and every integer in the range is reachable — so this function is bijective.
Why This Matters for BBA Analytics Students
Set theory underlies how databases filter and join data (think of SQL’s UNION and INTERSECT commands), and function concepts appear again when you study mathematical modeling in statistics courses. Getting comfortable now saves you real time later.
For related practice, see our guides on counting principles in discrete math and discrete math truth tables examples.
Frequently Asked Questions
Q1: What are sets and functions in discrete math used for?
They provide the mathematical language for grouping, comparing, and mapping data — used everywhere from database design to computer science algorithms.
Q2: What’s the difference between a subset and a power set?
A subset is one specific collection of elements from a set, while a power set is the complete collection of every possible subset.
Q3: How do I know if a function is one-to-one?
Check whether any two different inputs ever produce the same output. If not, it’s one-to-one.
Q4: Why are Venn diagrams useful for sets?
They let you visually solve union, intersection, and complement problems quickly, especially with two or three sets involved.
Q5: How many subsets does a set with 4 elements have?
2â´ = 16 subsets, including the empty set and the full set itself.
Keep Practicing
Try drawing Venn diagrams for three different sets from your own class notes, then identify whether given functions are one-to-one, onto, or both.
Have solved examples or notes on sets and functions? Upload them to brainydock.site to help fellow UCP students. Browse more topics in our QR2 category.
