Relations, Equivalence Relations and Orders

Learn how mathematics describes connections between objects with relations: sets of ordered pairs such as “divides”, “is a prerequisite of” or “has the same remainder as”. Represent relations with lists, zero-one matrices and directed graphs, prove which properties they have, and build their reflexive, symmetric and transitive closures, including with Warshall’s algorithm. Then use equivalence relations to sort objects into classes and partitions, and partial orders to compare them, drawing Hasse diagrams, finding maximal elements and bounds, and turning dependencies into topological orders and parallel schedules.

BeginnerLesson 3 of 10 in Discrete Mathematics Course

What you will learn

  1. Define a binary relation as a set of ordered pairs, combine relations with set operations and composition, and decide with proofs and counterexamples which standard properties a relation has.
    • Define relations as sets of ordered pairs
      Write a relation from one set to another or on a single set, read relation notation, and connect relations with functions and with counting.
    • Test reflexive, symmetric, antisymmetric and transitive properties
      State the standard properties of a relation on a set precisely, prove that a relation has a property or refute it with a counterexample, and avoid the usual confusions between them.
    • Combine and compose relations
      Build new relations with set operations, composition and powers, and use composition to test transitivity.
  2. Translate a finite relation into a zero-one matrix and a directed graph, read its properties from each picture, and compute with Boolean matrix operations.
    • Represent a relation with a zero-one matrix
      Write the zero-one matrix of a finite relation, read properties from it, and use join, meet and the Boolean product to combine and compose relations.
    • Represent a relation with a directed graph
      Draw the directed graph of a relation on a finite set, read its properties from the drawing, and connect paths in the graph with powers of the relation.
  3. Extend a relation as little as possible so that it becomes reflexive, symmetric or transitive, and compute transitive closures by paths, by Boolean powers and with Warshall’s algorithm.
    • Form reflexive and symmetric closures
      Explain what a closure is, compute reflexive and symmetric closures from pairs, matrices and digraphs, and recognize properties for which no closure exists.
    • Find the transitive closure through paths
      Explain why one round of composition is not enough, describe the transitive closure as the connectivity relation, and compute it from powers of the relation.
    • Compute the transitive closure with Warshall’s algorithm
      Run Warshall’s algorithm on the matrix of a relation round by round, explain why its update rule is correct, and compare its cost with the method of Boolean powers.
  4. Recognize and prove equivalence relations, find their equivalence classes, and move between equivalence relations and partitions of a set.
    • Recognize and prove equivalence relations
      Prove that a relation is reflexive, symmetric and transitive, use the standard examples such as congruence modulo m, and spot relations that fail transitivity.
    • Work with equivalence classes and partitions
      Find the equivalence classes of an equivalence relation, use the correspondence between equivalence relations and partitions, and count and combine equivalence relations.
  5. Recognize partial and total orders, draw and read Hasse diagrams, and find maximal and minimal elements, bounds and lattices.
    • Define partial orders and total orders
      Prove that a relation is a partial order, distinguish partial, total, strict and well orders, and compare elements in lexicographic order.
    • Draw and read Hasse diagrams
      Reduce a finite poset to its covering pairs, draw its Hasse diagram, and read comparabilities from upward paths.
    • Identify extremal elements, bounds and lattices
      Find maximal, minimal, greatest and least elements, upper and lower bounds and least upper and greatest lower bounds in a poset, and decide whether a poset is a lattice.
  6. Turn a partial order into a compatible total order, and use chains and antichains to plan schedules in which tasks run in parallel.
    • Topologically sort a finite partial order
      Find a total order compatible with a finite partial order by repeatedly choosing minimal elements, and explain when such an order exists and how many there can be.
    • Plan parallel schedules with chains and antichains
      Measure a poset by its longest chain and largest antichain, and use these measures to find the shortest schedule for tasks that can run in parallel.

Equivalence Relations study guide

6 chapters

1

Describe relations and test their properties

Relations describe connections such as divisibility, enrollment, and prerequisites. Ordered pairs make those connections precise, and property tests reveal how they behave. You will move from a rule to its pairs, distinguish relations from functions, and use proofs or counterexamples to check each property. Composition then connects pairs through a middle element, giving a way to describe repeated steps and test transitivity.

1.1 Define relations as sets of ordered pairs

A relation records which ordered pairs belong together. The first coordinate and second coordinate have separate jobs: “is enrolled in” connects a student to a course, while its reverse connects a course to a student.

Specify the two sets

A binary relation from A to B is a subset R⊆A×B. Write a R b when (a,b)∈R. A relation on A has both coordinates in A. State the sets before listing pairs: they determine which pairs are even possible.

Let A={Ana,Ben,Chen} and B={Algebra,Biology}. An enrollment relation is

E={(Ana,Algebra),(Ana,Biology),(Chen,Biology)}.

Ana has two outgoing pairs, Ben has none, and Chen has one. All are allowed. A function from A to B has exactly one pair starting at each element of A. Thus every function is a relation, but this enrollment relation is not a function for two separate reasons: Ana has too many outputs and Ben has too few.

Read the direction of a rule

On A={1,2,3,4}, let a R b mean a∣b: there is an integer k with b=ak. Listing the allowed second coordinates for each first coordinate gives

R={(1,1),(1,2),(1,3),(1,4),(2,2),(2,4),(3,3),(4,4)}.

The pair (1,2) belongs because 1 divides 2. The pair (2,1) does not belong. Reversing a pair changes the claim being made, even when both entries come from the same set.

For an infinite set, a rule replaces a full list. On the integers, define a R b by “a+b is even.” Then (3,5) belongs since their sum is 8, while (3,4) does not since their sum is 7.

Three special relations

The empty relation ∅ contains no pairs. The universal relation A×A contains every possible pair. The identity relation ΔA={(a,a):a∈A} contains just the diagonal pairs. On a three-element set, these have 0, 9, and 3 pairs, respectively.

The inverse flips every pair: R−1={(b,a):(a,b)∈R}. It runs from B to A. The complement keeps the original direction and includes the pairs missing from the chosen product: R‾=(A×B)∖R. On the integers, the inverse of < is >, while its complement is ≥. Equality belongs to the complement, not to the inverse.

Count relations by choices

If ∣A∣=m and ∣B∣=n, the product has mn possible pairs. Each pair can independently be included or excluded, so there are 2mn relations from A to B. On a three-element set, there are 9 possible pairs and 29=512 relations. The number 9 counts positions available for pairs; 512 counts the different subsets that can fill those positions.

Key Takeaways

  • A relation is a subset of a specified Cartesian product.
  • A function assigns exactly one output to every input.
  • Inverse reverses pairs; complement selects missing pairs.
  • There are 2mn relations from an m-element set to an n-element set.

1.2 Test reflexive, symmetric, antisymmetric and transitive properties

A property is a rule about every relevant element or pair. Proving a relation has a property requires all cases; disproving it takes one precise failure. Always keep the underlying set in view.

State each test
PropertyWhat must hold
ReflexiveEvery (a,a) belongs.
IrreflexiveNo (a,a) belongs.
SymmetricIf (a,b) belongs, so does (b,a).
AntisymmetricIf both (a,b) and (b,a) belong, then a=b.
AsymmetricIf (a,b) belongs, then (b,a) does not.
TransitiveIf (a,b) and (b,c) belong, so does (a,c).

Reflexive and irreflexive are not exhaustive choices. The relation {(1,1)} on {1,2} is neither: one loop is present and one is missing. The same pairs can pass reflexivity on one set and fail it on a larger set.

Antisymmetry permits loops and bans two-way pairs only between distinct elements. Asymmetry also bans loops; it is exactly antisymmetry together with irreflexivity. A relation can be both symmetric and antisymmetric: any set of diagonal pairs has both properties. They can also both fail, as in {(1,2),(2,1),(1,3)}.

Prove properties using the rule

Divisibility on the positive integers is reflexive because a=a⋅1. It is antisymmetric: if a∣b and b∣a, positivity gives a≤b and b≤a, so a=b. It is transitive: from b=ak and c=bl, obtain c=a(kl). It is not symmetric, since 1∣2 but 2∤1.

For a less familiar rule, test the definitions separately. On the integers, let a R b mean a≤b+1. It is reflexive since a≤a+1. Symmetry fails with 1 and 5: 1≤6, but 5≤2 is false. Antisymmetry fails with 1 and 2, since both directions hold for these unequal numbers. Transitivity fails because 3 R 2 and 2 R 1, yet 3 R 1 is false.

Include repeated elements

The letters in a transitivity test need not stand for distinct elements. If (1,2) and (2,1) belong, transitivity requires (1,1) and (2,2). This is why a two-way arrow without loops can fail transitivity.

An implication is true when its premise never occurs. The empty relation on a nonempty set is symmetric, antisymmetric, asymmetric, irreflexive, and transitive; it is not reflexive. Also, symmetry and transitivity together need not give reflexivity: {(1,1)} on {1,2} has both but misses the loop at 2.

Count the independent choices

On an n-element set, reflexivity forces the n diagonal pairs, leaving n(n−1) free choices: 2n(n−1) relations. Symmetry gives one choice per diagonal and per unordered off-diagonal pair: 2n(n+1)/2. Antisymmetry gives two choices per diagonal and three per off-diagonal unordered pair: neither direction, forward, or reverse. Its count is 2n3n(n−1)/2. At n=3 these counts are 64, 64, and 216.

Key Takeaways

  • Check the underlying set when testing reflexivity.
  • Antisymmetric permits loops; asymmetric forbids them.
  • A counterexample must show the premise holds and its required conclusion fails.
  • Transitivity includes paths returning to their starting element.
  • An implication with no triggering cases is true.

1.3 Combine and compose relations

Relations are sets, so set operations combine their membership rules. Composition does a different job: it follows one connection and then another through an intermediate element.

Combine pairs with set operations

For relations with the same source and target sets, a union keeps pairs in either relation; an intersection keeps pairs in both. Difference keeps pairs in the first but not the second. Complement is taken inside the specified Cartesian product.

On {1,2,3}, the union of < and equality is ≤, with six pairs. The union of < and > is ≠, with six off-diagonal pairs, while their intersection is empty. These operations compare membership of the same pair; they do not connect different pairs end to end.

Follow composition from right to left

If R runs from A to B and S from B to C, define

S∘R={(a,c):some b∈B has a R b and b S c}.

Apply R first, then S. The middle element proves the connection exists but is not part of the output pair. Multiple middle elements can produce the same pair, which is listed only once. Some texts write R;S for this same sequence.

Take R={(1,1),(1,2),(2,3)} and S={(1,3),(2,1),(3,3)}. Following each pair of R gives:

  • (1,1) continues through (1,3), producing (1,3).
  • (1,2) continues through (2,1), producing (1,1).
  • (2,3) continues through (3,3), producing (2,3).

