Discrete Structure · Unit 3
Set Theory and Relations
Exam-focused notes for Set Theory and Relations (Discrete Structure, BIT152): what the TU syllabus asks and how it has actually been tested, with 10 solved past questions from this unit.
Set Theory and Relations in short
Sets are the basic language of mathematics, and relations describe how elements of sets are connected. They are used in databases, graph theory and program design.
What this unit covers
- Set representation and operations
- Bit strings for set operations
- Power set
- Cartesian product
- Venn diagrams
- Relations and their representations
- Relation matrices
- Directed graphs for relations
- Equivalence relations
- Partial ordering
Set representation and operations
Venn diagrams
2080 · 10 marks
Explain how set operations can be represented using venn diagram with example.Convert the following sentences using quantifier: a.) Not all good peoples are heroes. b.) Every peoples in our country are loyal. c.) Some people hate good people.[10]
Relation matrices
2080 · 5 marks
How can you represent relations using matrices? Explain with suitable example. [5]
2078 · 5 marks
How can you represent relations using matrices? Suppose that $A = {1, 2, 3}$ and $B = {1, 2}$. Let $R$ be the relation from $A$ to $B$ containing $(a, b)$ if $a \in A$, $b \in B$, and $a > b$. What matrix representing $R$ if $a_1 = 1$, $a_2 = 2$, $a_3 = 3$, and $b_1 = 1$ and $b_2 = 2$? [5]
Power set
2079 · 5 marks
Define power set. What is the power set of the set A= {1,2, 3, 4}? [5]
Show solved answerHide answer
Given Data
- Set $A = {1, 2, 3, 4}$
- Number of elements: $n = 4$
STEP 1: Definition of Power Set
The power set of a set $A$ is the set of all subsets of $A$, including the empty set $\emptyset$ and the set $A$ itself.
It is denoted by $P(A)$ or $2^A$.
Key property: If $|A| = n$, then the power set contains $2^n$ subsets, i.e. $$|P(A)| = 2^n$$
STEP 2: Power Set of $A = {1, 2, 3, 4}$
Since $n = 4$, the number of subsets is: $$|P(A)| = 2^4 = 16$$
Listing subsets by size:
| Size | Subsets |
|---|---|
| 0 | $\emptyset$ |
| 1 | ${1}, {2}, {3}, {4}$ |
| 2 | ${1,2}, {1,3}, {1,4}, {2,3}, {2,4}, {3,4}$ |
| 3 | ${1,2,3}, {1,2,4}, {1,3,4}, {2,3,4}$ |
| 4 | ${1,2,3,4}$ |
Count check: $1 + 4 + 6 + 4 + 1 = 16$ ✓ (matches $\binom{4}{0}+\binom{4}{1}+\binom{4}{2}+\binom{4}{3}+\binom{4}{4}$)
Final Answer:
$$ P(A) = {\ \emptyset,\ {1},\ {2},\ {3},\ {4},\ {1,2},\ {1,3},\ {1,4}, $$ $$ {2,3},\ {2,4},\ {3,4},\ {1,2,3},\ {1,2,4},\ {1,3,4},\ {2,3,4},\ {1,2,3,4}\ } $$
Total number of elements in $P(A) = 16$.
Equivalence relations
2080.1 · 5 marks
Define equivalence relation. How do you represent relation? [5]
Show solved answerHide answer
Equivalence Relation and Representation of Relations
Definition: Equivalence Relation
A relation R on a set A is called an equivalence relation if it satisfies the following three properties simultaneously:
1. Reflexive
For every element $a \in A$: $$a \mathrel{R} a$$ Every element is related to itself.
2. Symmetric
For all $a, b \in A$: $$a \mathrel{R} b \implies b \mathrel{R} a$$
3. Transitive
For all $a, b, c \in A$: $$a \mathrel{R} b \text{ and } b \mathrel{R} c \implies a \mathrel{R} c$$
Example: Let $A = {1, 2, 3}$ and define $R$ as "has the same remainder when divided by 2." Then $R$ is reflexive, symmetric, and transitive, so it is an equivalence relation.
Representation of Relations
A relation can be represented in the following ways:
1. Set of Ordered Pairs (Roster Method)
List all pairs $(a, b)$ such that $a \mathrel{R} b$.
Example: $$R = {(1,1),\ (2,2),\ (1,2),\ (2,1)}$$
2. Matrix Representation (Boolean Matrix)
Given sets $A = {a_1, a_2, \ldots, a_m}$ and $B = {b_1, b_2, \ldots, b_n}$, define matrix $M_R$ where:
$$M_R[i][j] = \begin{cases} 1 & \text{if } (a_i, b_j) \in R \ 0 & \text{if } (a_i, b_j) \notin R \end{cases}$$
Example: For $A = {1, 2, 3}$ and $R = {(1,1),(1,2),(2,3),(3,1)}$:
$$M_R = \begin{pmatrix} 1 & 1 & 0 \ 0 & 0 & 1 \ 1 & 0 & 0 \end{pmatrix}$$
3. Directed Graph (Digraph) Representation
- Each element of the set is represented as a node (vertex).
- A directed edge (arrow) is drawn from node $a$ to node $b$ if $(a, b) \in R$.
Example: For $R = {(1,2),(2,3),(3,1)}$:
$$1 \rightarrow 2 \rightarrow 3 \rightarrow 1$$
4. Arrow Diagram
- Elements of domain set $A$ are listed on the left.
- Elements of codomain set $B$ are listed on the right.
- Arrows are drawn from $a$ to $b$ whenever $(a, b) \in R$.
Summary Table
| Method | Best Used For |
|---|---|
| Ordered Pairs | Small, explicit relations |
| Boolean Matrix | Computation and composition |
| Digraph | Visualizing properties (reflexive, symmetric, etc.) |
| Arrow Diagram | Functions and mappings |
Cartesian product
2078 · 5 marks
Define cartesian product. Find A3 for the set A = (a, b, c). [5]
Bit strings for set operations
0 · 5 marks
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. Use bit strings to find the union and intersection of the sets {1, 2, 3, 4, 5} and {1, 3, 5, 7, 9}. [5]
Directed graphs for relations
0 · 5 marks
How can we represent a relation using directed graph? Draw a directed graph of the relation R = {(1, 1), (1, 3), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (4, 1)} on the set {1, 2, 3, 4}. [5]
Make Unit 3 stick
Practice BIT152 with flashcards & quizzes