Composition of Relations
Definition
Let be a relation from set to set , and let be a relation from set to set . The composition of relations is the relation from to defined by
In words, belongs to the composition if and only if there is at least one intermediate element such that is related to by , and is related to by .
The order of composition is important:
- means first apply , then apply .
- In relation notation, the right relation is applied first.
Main Content
1. Basic Idea of Composition of Relations
- Composition describes a two-step connection: the first relation takes you from one set to an intermediate set, and the second relation takes you from that intermediate set to another set.
- It is similar to following a path through a network: if one node is connected to a second node, and the second node is connected to a third, then composition tells us whether the first node is indirectly connected to the third.
Suppose:
Let and
Then:
- From , via , we can reach
- From , via , we can reach and
- From , via , we can reach and
- From , via , we can reach
So,
This shows that composition collects all possible results of chaining relations.
2. Ordered-Pair Rule and Notation
- Composition is defined using ordered pairs, so both the starting element and ending element matter.
- If and , then is in . This is the exact rule used to determine the composed relation.
- The notation is read as “ composed with ” or “ after .”
A very common mistake is reversing the order. For relations: in general.
Example: Let Then but is empty, because there is no pair in starting from and no pair in ending at the correct intermediate value.
This shows that the order of composition is crucial.
3. Properties and Uses in Relation Analysis
- Composition helps in studying how relations behave over multiple steps, especially in recursive structures, transitive closure, and reachability.
- It is closely related to transitivity: a relation is transitive if whenever and , then . This is exactly the idea of composing a relation with itself and seeing whether the result stays inside the same relation.
- Composition is associative, meaning: when the relations are appropriately defined. This allows long chains of relations to be grouped without changing the result.
Important examples of use:
- In directed graphs, composition helps determine whether there is a path of length 2, 3, or more between vertices.
- In database queries, composition can represent joining tables through common attributes.
- In function theory, composition is the same structure used for composing functions, making it a bridge between relations and functions.
Working / Process
-
Identify the two relations and their domains/codomains
Determine the first relation and the second relation . Make sure the output set of matches the input set of , because composition is only possible when the middle set is compatible. -
Match intermediate elements
Look for elements such that and . Each valid middle element produces a possible pair . -
Form the composed relation
Collect all pairs obtained through the intermediate matches. Remove duplicates if the same pair appears more than once, because relations are sets of ordered pairs.
Example:
Let and
Step 1: Check compatibility
- goes from numbers to numbers.
- goes from numbers to letters.
- Composition is valid because the second component of matches the first component of .
Step 2: Find chains
- in , and in , so
- in , and in , so
- in , and in , so
Step 3: Write the result
Advantages / Applications
- It simplifies the study of multi-step relationships by reducing them to a single relation.
- It is essential in graph theory for finding indirect connections and paths between vertices.
- It is useful in computer science for database joins, automata transitions, program semantics, and dependency analysis.
Summary
- Composition of relations combines two relations into one by linking them through a common intermediate element.
- The order matters: means apply first, then .
- It helps in finding indirect connections and is widely used in mathematics and computing.
- Important terms to remember: relation, ordered pair, domain, codomain, composition, transitivity, associative property