Thus S∘R={(1,1),(1,3),(2,3)}. Reversing the order gives R∘S={(2,1),(2,2)}: only the pair of S ending at 1 can continue in R. Composition is not commutative.

Use powers for repeated steps

For a relation on one set, R1=R and Rn+1=Rn∘R. A pair belongs to Rn exactly when an n-step sequence of relation pairs connects its entries. Composing “is a parent of” with itself gives “is a grandparent of.”

For the relation R above, R2={(1,1),(1,2),(1,3)}. The first two pairs come from starting with the loop at 1; the third comes from 1→2→3. The pair (2,3) contributes nothing to the square because no pair starts at 3.

Connect composition to properties

Transitivity is exactly R2⊆R: every two-step connection already has its direct pair. Equality is unnecessary. Here (1,3) is in the square but missing from R, so transitivity fails.

Intersections of transitive relations remain transitive, but unions can fail: {(1,2)} and {(2,3)} are each transitive, while their union lacks (1,3). Unions and intersections preserve reflexivity when both inputs are reflexive, and symmetry when both are symmetric. Symmetry can also be written R=R−1. Reversing a composition reverses its order: (S∘R)−1=R−1∘S−1.

Key Takeaways

  • S∘R follows R first and S second.
  • Rn records exactly n relation steps.
  • Transitivity is equivalent to R2⊆R.
  • Intersection preserves transitivity; union can fail to preserve it.
2

Represent relations with matrices and directed graphs

A finite relation can be stored as a grid of zeros and ones or drawn as arrows between vertices. The matrix supports systematic computation; the digraph makes routes and cycles visible. You will translate between these views while keeping the element order and arrow direction clear, read properties from each, and compute two-step connections using Boolean multiplication. Each view describes the same underlying pairs.

2.1 Represent a relation with a zero-one matrix

A zero-one matrix stores a finite relation in a grid. Each entry answers one membership question, so the row and column orders must be stated before the entries can be read.

Build and read the matrix

List A={a1,…,am} and B={b1,…,bn}. Define mij=1 when (ai,bj)∈R, and 0 otherwise. Rows give first coordinates; columns give second coordinates. A relation from A to B has an m×n matrix, which need not be square.

For R={(1,1),(1,2),(2,3)}, using the order 1, 2, 3 for rows and columns,

MR=[110001000].

Row 1 records two outputs, 1 and 2. Row 3 has none. Reordering the elements permutes the corresponding rows or columns; it does not change which relation is being described.

Read properties from entries

For a relation on one set, use the same element order on both axes. Reflexivity means all diagonal entries are 1; irreflexivity means all are 0. Symmetry means mij=mji. Antisymmetry means the two reflected entries cannot both be 1 when i≠j; diagonal 1s are allowed. Transposing the matrix gives the inverse relation.

Union and intersection work entry by entry. The join MR∨MS puts 1 wherever either input has 1. The meet MR∧MS puts 1 only where both inputs have 1. These operations never add numerical counts.

Compute a Boolean product

For compatible matrices P and Q, the Boolean product uses AND within each connecting position and OR across all positions:

(P⊙Q)ij=⋁k(pik∧qkj).

The output is 1 when at least one middle position works. With rows as starting elements, MS∘R=MR⊙MS: the matrix of the first relation followed is on the left.

Take S={(1,3),(2,1),(3,3)}. Its matrix is

MS=[001100001].

Row 1 of MR is (1,1,0). Against column 1 of MS, (0,1,0), the matching 1 in position 2 produces 1. Against its zero column 2, the result is 0. Against column 3, (1,0,1), position 1 works, producing 1. The complete product is

MR⊙MS=[101001000].

Its 1s encode (1,1),(1,3),(2,3), exactly the composed relation.

Test two-step connections

Boolean powers satisfy MRn=MR[n]. Here the Boolean square has first row (1,1,1) and all other entries 0. It has a 1 at (1,3) where the original has 0, so transitivity fails. Ordinary multiplication may produce 2 or more because it counts middle elements; replacing every positive result by 1 gives the Boolean product. Reversing the matrix factors computes the opposite composition.

Key Takeaways

  • Rows give first coordinates and columns give second coordinates.
  • Transpose represents inverse.
  • Join and meet represent union and intersection.
  • The Boolean product records existence, not a count of middle elements.
  • MS∘R=MR⊙MS
  • The Boolean square must add no new 1s for transitivity.

2.2 Represent a relation with a directed graph

A directed graph makes a relation's connections visible. Every element has a vertex, even when no pair mentions it, and every pair becomes an arrow in its stated direction.

Translate pairs into arrows

For a relation R on a finite set A, draw one vertex for each member of A and one arrow a→b for each (a,b)∈R. An arrow from a vertex to itself is a loop. The graph has no repeated arrows, because a set cannot contain the same ordered pair twice.

For R={(1,2),(2,3),(3,1),(4,3)} on {1,2,3,4}, draw a three-vertex directed cycle 1→2→3→1 and an additional arrow 4→3. There are no loops. Vertex 4 has an outgoing arrow but no incoming arrow; its position on the page has no mathematical meaning.

Read the property tests

Reflexivity requires a loop at every vertex. Irreflexivity requires no loops. Symmetry requires a reverse arrow for every arrow between different vertices. Antisymmetry bans opposite arrows between different vertices, and asymmetry bans those pairs of arrows and all loops.

Transitivity requires a direct arrow a→c whenever arrows a→b and b→c exist. The return case matters: a→b→a requires a loop at a. For the cycle above, 1→2→3 lacks the direct arrow 1→3, so the relation fails transitivity. It is irreflexive, antisymmetric, and asymmetric, but not symmetric.

Notice that antisymmetry alone does not ban longer directed cycles. The three-cycle has no opposite pair of arrows, so it is antisymmetric. Transitivity would add shortcuts that eventually create opposite pairs; it is the combination of order properties that rules such cycles out in a strict order.

Follow paths and powers

A path here is a sequence of arrows whose endpoints match; vertices and arrows may repeat. Its length is its number of arrows. Then (a,b)∈Rn exactly when an n-arrow path goes from a to b. Some graph texts call this a directed walk; the relation-power calculation uses this repeat-allowing meaning.

In the example, two steps give R2={(1,3),(2,1),(3,2),(4,1)}. Three give R3={(1,1),(2,2),(3,3),(4,2)}. Starting at 4, the first three destinations are 3, 1, and 2. Reaching a destination in one number of steps does not mean it is reached in every number of steps.

Choose a useful view

A pair list is easy to inspect when few pairs belong. A matrix organizes systematic computation. A digraph exposes routes and cycles. Each represents the same finite relation, so switching views can make a property easier to test without changing its truth.

A symmetric drawing sometimes replaces opposite arrows with a single line. That shorthand must be identified: an unmarked line otherwise hides which direction is present. When checking a drawing, compare its arrows with the pair list and retain isolated vertices; forgetting an isolated vertex can make a nonreflexive relation look reflexive.

Key Takeaways

  • An arrow points from the first coordinate to the second.
  • Loops encode diagonal pairs.
  • Transitivity requires direct arrows for all two-arrow routes.
  • Rn records paths of exactly n arrows.
  • Include isolated vertices in the drawing.
3

Build closures of relations

Adding a few pairs can make a relation reflexive, symmetric, or transitive. A closure makes the smallest such repair, keeping every original pair. You will identify which additions are forced, use paths to find all transitive consequences, and carry out Warshall’s matrix updates. The central distinction is between a direct connection, a route of several steps, and a zero-step self-connection.

3.1 Form reflexive and symmetric closures

A closure repairs a relation by adding only the pairs a property forces. The original pairs stay. “Smallest” means inclusion: the closure must lie inside every relation that contains the original and has the required property.

Add the pairs required by the property

The reflexive closure is R∪ΔA. Add every missing pair (a,a), including loops at elements not mentioned in R. The symmetric closure is R∪R−1. Add the reverse of every pair that lacks one. Existing loops already reverse to themselves.

For R={(1,2),(2,3),(3,3)} on A={1,2,3}, the reflexive closure is

{(1,1),(1,2),(2,2),(2,3),(3,3)}.

Only the loops at 1 and 2 were missing. The symmetric closure is

{(1,2),(2,1),(2,3),(3,2),(3,3)}.

It needs the reverse pairs (2,1) and (3,2), but no new loops. These are separate repairs for separate properties.

Explain why the repair is smallest

Any reflexive relation containing R must contain every pair of R and every diagonal pair. It therefore contains R∪ΔA. Since that union is itself reflexive, it is the reflexive closure. The symmetric case works the same way: any symmetric extension must contain the reverse of every original pair, and the union with those reverses is already symmetric.

If the relation already has the property, its closure is itself. For example, the identity relation needs no reflexive repair. A closure is not required to add a pair merely because its name suggests a change.

Make the same repair in other views

In a square matrix, reflexive closure sets the diagonal to 1: MR∨I. Symmetric closure is MR∨MRT, filling each reflected position. In a digraph, these repairs add missing loops or reverse arrows. They do not delete existing arrows.

On the integers, the reflexive closure of < is ≤. Its symmetric closure is ≠: for different integers, one is smaller than the other, so at least one direction of < supplies each unequal pair after reversal. No equal pair is forced by symmetry.

Know when adding cannot repair

Reflexive, symmetric, and transitive closures exist for every relation. The universal relation has each property, so there are qualifying extensions. Intersect all qualifying extensions for one chosen property; the intersection retains that property and is the smallest extension.

Other properties may be impossible to obtain by addition. If a relation contains a loop, no containing relation can be irreflexive. If it contains both (1,2) and (2,1), no containing relation can be antisymmetric.

The universal relation is a qualifying extension for the three closure properties, but usually adds too much. On {1,2}, the reflexive closure of {(1,2)} has three pairs. By contrast, the transitive closure of {(1,2),(2,1)} has all four: both loops are forced by the two return routes.

Key Takeaways

  • A closure keeps the original pairs and adds only forced pairs.
  • Reflexive closure is R∪ΔA.
  • Symmetric closure is R∪R−1.
  • Adding pairs cannot remove a violation of irreflexivity or antisymmetry.

3.2 Find the transitive closure through paths

Transitivity can force new pairs repeatedly: a shortcut added in one pass can combine with another arrow to force a longer shortcut. Reachability gives a complete description of all the pairs needed.

Follow every positive-length path

The transitive closure t(R) is the smallest transitive relation containing R. A pair belongs precisely when a path of one or more arrows connects its entries. Write this positive-length connectivity relation as

