Sets and Relations are fundamental topics in Mathematics, particularly in subjects like Discrete Mathematics, Algebra, and Logic. These concepts form the basis of database theory, graph theory, and real-world applications in computing and data science. This article will provide a detailed, exam-oriented explanation of Sets and Relations, covering definitions, properties, types, and solved examples.
1. Sets
Definition of a Set
A set is a well-defined collection of distinct objects. These objects are called elements or members of the set.
- A set is usually denoted by a capital letter (e.g., A,B,C).
- Elements of a set are enclosed within curly brackets {}.
- Example: A={1,2,3,4,5} is a set containing five elements.
Types of Sets
- Empty Set (Null Set) ∅:
- A set with no elements.
- Example: A={x∣x2+1=0,x∈R} (No real number satisfies this equation).
- Finite and Infinite Sets:
- A finite set has a limited number of elements. Example: A={1,2,3}.
- An infinite set has unlimited elements. Example: B={1,2,3,4,… }.
- Equal and Equivalent Sets:
- Two sets are equal if they have the same elements. Example: A={1,2,3},B={3,2,1}⇒A=B.
- Two sets are equivalent if they have the same number of elements but different values.
- Subset and Superset:
- If every element of set A is in set B, then A is a subset of B, denoted as A⊆B.
- If B contains all elements of A and more, then B is a superset of A, denoted as B⊇A.
- Power Set:
- The set of all subsets of a set A.
- If A={1,2}, then P(A)={∅,{1},{2},{1,2}}.
- Universal Set:
- The set containing all elements under consideration, usually denoted by U.
- Example: If discussing natural numbers, U=N.
1.1 Set Operations
A set is a collection of distinct elements, and various operations can be performed on sets to analyze relationships between them.
Basic Set Operations
- Union (A ∪ B)
- The union of two sets A and B consists of all elements that are either in A, in B, or in both.
- Example: If A={1,2,3} and B={3,4,5}, then: A∪B={1,2,3,4,5}.
- Intersection (A ∩ B)
- The intersection of two sets consists of only those elements that are present in both A and B.
- Example: A ∩ B={3}
- Difference (A−B)
- The difference of two sets A and B consists of elements that are in A but not in B.
- Example: A−B={1,2}
- Complement (Ac)
- The complement of a set A consists of all elements in the universal set U that are not in A.
- Cartesian Product (A×B)
- The Cartesian product of two sets is the set of all possible ordered pairs formed by taking an element from A and one from B.
- Example: A×B={(1,a),(1,b),(2,a),(2,b)}.
3. Relations
Definition of a Relation
A relation is a subset of a Cartesian product. It describes a connection between elements of two sets.
- If A and B are two sets, then a relation R from A to B is a subset of A×B.
- Example: If A={1,2,3} and B={a,b}, a possible relation R could be: R={(1,a),(2,b)}.
Types of Relations
- Reflexive Relation: Every element is related to itself.
- Example: (a,a)∈R for all a∈A.
- Symmetric Relation: If (a,b)∈R, then (b,a)∈R.
- Example: If (1,2)∈R, then (2,1)∈R.
- Transitive Relation: If (a,b)∈R and (b,c)∈R, then (a,c)∈R.
- Example: If (1,2)∈R and (2,3)∈R, then (1,3)∈R.
- Equivalence Relation: A relation that is Reflexive, Symmetric, and Transitive.
Functions as Relations
A function is a special type of relation where each element in set AAA (domain) is related to exactly one element in set BBB (codomain).
Definition
A relation f from A to B is a function if:
- Every element in A is associated with only one element in B.
- No element in A is mapped to multiple elements in B.
Example of a Function
- Let A={1,2,3} and B={4,5,6} and define:
- f={(1,4),(2,5),(3,6)} Here, every element in A has exactly one unique image in B. Hence, f is a function.
Example of a Relation That is NOT a Function
- Let R={(1,4),(1,5),(2,5)}.
- Here, 1 is mapped to both 4 and 5, which violates the function rule. Hence, R is a relation but not a function.
Types of Functions
Functions can be classified based on how elements in the domain and codomain are mapped.
1. One-to-One Function (Injective Function)
A function is one-to-one (injective) if no two elements in the domain map to the same element in the codomain.
- Example: f(x)=x+1, where f:{1,2,3}→{2,3,4}
- Mapping: 1→2,2→3,3→4
- Unique mapping → Injective
2. Onto Function (Surjective Function)
A function is onto (surjective) if every element in the codomain has at least one pre-image in the domain.
- Example: f(x)=x2, where f:{−2,−1,0,1,2}→{0,1,4}
- Here, every element in the codomain {0,1,4} is mapped to by at least one element in the domain.
- Complete coverage → Surjective
3. One-to-One and Onto Function (Bijective Function)
A function is both injective and surjective if:
- No two elements in the domain map to the same codomain element (one-to-one).
- Every element in the codomain is mapped to (onto).
- Example: f(x)=x+1for f:{1,2,3}→{2,3,4}.
- Unique and complete coverage → Bijective
4. Constant Function
A function where every element in the domain maps to the same codomain value.
- Example: f(x)=5 for all x in the domain.
5. Identity Function
A function where each element maps to itself.
- Example: f(x)=x for all x in the domain.
Representation and Properties of Relations
A relation is a way of describing a connection between elements of two sets.
Representation of Relations
A relation R from set A to set B is a subset of the Cartesian product A×B. Relations can be represented in different ways:
- Set Notation: Listing ordered pairs.
- Example: R={(1,2),(2,3),(3,4)}.
- Matrix Representation: A binary matrix where rows represent elements of A and columns represent elements of B.
- Graph Representation: Using directed graphs (digraphs) where vertices represent elements, and edges represent relations.
Properties of Relations
A relation RRR can have the following properties:
- Reflexive Relation: If (a,a)∈R for all a∈A, the relation is reflexive.
- Example: R={(1,1),(2,2),(3,3)} is reflexive.
- Symmetric Relation: If (a,b)∈R⇒(b,a)∈R, the relation is symmetric.
- Example: If (1,2)∈R, then (2,1) must also be in R.
- Transitive Relation: If (a,b)∈R and (b,c)∈R, then (a,c)∈R.
- Example: If (1,2)∈R and (2,3)∈R, then (1,3) should also be in R.
Equivalence Relations
An equivalence relation is a relation that satisfies three properties:
- Reflexive: (a,a)∈R for all a∈A.
- Symmetric: If (a,b)∈R, then (b,a)∈R.
- Transitive: If (a,b)∈R and (b,c)∈R, then (a,c)∈R.
Example of an Equivalence Relation
Consider the relation "is congruent modulo 3" on integers. That is, aRb if (a−b) is divisible by 3.
- Reflexive: a−a = 0 is divisible by 3.
- Symmetric: If a−b is divisible by 3, then b−a is also divisible by 3.
- Transitive: If a−b and b−c are divisible by 3, then a−c is also divisible by 3.
Since all three conditions hold, this is an equivalence relation.
Equivalence Class
An equivalence class is a subset where all elements are related to each other.
Example: If we consider equivalence modulo 3:
- The equivalence class of 0: [0]={...,−3,0,3,6,...}.
- The equivalence class of 1: [1]={...,−2,1,4,7,...}.
4. Partially Ordered Sets (Posets)
A partially ordered set (poset) is a set equipped with a partial order relation.
Definition of Partial Order
A relation R on a set A is a partial order if it satisfies:
- Reflexive: aRa for all a∈A.
- Antisymmetric: If aRb and bRa, then a=b.
- Transitive: If aRb and bRc, then aRc.
Example of a Partially Ordered Set
Consider the set A={1,2,3,4} with the relation divisibility (a|b):
- 1|2,1|3,1|4
- 2|4, but 2∤3 and 3∤2.
This satisfies partial order properties but not total ordering (as not all elements are comparable).
Hasse Diagram
A Hasse diagram is a simplified directed graph that represents a partially ordered set. It removes self-loops (reflexivity) and transitive edges while preserving the order structure.
Key Features of a Hasse Diagram
- Elements of the poset are represented as nodes (vertices).
- A line (edge) is drawn from a to b if a ≤ b and there is no intermediate element c such that a ≤ c ≤ b.
- No arrows are used, as it is assumed that edges go upward in the diagram.