Introduction
Relations and functions are the backbone of discrete mathematics. Almost every advanced topic — databases (a table is literally a relation), equivalence classes, ordering, graph theory, automata, and the design of algorithms — is built on these two ideas. For BCS, Bank and IT-officer written and MCQ exams, this chapter is a reliable source of marks: questions test whether you can count ordered pairs, decide if a relation is reflexive/symmetric/transitive, classify a function as one-to-one or onto, and compute compositions and inverses.
The good news: once you understand that a relation is just a set of ordered pairs and a function is a special relation where each input has exactly one output, everything else follows mechanically. This lesson builds the topic from first principles so you can answer any exam question, not just memorised ones.
Learning objectives
- Define Cartesian product, relation, domain and range, and count them correctly.
- Represent relations as sets, matrices, arrow diagrams and directed graphs.
- Test and prove the properties: reflexive, irreflexive, symmetric, antisymmetric, transitive.
- Understand equivalence relations, equivalence classes, and partial orders.
- Define a function precisely and distinguish it from a general relation.
- Classify functions as injective (one-to-one), surjective (onto), or bijective.
- Compute composition of functions, inverse functions, and count functions between finite sets.
- Avoid the classic exam traps in this topic.