t(R)=R∪R2∪R3∪⋯ .

The notation R∗ is also used here for that union. Check its definition when comparing texts: a convention that includes zero-length paths adds every diagonal pair as well. Positive-length reachability adds a loop only when a nonempty route returns to its start.

Why is reachability transitive? Join a path from a to b to one from b to c, giving a path from a to c. Why is it smallest? Any transitive extension containing the original arrows must contain the endpoints of every such path, applying transitivity repeatedly along it.

Finish a chain example

Take R={(1,2),(2,3),(3,4)}. Its square is {(1,3),(2,4)}, and its cube is {(1,4)}. There is no four-arrow path. The closure is therefore

{(1,2),(1,3),(1,4),(2,3),(2,4),(3,4)}.

Stopping at R∪R2 misses (1,4). That incomplete relation contains (1,2) and (2,4), so it still violates transitivity. The closure is < on the four-element set and has no loops.

Let cycles determine loops

For R={(1,2),(2,3),(3,1),(4,3)}, the cycle through 1, 2, and 3 makes each of those vertices reach all three, including itself. Vertex 4 reaches all three cycle vertices, but no route returns to 4. The closure has 12 pairs: four possible starts, each reaching 1, 2, and 3. It lacks (4,4) and is not reflexive on the whole set.

For direct-flight connections, the closure records destinations reached with one or more flights. For direct function calls in a program, it records calls made directly or indirectly. In both cases, arrow direction still controls reachability.

Bound the computation on a finite set

On n vertices, a reachable distinct destination has a path of at most n−1 arrows: remove any repeated-vertex detour. A shortest positive return route has at most n arrows. Hence

t(R)=R∪R2∪⋯∪Rn.

Boolean powers give the same union of matrices. Computing the powers by straightforward Boolean products costs on the order of n4 bit operations; Warshall's algorithm reduces that to the order of n3.

For a reflexive and transitive extension, use t(R)∪ΔA. To obtain the smallest equivalence extension, take reflexive, then symmetric, then transitive closure. Symmetry taken after transitive closure can spoil transitivity: starting with {(1,2)}, reversing the arrow creates return routes that still need loops.

Key Takeaways

  • Transitive closure includes every positive-length reachable pair.
  • One pass adding two-step shortcuts may be insufficient.
  • Cycles force loops in the closure.
  • Powers through Rn suffice on n vertices.
  • Reflexive-transitive closure also includes the full diagonal.

3.3 Compute the transitive closure with Warshall’s algorithm

Warshall's algorithm computes reachability by gradually allowing more vertices inside a path. The round number controls the permitted middle vertices, not the number of arrows.

Understand what a round means

List the vertices v1,…,vn. Start with W0=MR, which records direct arrows. In Wk, entry (i,j) is 1 when a positive-length path from vi to vj has all interior vertices among v1,…,vk. The endpoints do not need to belong to that permitted set.

A path allowed in round k either avoids vk as an interior vertex or passes through it. In the second case, split it at vk. This gives the update

wij(k)=wij(k−1)∨(wik(k−1)∧wkj(k−1)).

Keep an existing connection, or add one when the start reaches the current vertex and that vertex reaches the destination. No existing 1 ever changes to 0.

Work through four rounds

Use the vertex order 1, 2, 3, 4 and R={(1,2),(2,3),(3,1),(4,3)}:

W0=[0100001010000010].

In round 1, look down column 1. Only row 3 contains 1. OR row 1 into row 3, changing row 3 from (1,0,0,0) to (1,1,0,0). This adds the route 3→1→2.

In round 2, rows 1 and 3 contain 1 in column 2. OR row 2, (0,0,1,0), into both. Row 1 becomes (0,1,1,0); row 3 becomes (1,1,1,0). The diagonal entry at (3,3) records the return route 3→1→2→3.

In round 3, every row has 1 in column 3. OR the current row 3, (1,1,1,0), into every row. All four rows become (1,1,1,0). In round 4, column 4 is all zeros, so nothing changes. The final matrix has 12 ones and represents t(R). No vertex reaches 4 because no arrow enters it.

Run the update reliably

For each round, identify the rows with 1 in the current column, then copy every 1 from the current row into them. The current row and column do not change during their own round: their updates OR an entry with itself AND another entry. This makes in-place updating safe with the round index as the outer loop.

Run all vertex rounds. An unchanged early round says only that its vertex supplied no new route; a later vertex can still do so. Treat diagonal entries like all others, so cycles can create loops. Do not initialize the diagonal to 1 unless reflexive reachability is wanted.

Compare costs

There are n rounds, each updating n2 entries with one AND and one OR: 2n3 bit operations. At n=100, that is 2,000,000. Changing the vertex order can change the intermediate matrices, but the final relation is the same after matching the row and column labels.

Key Takeaways

  • Round k adds routes through vertex vk.
  • OR the current row into rows with 1 in the current column.
  • Keep the round index outside both entry loops.
  • Run every round, including after an unchanged round.
  • Cycles create diagonal 1s through the ordinary update.
  • Warshall uses 2n3 bit operations in the full update.
4

Classify with equivalence relations and partitions

An equivalence relation groups objects that match in a chosen respect, such as having the same remainder or representing the same fraction. Its properties make the groups consistent: two groups cannot overlap only partly. You will prove equivalence, find classes, and switch between a relation and a partition. Counting pairs within blocks and combining partitions show how these groupings behave as mathematical objects.

4.1 Recognize and prove equivalence relations

An equivalence relation treats objects as alike in a chosen respect. To group objects consistently, each object must match itself, matches must reverse, and two matching steps must preserve the match.

Prove the three properties

A relation ∼ on A is an equivalence relation when it is reflexive, symmetric, and transitive. Prove these separately for arbitrary elements. One counterexample to any one property is enough to show the relation is not an equivalence relation.

A useful pattern is a∼b exactly when f(a)=f(b) for a function f on A. Equality of the outputs gives all three properties: an output equals itself; equality reverses; and equalities through a middle output combine. Examples include strings with the same length, people with the same birth year, and real numbers with the same floor. The floor is the greatest integer no larger than the number, so 2.3 and 2.9 match, but 2.9 and 3.1 do not.

Prove congruence is an equivalence relation

For a positive integer m, congruence on the integers means a≡b(modm) exactly when m∣(a−b).

  • Reflexive: a−a=0=m⋅0.
  • Symmetric: if a−b=mk, then b−a=m(−k).
  • Transitive: if a−b=mk and b−c=ml, then a−c=m(k+l).

Each step uses arbitrary integers, so it proves a whole property, not just an example. A calculation such as 9≡1(mod4) illustrates membership but cannot replace those proofs.

Group different representations of a fraction

On integer pairs (a,b) with b≠0, define (a,b)∼(c,d) when ad=bc. The pairs (1,2) and (3,6) match because both cross products are 6. Reflexivity follows from ab=ba, and reversing the equation gives symmetry.

For transitivity, suppose ad=bc and cf=de. Multiplying gives adf=bcf=bde, hence d(af−be)=0. Since d≠0, obtain af=be, the condition for (a,b)∼(e,f). The nonzero second coordinate permits cancellation. These classes identify different fraction representations of the same rational number.

Test a tempting non-example

“Differs by at most 1 cm” is reflexive and symmetric on lengths. Yet 10.0 cm is close to 10.8 cm, and 10.8 cm is close to 11.6 cm, while the first and last differ by 1.6 cm. Transitivity fails because small differences can accumulate.

On integers, ∣a−b∣≤1 fails similarly with 1, 2, and 3. On integers at least 2, “has a common factor greater than 1” is reflexive and symmetric, but 2 matches 6 and 6 matches 3 while 2 does not match 3. A shared intermediate object need not give a shared property of the endpoints.

Check reflexivity on the whole domain too. On {1,2,3}, the relation containing (1,1),(2,2),(1,2),(2,1) is symmetric and transitive but misses the loop at 3.

Key Takeaways

  • Equivalence requires reflexivity, symmetry, and transitivity.
  • Equality of function outputs defines an equivalence relation.
  • Congruence modulo a positive integer is an equivalence relation.
  • Tolerance relations can fail transitivity as differences accumulate.

4.2 Work with equivalence classes and partitions

Once an equivalence relation is established, it splits the underlying set into complete groups. Each group contains exactly the elements related to any one of its members.

Find a class and choose a representative

The equivalence class of a is [a]={x∈A:a∼x}. An element naming the class is a representative. The set of distinct classes is the quotient set A/∼.

Modulo 4, there are four classes, represented by 0, 1, 2, and 3. The class [1] contains …,−7,−3,1,5,9,…. Thus [5]=[1]=[−3]. The representatives are different integers, but the class is the same set. The notation [2] names all integers congruent to 2, not just the integer 2.

Explain why classes cannot partly overlap

For an equivalence relation, a∼b, [a]=[b], and [a]∩[b]≠∅ are equivalent statements. To see the overlap step, suppose z belongs to both classes. Then a∼z and b∼z; symmetry and transitivity give a∼b. Any element related to one is then related to the other, so the two classes coincide.

Reflexivity puts each element in its own class. The distinct classes are therefore nonempty, disjoint, and cover all of A. Such a collection is a partition. Conversely, a partition defines an equivalence relation by “is in the same block as.” A collection with overlaps, an empty block, or a missing element is not a partition.

Convert blocks into pairs and a matrix

For blocks {1,2,3}, {4,5}, and {6}, include every ordered pair within each block and none across blocks. The relation has 32+22+12=14 pairs. Each block contributes its full square, including loops and both directions.

With elements listed block by block, the matrix has all-1 square blocks on the diagonal and zeros elsewhere. A partition block of size 3 contributes nine pairs, not three: each of its three elements relates to all three.

Equivalence relations and partitions correspond one to one. Their number on n elements is the Bell number Bn. For sizes 1 through 5 the counts are 1, 2, 5, 15, and 52. On three elements, the five partitions are one block of three, three ways to make a pair and a singleton, and three singleton blocks.

Combine relations and build the smallest grouping

Intersecting equivalence relations gives another equivalence relation. Its blocks are the nonempty intersections of the original blocks. Their union can fail transitivity: congruence modulo 2 joins 1 to 3, and congruence modulo 3 joins 3 to 0, but neither joins 1 to 0.

To build the smallest equivalence relation containing R, take reflexive, symmetric, then transitive closure. For R={(1,2),(2,5),(3,4)} on {1,2,3,4,5}, the required blocks are {1,2,5} and {3,4}, giving 32+22=13 pairs. Reverses and paths force every within-block pair; no path joins the two blocks.

Key Takeaways

  • An equivalence class is a set; its representative is an element.
  • Classes are equal or disjoint.
  • Partitions and equivalence relations correspond one to one.
  • A block of size k contributes k2 ordered pairs.
  • Bell numbers count partitions and equivalence relations.
  • Intersection preserves equivalence; union may not.
  • Reflexive, symmetric, then transitive closure gives the smallest equivalence extension.
5

Order elements with partial orders and Hasse diagrams

Partial orders describe comparisons that need not place every pair in sequence. Divisibility and set inclusion give concrete examples. You will prove order properties, use Hasse diagrams to keep only immediate comparisons, and distinguish maximal elements from greatest elements. Bounds extend the comparison to a chosen subset, while lattices identify posets where each pair has a well-defined join and meet.

5.1 Define partial orders and total orders

An order describes which elements come before or below others. A partial order permits some pairs to remain incomparable; a total order compares every pair.

Prove a partial order

A partial order ⪯ is reflexive, antisymmetric, and transitive. A set with such a relation is a partially ordered set, or poset, written (S,⪯). The symbol a≺b means a⪯b and a≠b.

Subset inclusion gives a standard example. For subsets X,Y,Z of a fixed set, X⊆X proves reflexivity. If X⊆Y and Y⊆X, then X=Y, proving antisymmetry. If X⊆Y⊆Z, then X⊆Z, proving transitivity. The usual order on integers and divisibility on positive integers are also partial orders.

The underlying set matters. On nonzero integers, divisibility fails antisymmetry: 2∣−2 and −2∣2 although the integers differ. Restricting to positive integers removes that failure.

Compare partial and total orders

Elements are comparable if a⪯b or b⪯a; otherwise they are incomparable. A total order, also called a linear order, is a partial order with every pair comparable. A totally ordered set is a chain.

The integers under ≤ form a total order. Positive integers under divisibility do not: neither 2 nor 3 divides the other. Under subset inclusion, {a} and {b} are incomparable. “Partial” concerns which elements can be compared, not whether the order properties are only partly satisfied.

Pass between weak and strict forms

A strict partial order is irreflexive and transitive. It is asymmetric: if both a≺b and b≺a held, transitivity would force a≺a. Remove the diagonal from a partial order to obtain its strict form; add the diagonal back to recover the reflexive form.

Thus < is the strict form of ≤, and proper inclusion is the strict form of inclusion. The symbol < is not a partial order in the reflexive sense because its diagonal is empty. Name the strict form explicitly when using it.

Use lexicographic and well orders

Lexicographic order compares the first coordinate first and uses the second only to break a tie. For integer pairs, (1,5)≺(2,1) because 1 is smaller than 2, and (3,1)≺(3,4) because the first coordinates tie. Strings use the first differing position, with a shorter prefix first: “dis” precedes “disc,” then “discrete,” then “disk.” Built from total orders, this order is total.

A well order is a total order in which every nonempty subset has a least element. Positive integers under ≤ are well ordered. All integers under ≤ are not: the whole set has no least member. Even an ordered set with a least element can fail this test. In [0,1], the subset (0,1] has no least element, since halving any positive member gives a smaller positive member.

Key Takeaways

  • A partial order is reflexive, antisymmetric, and transitive.
  • A total order compares every pair.
  • A strict partial order is irreflexive and transitive.
  • Lexicographic comparison uses the first differing position.
  • Well ordering requires a least element in every nonempty subset.

5.2 Draw and read Hasse diagrams

A Hasse diagram compresses a finite partial order into its immediate comparisons. Loops and longer consequences can be recovered from the order rules, so they need not be drawn.

Find the covering pairs

An element b covers a if a≺b and no element c satisfies a≺c≺b. Covers depend on the elements actually in the poset. For divisibility on {1,2,4}, 4 covers 2 but not 1; if 2 were removed, 4 would cover 1.

To draw a Hasse diagram, start from the relation digraph. Remove loops. Remove arrows implied by longer upward routes, leaving only covers. Place each covered element below the element covering it, then omit arrowheads because every edge is read upward. Keep the vertices and their labels.

Draw the divisors of 12

The elements are {1,2,3,4,6,12}, ordered by divisibility. From 1, the immediate larger elements are 2 and 3. From 2, they are 4 and 6. From 3, the next is 6. Both 4 and 6 lead directly to 12. Thus the seven covering pairs are

1 ⁣−!2,1 ⁣−!3,2 ⁣−!4,2 ⁣−!6,3 ⁣−!6,4 ⁣−!12,6 ⁣−!12.

Place 1 at the bottom, 2 and 3 above it, 4 and 6 above them, and 12 at the top. Draw 6 above both 2 and 3. The full relation has 18 ordered pairs, but its Hasse diagram needs only seven edges.

The pair (1,4) is removed because 1∣2∣4. The pair (1,12) is removed because several longer upward routes already imply it. These comparisons remain true even though their direct edges disappear.

Read upward paths

For finite posets, a⪯b exactly when a=b or an upward path of cover edges runs from a to b. In the divisor example, 3 is below 12 through 6. There is no upward path from 4 to 6 or from 6 to 4, so they are incomparable.

The page height alone is not enough. Drawing 3 lower than 4 does not make 3∣4 true. A route that goes upward and then downward also gives no comparison between its endpoints. Follow edges in one upward direction throughout.

Recognize two common shapes

The subsets of {a,b,c} under inclusion form an eight-vertex cube when drawn by set size. Each cover adds exactly one element. There are 12 cover edges and 27 pairs in the full relation: for each of the three underlying elements, it can be outside both sets, in only the larger set, or in both.

A finite total order produces one vertical path. For {1,2,4,8} under divisibility, the path is 1 ⁣−!2 ⁣−!4 ⁣−!8. Every two vertices are comparable through that path. Avoid horizontal cover edges, which hide which vertex is above the other, and keep transitive shortcuts out of the finished diagram.

Key Takeaways

  • Covers are comparisons with no intermediate element in the poset.
  • Hasse diagrams omit loops and transitive shortcuts.
  • Comparability follows upward paths, not page height.

5.3 Identify extremal elements, bounds and lattices

A partial order can have several elements at its top or bottom. Bounds ask a different question: which elements lie above or below every member of a chosen subset?

Distinguish local and whole-set extremes
TermRequirement for an element a
MaximalNo element is strictly above a.
MinimalNo element is strictly below a.
GreatestEvery element is below or equal to a.
LeastEvery element is above or equal to a.

Greatest and least elements are unique when they exist. Maximal and minimal elements need not be. In a Hasse diagram, maximal vertices have no edge leading up and minimal vertices have no edge leading down.

Consider S={2,3,6,8,12,18} under divisibility. Its minimal elements are 2 and 3; its maximal elements are 8, 12, and 18. There is no least element because neither 2 nor 3 divides the other. There is no greatest element: none of the three maximal elements is divisible by all members of S.

Every finite nonempty poset has maximal and minimal elements. In a finite poset, a unique maximal element is greatest: following elements upward from any start eventually reaches it. Infinite posets need not have either kind of extreme; the integers under ≤ have none.

Find all bounds before choosing an extremal bound

An upper bound of X⊆S is a member of S above every element of X. A lower bound is below every element of X. Bounds may lie outside X but must lie inside S.

For X={2,3} in the example, the upper bounds are 6, 12, and 18. The least upper bound, or supremum or join, is 6: it divides every other upper bound. There is no lower bound in S. The integer 1 divides both 2 and 3, but it is not available in this poset.

For X={12,18}, the lower bounds are 2, 3, and 6. The greatest lower bound, or infimum or meet, is 6. There is no upper bound in S. For {8,12}, there is also no upper bound in S; their common multiples outside S do not qualify.

Check whether a least bound exists

Upper bounds can exist without a least one. Suppose a,b both lie below c,d, with no other strict comparisons. The upper bounds of {a,b} are c and d. They are incomparable, so neither lies below the other and no least upper bound exists. Two minimal upper bounds are not a single least upper bound.

Recognize lattices

A lattice is a poset where every pair of elements has both a least upper bound and a greatest lower bound. Positive integers under divisibility form a lattice: join is the least common multiple and meet is the greatest common divisor. For 4 and 6, these are 12 and 2.

A power set under inclusion is a lattice, with union as join and intersection as meet. Every total order is a lattice, using the larger and smaller member of each pair. The restricted set S above is not a lattice because 2 and 3 lack a lower bound in it. Check bounds within the actual set before applying a familiar formula.

Key Takeaways

  • Maximal and minimal need not mean greatest and least.
  • Bounds belong to the poset, but need not belong to the chosen subset.
  • A least upper bound lies below every other upper bound.
  • A greatest lower bound lies above every other lower bound.
  • A lattice provides both bounds for every pair.
  • Restricting the underlying set can remove required bounds.
6

Schedule tasks with topological sorting

Dependencies often leave several valid choices for what happens next. Topological sorting selects a complete sequence without violating any requirement. Parallel scheduling then asks which tasks can share a step and what limits completion time. You will use minimal elements to build an order, chains to measure forced sequential work, and antichains to measure possible parallelism, including the effect of a capacity limit.

6.1 Topologically sort a finite partial order

Dependencies specify some ordering requirements without choosing a complete sequence. Topological sorting turns those requirements into one list that respects every required “before” relationship.

Choose a minimal remaining element

A linear extension is a total order compatible with a partial order: a⪯b implies that a is no later than b in the total order. Constructing one for a finite poset is topological sorting.

Repeatedly choose a minimal element among those remaining, append it to the list, and remove it. At the moment of selection, all its strict predecessors have already been removed. A minimal element exists in every finite nonempty poset: follow strict predecessors downward. No element can repeat, and finiteness forces the process to stop.

Different minimal choices can give different valid lists. A finite poset has exactly one linear extension precisely when it is already a total order. Incomparable elements allow more than one compatible ordering.

Work through course prerequisites

Use eight course labels: P1 (Programming I), DS (Data Structures), DM (Discrete Mathematics), AL (Algorithms), C1 (Calculus I), C2 (Calculus II), PR (Probability), and ML (Machine Learning). The direct requirements are:

  • P1 and DM before DS; DM and DS before AL.
  • C1 before C2; C1 and DM before PR.
  • C2, PR, and AL before ML.

Initially C1, DM, and P1 are minimal. If the alphabetically first available label is always chosen, select C1, then C2, then DM, then P1. Removing P1 releases DS; removing DS releases AL. PR is also available, but AL comes first alphabetically. The complete order is C1, C2, DM, P1, DS, AL, PR, ML.

Verify each direct requirement against positions in the list. Checking them is sufficient: if every direct step goes forward, every longer dependency route also goes forward. DM before AL is already implied through DS, though it remains a true requirement. This course poset has 117 linear extensions; the alphabetical rule chooses just one of them.

Detect impossible dependency lists

A directed acyclic graph, or DAG, has no directed cycles. Draw strict “before” requirements as arrows. Topological sorting repeatedly removes a vertex with no incoming arrows from the remaining graph. A finite DAG always permits a full ordering, since its transitive closure is a strict partial order.

If A must precede B, B must precede C, and C must precede A, no list works. Removing unrelated ready tasks may still be possible, but the cyclic part eventually leaves no available vertex. This differs from the reflexive order digraph, which has loops by definition; scheduling arrows express strict precedence.

Apply the algorithm to dependencies

Build systems process required components before components that use them. A spreadsheet can recalculate dependent cells after their inputs. In each case, a task becomes ready only after all its incoming requirements are satisfied. Having one completed prerequisite is insufficient if another is still pending. Use the current remaining set when finding minima; an element that was not minimal at the start can become minimal after its predecessors are removed.

Key Takeaways

  • A linear extension respects every original comparison.
  • Topological sorting repeatedly removes a minimal remaining element.
  • A finite DAG always has a topological order.
  • A directed cycle prevents a compatible ordering.
  • A finite poset has one linear extension exactly when it is total.

6.2 Plan parallel schedules with chains and antichains

Some tasks must run in sequence; others can share a time step. Chains and antichains measure those two features and connect a partial order to a parallel schedule.

Measure height and width

A chain is a subset whose elements are pairwise comparable. An antichain is a subset whose distinct elements are pairwise incomparable. The height of a finite poset counts elements in a largest chain; the width counts elements in a largest antichain. Height counts elements, not arrows.

In the course dependencies, P1, DS, AL, ML form a chain of four. So do DM, DS, AL, ML. No chain is longer, giving height 4. The sets {P1,C1,DM} and {C2,PR,AL} are antichains of three, and the width is 3. An antichain need not be a row in one drawing of the Hasse diagram.

Find the shortest unlimited schedule

Assume each task takes one time step, all predecessors must finish before it starts, and any number of tasks can run together. Tasks within a step form an antichain. A chain of h tasks requires at least h steps.

Assign each task a level equal to the number of elements in a longest chain ending there. Every predecessor has a smaller level, so running tasks at their levels is valid. The largest level is the height, reaching the lower bound. Thus the minimum number of steps equals the height.

For the eight courses, a four-term schedule is: Term 1, P1, C1, DM; Term 2, DS, C2, PR; Term 3, AL; Term 4, ML. A four-course chain proves that fewer terms are impossible. Chain members need not occupy consecutive steps in every valid schedule; they only need to occur in order.

Add a capacity limit

With n tasks and at most p per step, both the longest chain and the number of available places give lower bounds:

steps≥max⁡(height,⌈n/p⌉).

This bound may be too low. With at most two courses per term, the eight-course example has bound 4 but needs 5. A four-term schedule would force P1 and DM into Term 1 to fit DS, AL, ML afterward. Then C1 cannot occur before Term 2, so C2 and PR cannot occur before Term 3. AL also needs Term 3, exceeding the two-course limit.

Five terms suffice: P1 and DM; C1 and DS; C2 and PR; AL; ML. With capacity three, the earlier four-term schedule works.

Connect schedules to partition theorems

Mirsky's theorem says the minimum number of antichains partitioning a finite poset equals its height. Dilworth's theorem says the minimum number of chains partitioning it equals its width. The course poset splits into three chains: P1, DS, AL, ML; C1, C2; and DM, PR. Each antichain can meet each such chain at most once, confirming width at most 3.

A height-level partition has at most width-many elements in each level, giving height×width≥n. More generally, for any t>0, a finite poset has a chain of more than t elements or an antichain of at least n/t elements.

Key Takeaways

  • Height counts elements in a largest chain; width counts a largest antichain.
  • Unit-duration tasks need height-many steps with unlimited parallel capacity.
  • A capacity-and-height lower bound can be unattainable.
  • Mirsky counts antichains in a minimum partition; Dilworth counts chains.

Equivalence Relations examples

6 Walkthroughs

1

Build a relation and follow its connections

14 steps
Read ordered pairs, test relation properties, and compose small relations through a shared middle element.
  1. 1
    IntroductionStart with the direction

    A relation tells you which ordered pairs belong. In “is enrolled in,” the first entry is a student and the second a course. Reversing the entries changes the connection being described.

    We will build a small relation, test its properties, and follow two connections in sequence. At each stage, keep the underlying sets and the meaning of the first coordinate fixed.

  2. 2
    ExampleList the allowed pairs

    Let A={Lina,Omar} and B={Logic,Calculus}. Lina takes both courses; Omar takes Logic.

    The enrollment relation contains three pairs: (Lina,Logic), (Lina,Calculus), and (Omar,Logic). The fourth possible pair is absent. Each pair has one entry from each specified set.

  3. 3
    Key InsightDecide whether it is a function

    A function must assign exactly one output to each input. The enrollment relation fails because Lina has two outputs. Omar’s single output does not repair that failure.

    A relation may also leave an input without any output. By comparison, sharing an output is allowed in a function: two students could each take Logic as their single assigned course.

  4. 4
    ChallengeCount a new relation space

    A relation runs from three devices to two servers. How many different relations are possible?

    ---reveal---

    There are 3×2=6 possible device-server pairs. Each can be included or excluded independently, giving 26=64 relations. The number 6 counts the available pairs, not the ways to choose a relation. Unlike a function, a relation need not choose exactly one server per device.

  5. 5
    ExplanationReverse or complement

    The inverse reverses each included pair and runs from the old target set to the old source set. The complement stays inside the original product and selects the absent pairs.

    For enrollment above, the complement contains only Omar paired with Calculus. The inverse contains the three original connections with each course written first. It has three pairs, not one.

  6. 6
    ExplanationCheck loops first

    For a relation on one set, reflexivity requires a loop at every element. Irreflexivity requires no loops anywhere. A relation with some loops and some missing loops is neither.

    On {a,b,c}, the relation {(a,a),(b,b)} misses the loop at c, so it is not reflexive. Its existing loops also rule out irreflexivity. The specified set decides which loops must be checked.

  7. 7
    ExplanationSeparate two symmetry tests

    Symmetry requires each pair’s reverse. Antisymmetry bans opposite pairs between distinct elements but allows loops. Asymmetry bans both opposite pairs and loops.

    The identity relation is symmetric and antisymmetric: each pair reverses to itself, and no distinct elements are linked both ways. These properties are therefore not opposites. A relation can have both, one, or neither.

  8. 8
    ExampleFind a transitivity failure

    On {a,b,c}, take R={(a,b),(b,c)}. The two pairs join through b, so transitivity requires (a,c). It is missing, which is a complete counterexample.

    For a proof that transitivity holds, one successful route would be insufficient: every pair of joining relation steps must have its required endpoint pair. Repeated endpoints must also be included in that check.

  9. 9
    ChallengeTest a return route

    On {x,y}, R={(x,y),(y,x),(x,x)}. Is it transitive? Identify the decisive route.

    ---reveal---

    No. The route y→x→y uses two present pairs but requires the missing loop (y,y). The loop at x handles the return starting at x, but transitivity must also handle the return starting at y. The letters in the definition may name repeated elements.

  10. 10
    ExplanationFollow the right-hand relation first

    In S∘R, follow R first and S second. A pair (a,b) in R can continue with any pair (b,c) in S, producing (a,c).

    The middle element must match exactly. It serves as evidence for the route and is then omitted from the output pair. If no pair of S starts at that middle element, the original pair contributes no result.

  11. 11
    ExampleCompose through each middle element

    Let R={(p,q),(p,r),(q,r)} and S={(q,r),(r,p)}. Starting with R gives the routes p→q→r, p→r→p, and q→r→p.

    Thus S∘R={(p,r),(p,p),(q,p)}. The loop (p,p) is a genuine two-step connection, even though neither relation needs a direct loop at p.

  12. 12
    ConnectionUse the square to test transitivity

    Composing a relation with itself gives R2, all pairs joined in exactly two steps. A relation is transitive exactly when R2⊆R.

    For R={(p,q),(p,r),(q,r)}, the only two-step route is p→q→r, whose endpoint pair already belongs. The square need not equal the original relation; it only has to contain no new pairs.

  13. 13
    ChallengeChange one pair and test again

    Remove (p,r) from the last relation, leaving T={(p,q),(q,r)}. What is T2, and is T transitive?

    ---reveal---

    The square is {(p,r)} because the only two-step route passes through q. That pair is missing from T, so T2⊈T and transitivity fails. The same calculation gives both the composed relation and the counterexample.

  14. 14
    RecapMatch each task to its test

    For membership, check the ordered pair against the rule and the specified sets. For a property, check its complete requirement or give a failing case. For composition, follow the right-hand relation first and match middle elements.

    The square connects these skills: it lists every two-step endpoint pair. A missing pair in the original relation is exactly a transitivity failure.

2

Read matrices and directed paths

10 steps
Translate pairs into matrix entries and arrows, then use Boolean products and paths to compute repeated steps.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionGive each pair a position
  2. 2
    ExampleBuild the matrix row by row
  3. 3
    ExplanationRead properties from reflected entries
  4. 4
    ChallengeCheck the inverse
  5. 5
    ExampleCompute one Boolean-square entry
  6. 6
    Key InsightRead the complete square
  7. 7
    ExplanationDraw the same relation
  8. 8
    ExampleFollow exactly three arrows
  9. 9
    ChallengeCompare a graph and its square
  10. 10
    RecapTranslate without changing direction
3

Repair a relation and compute reachability

15 steps
Form the smallest closures, then work through Warshall rounds on a directed chain.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionKeep every original connection
  2. 2
    ExampleAdd only missing loops
  3. 3
    ExampleAdd only missing reverses
  4. 4
    ChallengeCan addition repair this property?
  5. 5
    ExampleSee why one pass can stop too early
  6. 6
    ExplanationCollect all positive-length routes
  7. 7
    ChallengeDecide which loops are forced
  8. 8
    ExplanationStart Warshall with direct arrows
  9. 9
    ExampleRound 1 changes nothing
  10. 10
    ExampleRound 2 adds the first shortcut
  11. 11
    ExampleRound 3 uses an updated route
  12. 12
    ChallengeComplete round 4
  13. 13
    TipKeep the round outside the entry updates
  14. 14
    ChallengeBuild an equivalence extension
  15. 15
    RecapMatch the repair to the requirement
4

Prove equivalence and find the blocks

12 steps
Use congruence to prove equivalence, then turn classes and partitions into complete relations.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionChoose what counts as a match
  2. 2
    ExplanationUse equality of outputs
  3. 3
    ExampleProve congruence modulo 3
  4. 4
    ChallengeTest a tolerance rule
  5. 5
    ExampleName the same class in different ways
  6. 6
    Key InsightExplain why overlap forces equality
  7. 7
    ExplanationMove from classes to a partition
  8. 8
    ExampleRecover every within-block pair
  9. 9
    ChallengeRepair overlapping proposed blocks
  10. 10
    ConnectionCount and combine groupings
  11. 11
    ChallengeDistinguish equal labels from shared features
  12. 12
    RecapProve before grouping
5

Read a partial order and find its bounds

15 steps
Prove an order, draw its covers, and distinguish extreme elements from bounds of a subset.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionCompare using the actual order
  2. 2
    ExplanationProve the three order properties
  3. 3
    Key InsightAllow incomparable pairs
  4. 4
    ExplanationSeparate strict and reflexive versions
  5. 5
    ExampleCompare lexicographically
  6. 6
    ChallengeTest a well-order claim
  7. 7
    ExampleFind covers among divisors
  8. 8
    ExplanationRead the diamond upward
  9. 9
    ChallengeChange the underlying set
  10. 10
    ExplanationSeparate maximal from greatest
  11. 11
    ExampleList upper and lower bounds
  12. 12
    Key InsightTwo minimal bounds may give no least bound
  13. 13
    ConnectionCheck the lattice requirement
  14. 14
    ChallengeRemove a required bound
  15. 15
    RecapUse paths and bounds for different questions
6

Turn dependencies into a sequence and a schedule

13 steps
Choose ready tasks, find chains and antichains, and test whether a parallel schedule reaches its lower bound.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSeparate order from timing
  2. 2
    ExampleFind the initial choices
  3. 3
    ExampleFinish a topological order
  4. 4
    ChallengeDiagnose a blocked list
  5. 5
    ExplanationExplain why cycles block progress
  6. 6
    ExplanationFind a chain and an antichain
  7. 7
    ExampleBuild the earliest-level schedule
  8. 8
    ChallengeCheck a chain-length count
  9. 9
    ExampleSee a capacity bottleneck
  10. 10
    Key InsightUse the lower bound carefully
  11. 11
    ConnectionRead the two partition theorems
  12. 12
    ChallengeTurn a schedule into a sequence
  13. 13
    RecapGive a schedule and a reason it is shortest

Equivalence Relations practice questions

50 Practice Questions in 5 sets

Set 1: Representations and closure calculations10 Practice Questions

Question 1 of 10

What is the symmetric closure of R={(a,b),(c,c)} on {a,b,c}?
  1. {(a,b),(b,a),(c,c)}
  2. {(a,a),(a,b),(b,b),(c,c)}
  3. {(b,a),(c,c)}
  4. {(a,a),(a,b),(b,a),(b,b),(c,c)}
Show answerHide answer
Answer: A
The pair (a,b) needs its reverse (b,a), while (c,c) already reverses to itself. Retaining the original pairs gives the stated three-pair relation. Adding loops at a and b would make a larger extension but is not required for symmetry.

Question 2 of 10

How many pairs must be added for the reflexive closure of {(2,2),(2,5),(5,7)} on {2,5,7,9}?
  1. 2
  2. 4
  3. 3
  4. 5
Show answerHide answer
Answer: C
The underlying set has four elements, so reflexivity needs four diagonal pairs. The loop at 2 already belongs; the missing loops are at 5, 7, and 9, giving three additions. Ignoring 9 because it appears in no original pair would miss a required element of the domain.

Question 3 of 10

For the arrows a→b→c→d→e and no others, how many new pairs are added by transitive closure?
  1. 3
  2. 4
  3. 10
  4. 6
Show answerHide answer
Answer: D
In the closure each vertex reaches every later vertex, giving 4+3+2+1=10 pairs. Four direct arrows are already present, so six pairs are added. Three additions count only the two-step shortcuts and miss the longer routes, including the route from a to e.

Question 4 of 10

At the start of Warshall round 2, W=[010001000]. What pair is added in this round, using vertex order 1, 2, 3?
  1. (2,1)
  2. (1,3)
  3. (3,1)
  4. (2,2)
Show answerHide answer
Answer: B
Row 1 has 1 in column 2, so OR row 2 into row 1. This adds the entry in column 3, recording 1→2→3. It does not add a loop at 2: no route from 2 through the current vertex back to 2 is present in the supplied matrix.

Question 5 of 10

On {a,b,c,d,e}, the arrows are a→b, b→c, c→b, and d→a; e is isolated. How many pairs are in the transitive closure?
  1. 7
  2. 11
  3. 9
  4. 12
Show answerHide answer
Answer: C
The reachable destinations from a,b,c,d,e have sizes 2, 2, 2, 3, and 0, totaling 9. The cycle at b,c supplies their loops; d reaches a,b,c, while no path returns to a,d,e. Adding every missing loop would count reflexive-transitive closure instead.

Question 6 of 10

A matrix represents a relation on {a,b,c}, with both axes in that order. What pair does a 1 in row 3, column 1 represent?
  1. (a,c)
  2. (c,c)
  3. (a,a)
  4. (c,a)
Show answerHide answer
Answer: D
Row 3 names the first coordinate c, and column 1 names the second coordinate a, so the pair is (c,a). Reading the axes in reverse would give (a,c), a pair in the inverse relation instead. The fixed element order gives each entry its meaning.

Question 7 of 10

Let P=[1101] and Q=[1011]. What is P⊙Q?
  1. [1111]
  2. [2111]
  3. [1001]
  4. [1101]
Show answerHide answer
Answer: A
Every row-column combination has at least one shared middle position containing 1 in both factors, so every output entry is 1. The top-left entry has two working positions, but Boolean OR still gives 1. The entry 2 comes from ordinary multiplication, which counts routes instead of recording existence.

Question 8 of 10

A digraph on {x,y,z} has only the arrows x→y, y→z, and z→x. Is its relation antisymmetric?
  1. No; any directed cycle prevents it.
  2. No; the graph has no vertex loops.
  3. Yes; no distinct pair has both arrows.
  4. Yes; every pair has a reverse arrow.
Show answerHide answer
Answer: C
Antisymmetry bans opposite arrows between distinct vertices, and none is present here. A three-arrow cycle does not by itself violate that rule. The graph does fail transitivity, but a failure of another property cannot be used to reject antisymmetry.

Question 9 of 10

The only arrows are r→s, s→t, and t→s. Which pairs lie in the cube of the relation?
  1. {(r,t),(s,s),(t,t)}
  2. {(r,s),(s,t),(t,s)}
  3. {(r,r),(s,s),(t,t)}
  4. {(r,s),(r,t),(s,t),(t,s)}
Show answerHide answer
Answer: B
Three arrows from r end at s; three from s end at t; three from t end at s. Thus the cube equals the original relation in this example. The pairs ending at t,s,t respectively describe two steps, so they belong to the square instead of the cube.

Question 10 of 10

Use vertex order 1, 2, 3, 4 and arrows 1→3, 3→2, 2→4. What new pairs have been added by the end of Warshall round 3?
  1. {(1,2),(1,4),(3,4)}
  2. {(1,2),(3,4)}
  3. {(1,2),(1,4),(2,3)}
  4. {(1,4),(2,2),(3,4)}
Show answerHide answer
Answer: A
Round 2 adds (3,4) through vertex 2. Round 3 then uses the updated row 3 to add both (1,2) and (1,4) through vertex 3. Omitting (1,4) treats row 3 as its original row and misses a route using two permitted interior vertices.
Set 2: Pairs, properties, and composition10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

How many binary relations run from a two-element set to a four-element set?
  1. 8
  2. 256
  3. 16
  4. 64
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Let R={(p,7),(q,8),(r,7)} run from {p,q,r} to {7,8}. Does it define a function, and why?
  1. No; two inputs share the output 7.
  2. No; the two sets have different sizes.
  3. Yes; each input has exactly one output.
  4. Yes; each output has exactly one input.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

On the integers, a R b means a<b. What rule describes the complement of R?
  1. a≥b
  2. a>b
  3. a≤b
  4. a≠b
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

What are the reflexivity and irreflexivity results for {(u,u),(v,v)} on {u,v,w}?
  1. Reflexive and not irreflexive.
  2. Irreflexive and not reflexive.
  3. Both reflexive and irreflexive.
  4. Neither reflexive nor irreflexive.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

For R={(u,u),(v,v),(u,v),(v,u)} on {u,v,w}, how do symmetry and antisymmetry classify R?
  1. Antisymmetric but not symmetric.
  2. Both symmetric and antisymmetric.
  3. Neither symmetric nor antisymmetric.
  4. Symmetric but not antisymmetric.
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

On {p,q}, let R={(p,q),(q,p)}. Which missing pairs are required by transitivity?
  1. Only the pair (p,p).
  2. Both (p,p) and (q,q).
  3. Only the pair (q,q).
  4. No additional ordered pairs.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

Let R={(a,b),(a,c),(b,d)} and S={(b,d),(c,a),(d,c)}. What is S∘R?
  1. {(a,a),(a,d),(b,c)}
  2. {(b,c),(c,b),(c,c)}
  3. {(a,b),(a,c),(b,d)}
  4. {(a,d),(a,c),(b,c)}
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

On {1,2,3}, let R={(1,2),(2,1),(2,3),(3,3)}. What is R2?
  1. {(1,1),(1,2),(2,2),(2,3),(3,3)}
  2. {(1,2),(1,3),(2,1),(2,3),(3,3)}
  3. {(1,1),(1,3),(2,2),(2,3),(3,3)}
  4. {(1,1),(1,3),(2,2),(3,1),(3,3)}
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

On the integers, define a R b by a≤b+2. Which triple witnesses failure of transitivity?
  1. a=0, b=2, c=4
  2. a=4, b=2, c=0
  3. a=2, b=0, c=2
  4. a=4, b=0, c=2
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

On a four-element set, how many relations are both reflexive and antisymmetric?
  1. 729
  2. 64
  3. 4096
  4. 11664
Show answerHide answer

Save this lesson to see this answer.

Set 3: Equivalence, classes, and partitions10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

On all finite strings, x∼y means that x and y have equal length. Which equivalence properties hold?
  1. Reflexive and symmetric only.
  2. Reflexive and transitive only.
  3. Reflexive, symmetric, and transitive.
  4. Symmetric and transitive only.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

For integer pairs with nonzero second coordinate, (a,b)∼(c,d) means ad=bc. Which pair is equivalent to (2,5)?
  1. (5,2)
  2. (6,15)
  3. (6,10)
  4. (4,25)
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

On the integers, a∼b means ∣a−b∣≤2. Which triple demonstrates that this is not an equivalence relation?
  1. 0, 1, 2
  2. 0, 4, 6
  3. 2, 2, 4
  4. 0, 2, 4
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Under congruence modulo 6, which representative names the same class as 17?
  1. 1
  2. −1
  3. 4
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A partition of a seven-element set has block sizes 4, 2, and 1. How many ordered pairs belong to its equivalence relation?
  1. 21
  2. 7
  3. 14
  4. 49
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

On {a,b,c,d}, one partition is {{a,b},{c,d}} and another is {{a,c},{b,d}}. What partition represents the intersection of their equivalence relations?
  1. {{a},{b},{c},{d}}
  2. {{a,b,c,d}}
  3. {{a,b},{c,d}}
  4. {{a,c},{b,d}}
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

On {1,2,3,4,5,6}, R={(1,4),(4,6),(2,3)}. How many pairs are in the smallest equivalence relation containing R?
  1. 10
  2. 12
  3. 14
  4. 18
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Equivalence relations E and F on {a,b,c} have blocks {a,b},{c} and {a},{b,c}, respectively. What is the smallest equivalence relation containing E∪F?
  1. The union itself, with seven pairs.
  2. The identity relation with three pairs.
  3. A relation with the two blocks {a,b} and {b,c}.
  4. The universal relation with nine pairs.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

On the integers, a∼b means 5∣(a−b). Does 12 relate to −3?
  1. No, because their sum is 9.
  2. Yes, because their difference is 15.
  3. No, because their signs differ.
  4. Yes, because both are multiples of 3.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

How many equivalence relations on {a,b,c,d} put a and b in the same class?
  1. 5
  2. 4
  3. 8
  4. 15
Show answerHide answer

Save this lesson to see this answer.

Set 4: Orders, diagrams, and bounds10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Under divisibility on positive integers, how are 6 and 15 compared?
  1. They are incomparable.
  2. 6 is strictly below 15.
  3. 15 is strictly below 6.
  4. Each is below the other.
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

Why does divisibility fail to be a partial order on the set of nonzero integers?
  1. Negative integers violate reflexivity.
  2. Integer products violate transitivity.
  3. Incomparable integers violate totality.
  4. Opposite integers violate antisymmetry.
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

In the divisibility poset {1,2,4,5,10,20}, which elements cover 2?
  1. 4 and 20
  2. 5 and 10
  3. 4 and 10
  4. 10 and 20
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A finite poset has exactly the covers a≺c, b≺c, and b≺d. Are a and d comparable?
  1. Yes; the route a–c–b–d connects them.
  2. No; neither has an upward path to the other.
  3. Yes; they share a common lower element.
  4. No; every pair without an edge is incomparable.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

For {3,5,15,25} under divisibility, what are the maximal elements?
  1. 3 and 5
  2. 15 and 25
  3. 25 only
  4. 15 only
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

In S={1,2,3,6,10,15,30} under divisibility, what are the least upper bound and greatest lower bound of 10 and 15?
  1. Join 30 and meet 1.
  2. Join 30 and meet 5.
  3. Join 15 and meet 1.
  4. No join and meet 5.
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A poset has elements a,b,u,v,t, with a,b both below u,v, and u,v both below t; no other strict comparisons hold except consequences. What are the minimal upper bounds and least upper bound of {a,b}?
  1. Minimal upper bounds u,v; least upper bound t.
  2. Minimal upper bound t; least upper bound t.
  3. Minimal upper bound u; least upper bound u.
  4. Minimal upper bounds u,v; no least upper bound.
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Using lexicographic order on positive-integer pairs, does the subset T={(3,n):n≥1}∪{(4,1)} have a least element, and if so which?
  1. No; the second coordinate is unbounded.
  2. Yes, (4,1).
  3. Yes, (3,1).
  4. No; the first coordinates are different.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

Does {1,3,5,15,45} under divisibility form a lattice?
  1. Yes; every pair has both bounds in the set.
  2. No; 3 and 5 are incomparable.
  3. No; 3 and 5 have two upper bounds.
  4. Yes; a greatest element alone guarantees it.
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

On {a,b,c,d}, a Hasse diagram has covers a≺b, a≺c, b≺d, and c≺d. How many pairs are in the full reflexive partial order?
  1. 4
  2. 9
  3. 8
  4. 10
Show answerHide answer

Save this lesson to see this answer.

Set 5: Dependency reasoning and mixed applications10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

Tasks have strict requirements A→C, B→C, and C→D. Which tasks are initially available?
  1. A and C
  2. A and B
  3. B and D
  4. C and D
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

The requirements are A→D, B→D, B→E, C→E, D→F, and E→F. Which list is a topological order?
  1. A,D,B,C,E,F
  2. B,E,C,A,D,F
  3. A,B,D,F,C,E
  4. B,C,E,A,D,F
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

Six unit-duration tasks have only the strict requirements A→C→E and B→D→F, including their consequences. With unlimited capacity, how many steps are needed?
  1. 3
  2. 2
  3. 4
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Unit tasks A,B,C,D,E,F have strict requirements A→C, B→C, C→D, D→E, and C→F. With capacity two tasks per step, what are the minimum steps and width?
  1. 4 steps; width 2.
  2. 4 steps; width 3.
  3. 5 steps; width 2.
  4. 3 steps; width 3.
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

Unit tasks U,V,W must all precede each of P,Q,R,S, and each of P,Q,R,S must precede T. With capacity three per step, what is the minimum completion time?
  1. 3 steps
  2. 5 steps
  3. 4 steps
  4. 6 steps
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A dependency graph has requirements A→B, B→C, C→A, D→C, and E→D. After repeatedly removing available vertices, which vertices remain?
  1. A,B,C,D
  2. A,B,C
  3. A,B,C,D,E
  4. B,C only
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A six-task poset has strict requirements a→c, c→f, b→d, b→f, and e→f, and no others except their consequences. What is its width?
  1. 2
  2. 4
  3. 3
  4. 6
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

In Warshall’s algorithm, why can an unchanged first round still be followed by new pairs later?
  1. Each later round automatically adds every missing loop.
  2. An unchanged round shows that all direct arrows are absent.
  3. Later rounds must use paths with exactly their round number.
  4. A later vertex can join routes the first vertex cannot.
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

On an eight-element set, an equivalence relation has class sizes 3, 3, and 2. One pair is added linking the two size-3 classes, and the smallest equivalence extension is formed. How many new ordered pairs are added?
  1. 1
  2. 18
  3. 9
  4. 36
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

Within the positive integers, how many elements must be added at minimum to S={2,3,6,12,18} to make the enlarged set a lattice under divisibility?
  1. 2
  2. 1
  3. 3
  4. 4
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

79 Key Terms, each with its definition

A

Antichain
An antichain is a subset of a poset whose distinct elements are pairwise incomparable, with no precedence requirements between them.
Tasks in one valid parallel time step form an antichain when each task lasts one full step.
Antisymmetric relation
An antisymmetric relation never relates two distinct elements in both directions, though it may contain diagonal pairs.
Subset inclusion is antisymmetric because two sets included in each other must be the same set.
Asymmetric relation
An asymmetric relation contains no reverse of any pair it contains, which also prevents it from containing any diagonal pair.
Less than is asymmetric: if one integer is smaller than another, the reverse comparison is false.

B

Bell number
A Bell number counts the partitions of a set of a given size, equivalently the equivalence relations on that set.
The third Bell number is 5: three elements can be partitioned into blocks in five distinct ways.
Binary relation
A binary relation from one set to another is a subset of their Cartesian product, recording which ordered pairs belong.
Enrollment is a binary relation that can connect one student to several courses and another student to none.
Bit operation
A bit operation acts on Boolean values, such as one AND or one OR in an individual update of a reachability matrix.
The full Warshall update has two bit operations per entry per round, giving 2n3 operations.
Block
A block is one nonempty subset in a partition, containing the elements placed together by its associated equivalence relation.
A block of three elements contributes nine ordered pairs because every member relates to every member.
Boolean join
The Boolean join combines zero-one matrices entry by entry using OR, producing 1 wherever at least one input entry is 1.
Joining two relation matrices produces the matrix of the union of their ordered pairs.
Boolean meet
The Boolean meet combines zero-one matrices entry by entry using AND, producing 1 only where both input entries are 1.
Meeting two relation matrices retains the pairs shared by both of the original relations.
Boolean power
A Boolean power is a repeated Boolean product of a square zero-one matrix, recording routes of exactly that many steps.
A new 1 in a Boolean square marks a two-step connection missing from the original relation.
Boolean product
The Boolean product uses AND at each middle index and OR across the indices to record whether a connecting route exists.
Two working middle indices still give a Boolean output of 1, even though ordinary multiplication gives 2.

C

Chain
A chain is a subset of a poset whose elements are pairwise comparable, so its tasks must occur in a fixed relative order.
If course P1 must precede DS, DS must precede AL, and AL must precede ML, then P1, DS, AL, ML form a four-element chain.
Closure of a relation
A closure of a relation for a property is the smallest containing relation with that property, ordered by set inclusion.
If a relation already has the required property, its closure is the original relation itself.
Comparable elements
Comparable elements are elements of a poset for which at least one lies below or equal to the other in its order.
Under divisibility, 2 and 8 are comparable, but 3 and 8 are incomparable.
Complement of a relation
The complement of a relation contains exactly the pairs missing from it within the specified source-by-target Cartesian product.
On the integers, the complement of less than is greater than or equal to, so it includes equality.
Composition of relations
The composition of relations follows a pair of the first relation with a pair of the second through a shared middle element.
For “parent of,” two successive relation steps connect a grandparent to a grandchild.
Congruence modulo m
Congruence modulo a positive integer means that the difference of two integers is divisible by that integer.
The integers 1 and 9 are congruent modulo 4 because their difference is divisible by 4.
Connectivity relation
The connectivity relation records ordered pairs joined by at least one arrow along a path, allowing repeated vertices.
A cycle makes each of its vertices positively reachable from itself, so its loops enter connectivity.
Containing relation
A containing relation is an extension whose pair set includes every original pair, possibly together with additional pairs.
A containing relation cannot repair irreflexivity by deleting an existing loop, since deletion is not allowed.
Counterexample
A counterexample is a specific case that violates a general claim, showing that the claim does not hold in every required case.
To refute transitivity, show two joining pairs whose required endpoint pair is missing.
Cover
An element covers a smaller element when no element of the poset lies strictly between them in the partial order.
Among the divisors of 12, 4 covers 2 but does not cover 1 because 2 lies between them.

D

Dilworth’s theorem
Dilworth’s theorem states that the minimum number of chains partitioning a finite poset equals its width.
An antichain of three tasks forces at least three chains in any chain partition of that poset.
Directed acyclic graph
A directed acyclic graph, or DAG, is a directed graph containing no directed cycles, so finite strict dependencies can be ordered.
A cycle of three tasks each waiting for the next prevents their graph from being a DAG.
Directed cycle
A directed cycle is a positive-length closed directed route with no repeated vertices except its shared starting and ending vertex.
The arrows 1 to 2, 2 to 3, and 3 to 1 form a directed cycle of length three.
Directed edge
A directed edge is an ordered pair of vertices, drawn as an arrow from its first coordinate to its second coordinate.
The edge from 4 to 3 records (4,3) and gives no reverse connection unless another arrow is drawn.
Directed graph
A directed graph has vertices and directed edges, with an ordered pair specifying the starting and ending vertex of each edge.
A relation on a finite set becomes a directed graph by drawing one arrow for each included pair.

E

Empty relation
The empty relation is the relation with no ordered pairs; no element is related to any element through that relation.
On a nonempty set, the empty relation is irreflexive but fails reflexivity because all loops are absent.
Equivalence class
An equivalence class of an element is the set of all elements related to it under a given equivalence relation.
Modulo 4, the class of 1 also contains 5 and −3, and either can name that same class.
Equivalence relation
An equivalence relation is a reflexive, symmetric, and transitive relation that groups elements matching in a chosen respect.
Strings with the same length form an equivalence relation, even when their letters differ.

F

Floor
The floor of a real number is the greatest integer less than or equal to it, providing a whole-number output for each input.
The numbers 2.3 and 2.9 have the same floor, so equality of floors places them together.

G

Greatest element
A greatest element is an element of a poset above or equal to every element of the poset; if it exists, it is unique.
The greatest divisor of 12 under divisibility is 12, because every divisor lies below it.
Greatest lower bound
A greatest lower bound, or infimum or meet, is a lower bound above or equal to every other lower bound of the same subset.
For subsets under inclusion, intersection gives their greatest lower bound within the power set.

H

Hasse diagram
A Hasse diagram displays a finite poset using only upward cover edges, omitting loops, transitive shortcuts, and arrowheads.
In a Hasse diagram of the divisors of 12, no edge goes from 1 directly to 12 because longer upward paths suffice.
Height
The height of a finite poset is the number of elements in a largest chain, measuring its longest forced sequence.
A chain of four tasks has height four, even though its Hasse path contains only three edges.

I

Identity relation
The identity relation on a set contains exactly its diagonal pairs, relating each element to itself and to no other element.
On a set with four elements, the identity relation has four pairs, one for each element.
In-place update
An in-place update writes new entries into the same matrix being read, without retaining a separate full matrix for the round.
Warshall permits in-place updates because its current row and current column stay fixed during their round.
Interior vertex
An interior vertex of a path is a vertex occurrence between its endpoints, serving as an intermediate point along the route.
In the route from 1 through 2 to 3, the vertex 2 is interior while 1 and 3 are endpoints.
Intersection of relations
The intersection of relations keeps just the pairs common to all the input relations with the same coordinate sets.
Intersecting two transitive relations preserves transitivity because both enforce the required pair.
Inverse relation
The inverse relation reverses each ordered pair of a relation, exchanging the roles of its first and second coordinate sets.
The inverse of “is enrolled in” runs from courses to the students enrolled in them.
Irreflexive relation
An irreflexive relation contains no diagonal pair, meaning that no element of the underlying set is related to itself.
Strictly taller than is irreflexive because a person is never strictly taller than themselves.

L

Lattice
A lattice is a poset in which every pair of elements has both a least upper bound and a greatest lower bound in the poset.
Every total order is a lattice: the larger and smaller member provide the two bounds for each pair.
Least element
A least element is an element of a poset below or equal to every element of the poset; if it exists, it is unique.
The empty set is least in a power set ordered by inclusion because it is included in every subset.
Least upper bound
A least upper bound, or supremum or join, is an upper bound below or equal to every other upper bound of the same subset.
For positive integers under divisibility, the least upper bound of 4 and 6 is their lcm, 12.
Lexicographic order
Lexicographic order compares sequences at their first differing coordinate, placing a shorter prefix before its longer extension.
The word “disc” precedes “disk” because the first differing letters are “c” and “k.”
Linear extension
A linear extension is a total order on the same set that respects every comparison required by the original partial order.
Placing two incomparable tasks in sequence can extend a dependency order without violating any requirement.
Loop
A loop is an edge whose starting and ending vertices are the same, representing a diagonal pair in a relation digraph.
A two-arrow return route requires a loop at its starting vertex if the relation is transitive.
Lower bound
A lower bound of a subset is an element of the ambient poset below or equal to every element of that subset.
Under divisibility on positive integers, both 1 and 2 are lower bounds of the pair 4 and 6.

M

Maximal element
A maximal element of a poset has no element strictly above it, though it may be incomparable with other maximal elements.
In the divisibility poset of 2, 3, 6, 8, 12, 18, the elements 8, 12, and 18 are maximal.
Minimal element
A minimal element of a poset has no element strictly below it, though other incomparable minimal elements may exist.
The elements 2 and 3 are both minimal in the divisibility poset of 2, 3, 6, 8, 12, 18.
Mirsky’s theorem
Mirsky’s theorem states that the minimum number of antichains partitioning a finite poset equals its height.
Grouping tasks by longest-chain-ending level gives a height-sized antichain partition.

P

Partial order
A partial order is a reflexive, antisymmetric, and transitive relation, allowing some pairs of elements to remain incomparable.
Divisibility is a partial order on positive integers, with neither 2 nor 3 below the other.
Partition
A partition of a set is a collection of nonempty, pairwise disjoint subsets whose union is the whole set.
Blocks of sizes 3, 2, and 1 partition six elements only when every element appears exactly once.
Path
A path, in the relation-power convention, is a sequence of joining arrows that may repeat vertices; its length counts arrows.
Following a three-vertex directed cycle for three arrows returns to the initial vertex.
Poset
A poset, or partially ordered set, consists of a set together with a specified partial order on its elements.
The same numerical set can form different posets when ordered by usual size or by divisibility.
Power of a relation
A power of a relation records pairs connected by exactly the stated number of successive steps in that same relation.
The square of a relation includes a pair only when a two-arrow route connects its entries.
Predecessor
A predecessor of a task is another task that must occur earlier according to the dependency order, directly or through other tasks.
A course with two predecessors becomes ready only after both have been removed from the remaining tasks.

Q

Quotient set
A quotient set is the set of all distinct equivalence classes of an equivalence relation on the underlying set.
The integers modulo 4 give a quotient set with four members, each of which is a class of integers.

R

Reflexive closure
The reflexive closure retains a relation and adds every missing diagonal pair for the whole underlying set.
For less than on the integers, reflexive closure adds equality and gives less than or equal to.
Reflexive relation
A reflexive relation on a set relates every element to itself, so all diagonal pairs of the underlying set must belong.
Adding an isolated third element can make a relation nonreflexive if its new diagonal pair is absent.
Reflexive-transitive closure
The reflexive-transitive closure combines positive-length reachability with every diagonal pair, also allowing zero-step self-connections.
An isolated vertex gets a self-pair in reflexive-transitive closure even though no positive path starts there.
Relation on a set
A relation on a set is a set of ordered pairs in which both coordinates come from that same specified underlying set.
Divisibility on the positive integers relates 3 to 12 because 12 is an integer multiple of 3.
Representative
A representative of an equivalence class is any member chosen to name the class; choosing another member leaves the class unchanged.
For congruence modulo 4, 1 and 5 are different representatives of the same set of integers.

S

Strict partial order
A strict partial order is an irreflexive and transitive relation, obtained by removing diagonal pairs from a partial order.
Proper inclusion is the strict version of subset inclusion because equal sets are excluded.
Symmetric closure
The symmetric closure retains a relation and adds every missing reversed pair, without adding unrelated diagonal pairs.
The symmetric closure of less than on the integers is inequality, with no equal pairs.
Symmetric relation
A symmetric relation contains the reverse of every pair it contains; related elements are always related in both directions.
Having the same birth year is symmetric: reversing the people preserves the matching-year claim.

T

Topological sorting
Topological sorting constructs a compatible total order of a finite dependency structure by repeatedly choosing a minimal remaining element.
Removing a completed prerequisite can make a previously blocked course available for the next position.
Total order
A total order is a partial order in which every two elements are comparable, also called a linear order.
The integers under their usual order are totally ordered; positive integers under divisibility are not.
Transitive closure
The transitive closure is the smallest transitive relation containing the original relation, consisting of all positive-length reachable pairs.
For a four-vertex directed chain, its transitive closure adds every shortcut to a later vertex.
Transitive relation
A transitive relation includes the endpoint pair whenever two of its pairs join through a common middle element.
If a relation contains both directions between distinct elements, transitivity requires both loops.
Transpose
The transpose of a matrix exchanges its rows and columns; for a relation matrix, this reverses every represented pair.
A symmetric relation has a matrix equal to its transpose when both axes use the same ordering.

U

Union of relations
The union of relations contains every pair that belongs to at least one of the input relations with the same coordinate sets.
The union of less than and equality is less than or equal to on the same underlying set.
Universal relation
The universal relation on a set contains every possible ordered pair, so every element is related to every element of that set.
A three-element set has nine pairs in its universal relation, including all three diagonal pairs.
Upper bound
An upper bound of a subset is an element of the ambient poset above or equal to every element of that subset.
In positive integers under divisibility, 12 and 24 are both upper bounds of the pair 4 and 6.
Upward path
An upward path in a Hasse diagram follows cover edges only from smaller elements toward larger elements at every step.
The upward path from 3 through 6 to 12 shows that 3 divides 12 without a direct edge.

V

Vertex
A vertex is an element represented by a point in a graph; in a relation digraph, every element of the underlying set has one.
An isolated vertex still matters when checking whether every element has a reflexive loop.

W

Warshall’s algorithm
Warshall’s algorithm finds transitive closure by allowing one more interior vertex per round and updating a zero-one reachability matrix.
A round can add no pairs while a later round still adds routes through a different vertex.
Well order
A well order is a total order in which every nonempty subset of the ordered set has a least element.
Positive integers with the usual order are well ordered, while all integers with that order are not.
Width
The width of a finite poset is the number of elements in a largest antichain, measuring the largest incomparable subset.
A partition into three chains proves that every antichain has at most three elements.

Z

Zero-one matrix
A zero-one matrix represents a finite relation by placing 1 at each included row-column pair and 0 at each excluded pair.
With rows and columns ordered 1, 2, 3, a 1 in row 2 and column 3 represents the pair (2,3).

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started