Transitive closure by Warshall's algorithm
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {1}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {4}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,3,4}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {2,4,5}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are {1,2,3,4,5}. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 21 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 0 | 1 | 0 |
| 5 | 0 | 0 | 0 | 1 | 0 |
For intermediate 1, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 0 | 1 | 0 |
| 5 | 0 | 0 | 0 | 1 | 0 |
For intermediate 2, the new pairs are (4,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 1 | 0 |
| 5 | 0 | 0 | 0 | 1 | 0 |
For intermediate 3, the new pairs are (2,5),(4,5).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 0 | 0 | 1 | 1 | 1 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 | 1 | 0 |
For intermediate 4, the new pairs are (2,2),(5,2),(5,3),(5,5).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 0 | 1 | 1 | 1 | 1 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 1 | 1 | 1 | 1 |
| 5 | 0 | 1 | 1 | 1 | 1 |
For intermediate 5, the new pairs are (1,2),(1,4),(3,2),(3,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 1 |
| 2 | 0 | 1 | 1 | 1 | 1 |
| 3 | 0 | 1 | 1 | 1 | 1 |
| 4 | 0 | 1 | 1 | 1 | 1 |
| 5 | 0 | 1 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {5}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {1,2,5}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {3}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {3,4}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are {1,5}. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 10 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 0 | 0 | 0 | 0 |
For intermediate 1, the new pairs are (5,2),(5,5).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
For intermediate 2, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
For intermediate 3, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
For intermediate 4, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
For intermediate 5, the new pairs are (1,1).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 0 |
| 4 | 0 | 0 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {1,2,4,5}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {3}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,3,4,5}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {1,2,3,4,5}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are {1,2,3,4,5}. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 25 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 0 | 0 | 1 | 0 |
| 3 | 0 | 1 | 1 | 0 | 0 |
| 4 | 1 | 0 | 0 | 0 | 1 |
| 5 | 1 | 0 | 0 | 0 | 1 |
For intermediate 1, the new pairs are (2,3),(4,3),(5,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 0 | 1 | 1 | 0 |
| 3 | 0 | 1 | 1 | 0 | 0 |
| 4 | 1 | 0 | 1 | 0 | 1 |
| 5 | 1 | 0 | 1 | 0 | 1 |
For intermediate 2, the new pairs are (3,1),(3,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 0 | 1 | 1 | 0 |
| 3 | 1 | 1 | 1 | 1 | 0 |
| 4 | 1 | 0 | 1 | 0 | 1 |
| 5 | 1 | 0 | 1 | 0 | 1 |
For intermediate 3, the new pairs are (1,2),(1,4),(2,2),(4,2),(4,4),(5,2),(5,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 1 | 1 | 0 |
| 3 | 1 | 1 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
For intermediate 4, the new pairs are (1,5),(2,5),(3,5).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 | 1 |
| 3 | 1 | 1 | 1 | 1 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
For intermediate 5, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 | 1 |
| 3 | 1 | 1 | 1 | 1 | 1 |
| 4 | 1 | 1 | 1 | 1 | 1 |
| 5 | 1 | 1 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,4}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {2,4}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {1,2,4}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,4}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {1,2,3,4}. Those vertices can reach 4.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 16 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 0 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 0 | 0 | 0 |
For intermediate 1, the new pairs are (2,2),(4,2).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 |
| 2 | 1 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 0 | 0 |
For intermediate 2, the new pairs are (1,1),(1,3),(4,3).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 1 | 0 |
For intermediate 3, the new pairs are (1,4),(2,4),(4,4).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 |
For intermediate 4, the new pairs are (3,1),(3,2),(3,3).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 |
| 3 | 1 | 1 | 1 | 1 |
| 4 | 1 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,4}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {1,4}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {4}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,4}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {1,2,3,4}. Those vertices can reach 4.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 16 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 |
| 2 | 0 | 0 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 0 | 0 |
For intermediate 1, the new pairs are (4,3).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 |
| 2 | 0 | 0 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 1 | 0 |
For intermediate 2, no new pair is needed.
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 0 |
| 2 | 0 | 0 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 1 | 0 |
For intermediate 3, the new pairs are (1,4),(2,4),(4,4).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 0 | 1 | 1 |
| 2 | 0 | 0 | 1 | 1 |
| 3 | 0 | 0 | 0 | 1 |
| 4 | 1 | 1 | 1 | 1 |
For intermediate 4, the new pairs are (1,2),(2,1),(2,2),(3,1),(3,2),(3,3).
| 1 | 2 | 3 | 4 | |
|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 | 1 |
| 3 | 1 | 1 | 1 | 1 |
| 4 | 1 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {1,2}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {1,2}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {3,4}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {4,5}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are {3,4,5}. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 13 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 | 1 | 1 |
For intermediate 1, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 | 1 | 1 |
For intermediate 2, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 | 1 | 1 |
For intermediate 3, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 | 1 | 1 |
For intermediate 4, the new pairs are (5,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 0 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 1 | 1 | 1 |
For intermediate 5, the new pairs are (3,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 0 | 0 | 0 |
| 3 | 0 | 0 | 1 | 1 | 1 |
| 4 | 0 | 0 | 1 | 1 | 1 |
| 5 | 0 | 0 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {2,5}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {1,2,4,5}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,4,5}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {1,2,3,4,5}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are {5}. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 21 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 0 |
| 2 | 1 | 0 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 1 | 0 | 1 | 0 |
| 5 | 1 | 0 | 0 | 0 | 1 |
For intermediate 1, the new pairs are (2,2),(5,2).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 0 |
| 2 | 1 | 1 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 1 | 0 | 1 | 0 |
| 5 | 1 | 1 | 0 | 0 | 1 |
For intermediate 2, the new pairs are (1,1),(1,3),(4,1),(4,3),(5,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 0 | 0 |
| 2 | 1 | 1 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 | 0 |
| 5 | 1 | 1 | 1 | 0 | 1 |
For intermediate 3, the new pairs are (1,4),(2,4),(5,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 | 0 |
| 5 | 1 | 1 | 1 | 1 | 1 |
For intermediate 4, the new pairs are (3,1),(3,2),(3,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 1 | 1 | 0 |
| 3 | 1 | 1 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 | 0 |
| 5 | 1 | 1 | 1 | 1 | 1 |
For intermediate 5, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1 | 1 | 0 |
| 2 | 1 | 1 | 1 | 1 | 0 |
| 3 | 1 | 1 | 1 | 1 | 0 |
| 4 | 1 | 1 | 1 | 1 | 0 |
| 5 | 1 | 1 | 1 | 1 | 1 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
Find the transitive closure
Use Warshall's algorithm to find the transitive closure on A={1,…,5}.
Build the initial matrix and state the update rule
Write the elements in the displayed order across both axes. For each ordered pair (i,j), put a one in row i, column j. Every unlisted pair gets zero. This is W0, which records the given edges before using intermediate vertices.
Allow intermediate vertex 1
Read column 1 of W0. The rows with ones are {5}. Those vertices can reach 1.
Allow intermediate vertex 2
Read column 2 of W1. The rows with ones are {1,5}. Those vertices can reach 2.
Allow intermediate vertex 3
Read column 3 of W2. The rows with ones are {1,2,5}. Those vertices can reach 3.
Allow intermediate vertex 4
Read column 4 of W3. The rows with ones are {1,2,3,5}. Those vertices can reach 4.
Allow intermediate vertex 5
Read column 5 of W4. The rows with ones are ∅. Those vertices can reach 5.
Check positive-length reachability from each start
Read the ones of the last matrix row by row. After all passes every vertex may be used in the middle, so these 10 pairs form the transitive closure.
Write this in the booklet
Form the initial relation matrix. In pass k apply the Boolean update below to allow vertex k as an intermediate vertex.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 0 | 0 | 1 | 0 |
For intermediate 1, the new pairs are (5,2).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 0 | 0 | 0 |
| 2 | 0 | 0 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 0 | 1 | 0 |
For intermediate 2, the new pairs are (1,3),(5,3).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 0 | 0 |
| 2 | 0 | 0 | 1 | 0 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 1 | 1 | 0 |
For intermediate 3, the new pairs are (1,4),(2,4).
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 1 | 0 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 1 | 1 | 0 |
For intermediate 4, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 1 | 0 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 1 | 1 | 0 |
For intermediate 5, no new pair is needed.
| 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|
| 1 | 0 | 1 | 1 | 1 | 0 |
| 2 | 0 | 0 | 1 | 1 | 0 |
| 3 | 0 | 0 | 0 | 1 | 0 |
| 4 | 0 | 0 | 0 | 0 | 0 |
| 5 | 1 | 1 | 1 | 1 | 0 |
The final matrix contains exactly the positive-length paths with all intermediate vertices allowed. Its ones give
One-to-one, onto and inverse
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Prove a piecewise function is bijective
Prove that the following function from Z to N is one-to-one and onto, and find its inverse.
Determine which outputs each branch gives
Use N={0,1,2,…}, as required by f(0)=0. A positive integer has form x=t+1 with t≥0, so 2x−1=2(t+1)−1=2t+1 is positive and odd. For a nonpositive integer write x=−t with t≥0. Then −2x=−2(−t)=2t is nonnegative and even. Both branches land in the declared codomain.
Compare equal outputs in all three cases
Assume f(a)=f(b). Separate the possible branches, because the formula used for one input depends on its sign.
Find and verify a preimage for every target
Take an arbitrary target n∈N. An odd target must come from the positive branch. Solve that equation first.
Check the forward and inverse formulas
Check both branches, including the boundary at zero. First use the sign of the input to choose the forward formula. Then use the parity of the output to choose the inverse formula. The last column must give back the starting input.
The table is empty. Press Next step to fill it one row at a time (6 steps).
| Input | Forward calculation | Inverse calculation |
|---|---|---|
Write this in the booklet
Use N={0,1,2,…}, as required by f(0)=0. A positive integer has form x=t+1 with t≥0, so 2x−1=2(t+1)−1=2t+1 is positive and odd. For a nonpositive integer write x=−t with t≥0. Then −2x=−2(−t)=2t is nonnegative and even. Both branches land in the declared codomain.
Assume f(a)=f(b). Separate the possible branches, because the formula used for one input depends on its sign.
When both inputs are positive, replace both outputs by the odd formula. Add one to each side and divide by two.
When both inputs are nonpositive, replace each output by the even formula and divide by negative two.
When exactly one input is positive, one output is odd and the other is even. Equality is impossible. The two possible equal-output cases both force equal inputs, so the function is injective.
Take an arbitrary target n∈N. An odd target must come from the positive branch. Solve that equation first.
Because n is odd and positive, this input is an integer above zero. Substitute it into the positive branch to obtain 2⋅(n+1)/2−1=n+1−1=n.
An even target must come from the nonpositive branch. Solve its equation.
Because n is nonnegative and even, this is a nonpositive integer. Substitution gives −2(−n/2)=n, including the target zero. Thus every target has a preimage. Injectivity makes each preimage unique, yielding the inverse.
Find the inverse of the first rational function
Check the domain and prove injectivity
The domain excludes the pole. The value one would require x=x+4, so the function maps into its stated codomain. If f(a)=f(b), cross-multiplying gives a(b+4)=b(a+4), hence 4a=4b and a=b. Thus it is injective.
Solve for an arbitrary target
For an arbitrary target y=1, multiply by the denominator, expand the left side, and isolate the input term.
Verify the proposed preimage
Check that the proposed input is allowed and that it gives the correct output.
Write this in the booklet
The denominator is nonzero on the given domain and the output cannot equal one. If the outputs at two inputs agree, cross multiplication gives 4a=4b, so the inputs agree.
For any y=1, solving y(x+4)=x gives x=4y/(1−y). Its denominator in the original function is x+4=4/(1−y)=0, and substitution gives f(x)=y. Hence the function is bijective and f−1(y)=4y/(1−y).
Find the inverse of the second rational function
Check the excluded values and compare equal outputs
For the scanned question, f(x)=1+2/(x−2), so the value one is excluded. If f(a)=f(b), then a(b−2)=b(a−2), which simplifies to −2a=−2b. Thus a=b and the map is injective.
Solve the output equation
For an arbitrary target y=1, multiply by the denominator and collect both terms with the input on the same side.
Substitute and check the alternate numerator
Write this in the booklet
For the printed numerator, write f(x)=1+2/(x−2). This lies outside {1} and equal outputs force equal denominators, so the map is injective.
For any y=1, set x=2+2/(y−1). Then x=2 and 1+2/(x−2)=y. Thus f−1(y)=2y/(y−1).
If the numerator is instead x−1, the same computation with f(x)=1+1/(x−2) gives f−1(y)=(2y−1)/(y−1).
Invert a composition of functions
Choose an inverse with the correct domain
Set h=f−1∘g−1:C→A. By associativity of function composition and the defining identities of the inverses,
Cancel the forward and inverse maps in each order
Trace an arbitrary starting element
Check the order on an arbitrary c∈C. First g−1 sends it to B. Then f−1 sends that result to A. The forward composition retraces those moves in the opposite order and ends at c. Starting with an arbitrary a∈A uses the other displayed composition and returns a.
Thus h is a two-sided inverse of g∘f. By uniqueness, (g∘f)−1=f−1∘g−1.
Write this in the booklet
Let h=f−1∘g−1:C→A. Associativity and the two inverse identities give
Therefore the composite has the two-sided inverse h=f−1∘g−1.
Set difference, identities and partitions
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Prove and shade a set identity
Follow a single element through both sides
On the left, the outer intersection requires membership in A. The difference requires membership in B and exclusion from C. On the right, start in A∩B. While inside A, exclusion from A∩C is exactly exclusion from C. Thus both sides ask for the same three memberships.
Use complement, De Morgan, and distribution in order
Replace each difference by an intersection with a complement. Open the complemented intersection using De Morgan's law, then distribute across the resulting union. One term contains both A and Ac, so that term is empty.
Check every Venn region and locate the shading
Use one row per membership pattern. A one means the element belongs to that column's set. Compute the intermediate membership columns first. For a difference, enter one exactly when the element belongs to the first set and is outside the second.
Write this in the booklet
Replace the difference by an intersection with a complement. De Morgan's law changes the complemented intersection to a union. Distribute the intersection across that union.
For a membership proof, take any x. The left side requires x∈A∩B and x∈/C. On the right side, once x∈A∩B holds, excluding A∩C is equivalent to excluding C. Thus the conditions agree in both directions.
For the graphical proof, draw two copies of a three-circle Venn diagram with circles labelled A,B,C. On the first copy, take the part of B outside C and keep its part inside A. On the second, take the lens A∩B and erase its overlap with A∩C, which is the central triple intersection. Shade only the same lens segment outside C in each drawing.
Use one row per membership pattern. A one means the element belongs to that column's set. Compute the intermediate membership columns first. For a difference, enter one exactly when the element belongs to the first set and is outside the second.
| A | B | C | B−C | A∩B | A∩C | A∩(B−C) | (A∩B)−(A∩C) |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
Compare the two final columns row by row. They agree. Shade the row with one in both final columns, the portion inside the first two circles and outside the third.
Distribute a fixed exclusion across an intersection
Translate the set difference into membership
For an arbitrary x, membership on the left requires x∈A, x∈B and x∈/C. These conditions are equivalent to membership in both A−C and B−C. This proves both inclusions. For the algebraic check, expand both differences and use associativity, commutativity and idempotence of intersection.
Simplify the two complements algebraically
Check which membership patterns survive
Use one row for each membership pattern. A one means membership in the corresponding set.
Write this in the booklet
For arbitrary x, belonging to (A∩B)−C means belonging to both sets and lying outside C. This is exactly what membership in both differences requires, proving both inclusions.
Subtract an intersection using De Morgan’s law
Translate the exclusion using a complement
Write the difference as intersection with the complement of B∩C. Apply De Morgan's law, distribute the intersection, then return to difference notation.
Distribute the remaining intersection
Check the membership cases
Use one row for each membership pattern. A one means membership in the corresponding set.
Write this in the booklet
Taking complements in the common universe, De Morgan’s law and distributivity give
Thus the identity holds for arbitrary sets.
Find minsets and maxsets and prove the partition
Assign a membership pattern to every element
Use the declared universe when taking complements. Read the bits in the order of the generating sets. The first table checks each element against all three sets and gives its unique membership pattern.
The table is empty. Press Next step to fill it one row at a time (10 steps).
| Element | In A? | In B? | In C? | Pattern |
|---|---|---|---|---|
Construct the intersections and their complementary unions
A one chooses the set and a zero chooses its complement. Intersect the three choices to obtain the minset candidate.
Verify disjointness and coverage
Every element belongs to the block for its unique pattern. Different patterns disagree on at least one bit, so their blocks are disjoint.
Write this in the booklet
Complement each elementary intersection in the given universe to obtain the corresponding elementary union.
| Intersection | Minset candidate | Complementary union | Maxset candidate |
|---|---|---|---|
| A∩B∩C | {1} | Ac∪Bc∪Cc | U−{1} |
| A∩B∩Cc | ∅ | Ac∪Bc∪C | U |
| A∩Bc∩C | ∅ | Ac∪B∪Cc | U |
| A∩Bc∩Cc | {7,8} | Ac∪B∪C | U−{7,8} |
| Ac∩B∩C | {9,10} | A∪Bc∪Cc | U−{9,10} |
| Ac∩B∩Cc | {6} | A∪Bc∪C | U−{6} |
| Ac∩Bc∩C | ∅ | A∪B∪Cc | U |
| Ac∩Bc∩Cc | {2,3,4,5} | A∪B∪C | U−{2,3,4,5} |
The 5 nonempty intersections are {1},{7,8},{9,10},{6},{2,3,4,5}. Every element has one and only one membership pattern, so these intersections partition U.
The proper maxsets are complements of those blocks. If all elementary unions are listed, U also appears as the complement of each empty intersection.
Partial orders and covering pairs
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Prove inclusion gives a poset and draw it
Prove each axiom for inclusion
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Verify the requirements one at a time.
List the strict successors and remove loops
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
The table is empty. Press Next step to fill it one row at a time (8 steps).
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
Test each strict arrow for an intermediate subset
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
Draw the covers and check an upward chain
Draw one level for each subset size. Place the empty set at the bottom. In a cover exactly one new element is added. Whenever two or more are added, adjoining just one gives an intermediate subset, which explains each deletion in the table.
Write this in the booklet
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Verify the requirements one at a time.
Reflexivity. Take any subset X. Every member of X belongs to X, so X⊆X.
Antisymmetry. Assume X⊆Y and Y⊆X. The first inclusion means every member of X is in Y. The second gives the reverse implication. Having exactly the same members makes the sets equal.
Transitivity. Assume X⊆Y and Y⊆Z. Take any element of X. The first inclusion places it in Y, and the second places it in Z. Thus X⊆Z. All three requirements hold, so this is a poset.
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
| ∅ | (∅,∅) | {a},{b},{c},{a,b},{a,c},{b,c},{a,b,c} |
| {a} | ({a},{a}) | {a,b},{a,c},{a,b,c} |
| {b} | ({b},{b}) | {a,b},{b,c},{a,b,c} |
| {c} | ({c},{c}) | {a,c},{b,c},{a,b,c} |
| {a,b} | ({a,b},{a,b}) | {a,b,c} |
| {a,c} | ({a,c},{a,c}) | {a,b,c} |
| {b,c} | ({b,c},{b,c}) | {a,b,c} |
| {a,b,c} | ({a,b,c},{a,b,c}) | ∅ |
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
| Strict pair | A two-link route when one exists | Decision |
|---|---|---|
| (∅,{a}) | No intermediate element exists in the given set. | Keep the cover. |
| (∅,{b}) | No intermediate element exists in the given set. | Keep the cover. |
| (∅,{c}) | No intermediate element exists in the given set. | Keep the cover. |
| (∅,{a,b}) | ∅→{a}→{a,b} | Remove the direct arrow. |
| (∅,{a,c}) | ∅→{a}→{a,c} | Remove the direct arrow. |
| (∅,{b,c}) | ∅→{b}→{b,c} | Remove the direct arrow. |
| (∅,{a,b,c}) | ∅→{a}→{a,b,c} | Remove the direct arrow. |
| ({a},{a,b}) | No intermediate element exists in the given set. | Keep the cover. |
| ({a},{a,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({a},{a,b,c}) | {a}→{a,b}→{a,b,c} | Remove the direct arrow. |
| ({b},{a,b}) | No intermediate element exists in the given set. | Keep the cover. |
| ({b},{b,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({b},{a,b,c}) | {b}→{a,b}→{a,b,c} | Remove the direct arrow. |
| ({c},{a,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({c},{b,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({c},{a,b,c}) | {c}→{a,c}→{a,b,c} | Remove the direct arrow. |
| ({a,b},{a,b,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({a,c},{a,b,c}) | No intermediate element exists in the given set. | Keep the cover. |
| ({b,c},{a,b,c}) | No intermediate element exists in the given set. | Keep the cover. |
The deleted strict pairs are (∅,{a,b}),(∅,{a,c}),(∅,{b,c}),(∅,{a,b,c}),({a},{a,b,c}),({b},{a,b,c}),({c},{a,b,c}).
Draw one level for each subset size. Place the empty set at the bottom. In a cover exactly one new element is added. Whenever two or more are added, adjoining just one gives an intermediate subset, which explains each deletion in the table.
Check the diagram from bottom to top. To reach the full set, add a, then b, then c. Each of these moves is present as a covering edge, so the complete inclusion is visible even after removing its direct arrow.
Draw the divisibility Hasse diagram
Define a partially ordered set and draw the Hasse diagram for D30.
Check the partial-order axioms
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Check the three axioms on the given positive integers.
List the divisibility arrows and remove loops
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
The table is empty. Press Next step to fill it one row at a time (8 steps).
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
Test the remaining arrows for intermediate divisors
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
The table is empty. Press Next step to fill it one row at a time (19 steps).
| Strict pair | A two-link route when one exists | Decision |
|---|---|---|
The deleted strict pairs are (1,6),(1,10),(1,15),(1,30),(2,30),(3,30),(5,30).
Draw only the covering pairs
Draw the surviving covers with the divisor below its multiple, then remove the arrowheads.
Check upward reachability against divisibility
Read all upward paths starting at each vertex. Their endpoints should equal its strict multiples in the stated set.
Write this in the booklet
Divisibility on the stated positive integers is reflexive because every integer divides itself. If each of two integers divides the other, their positive quotient and its reciprocal are both integers, so they are equal. Divisibility is transitive because the product of integer quotients is an integer. Hence this is a partial order.
The vertices are {1,2,3,5,6,10,15,30}. Starting with every divisible pair, delete the diagonal pairs and any strict pair admitting an intermediate divisor from the set. The remaining covers are
Draw the divisibility Hasse diagram
Draw the Hasse diagram for divisibility on {1,2,3,4,5,6,7,8}. Start from the digraph and prove that divisibility is a partial order.
Check the partial-order axioms
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Check the three axioms on the given positive integers.
List the divisibility arrows and remove loops
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
The table is empty. Press Next step to fill it one row at a time (8 steps).
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
Test the remaining arrows for intermediate divisors
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
The table is empty. Press Next step to fill it one row at a time (12 steps).
| Strict pair | A two-link route when one exists | Decision |
|---|---|---|
The deleted strict pairs are (1,4),(1,6),(1,8),(2,8).
Draw only the covering pairs
Draw the surviving covers with the divisor below its multiple, then remove the arrowheads.
Check upward reachability against divisibility
Read all upward paths starting at each vertex. Their endpoints should equal its strict multiples in the stated set.
Write this in the booklet
Divisibility on the stated positive integers is reflexive because every integer divides itself. If each of two integers divides the other, their positive quotient and its reciprocal are both integers, so they are equal. Divisibility is transitive because the product of integer quotients is an integer. Hence this is a partial order.
The vertices are {1,2,3,4,5,6,7,8}. Starting with every divisible pair, delete the diagonal pairs and any strict pair admitting an intermediate divisor from the set. The remaining covers are
Draw the divisibility Hasse diagram
Draw the Hasse diagram for divisibility on {2,4,5,10,12,20,25}. Start from the digraph and prove that divisibility is a partial order.
Check the partial-order axioms
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Check the three axioms on the given positive integers.
List the divisibility arrows and remove loops
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
The table is empty. Press Next step to fill it one row at a time (7 steps).
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
Test the remaining arrows for intermediate divisors
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
The table is empty. Press Next step to fill it one row at a time (10 steps).
| Strict pair | A two-link route when one exists | Decision |
|---|---|---|
The deleted strict pairs are (2,12),(2,20),(5,20).
Draw only the covering pairs
Draw the surviving covers with the divisor below its multiple, then remove the arrowheads.
Check upward reachability against divisibility
Read all upward paths starting at each vertex. Their endpoints should equal its strict multiples in the stated set.
Write this in the booklet
Divisibility on the stated positive integers is reflexive because every integer divides itself. If each of two integers divides the other, their positive quotient and its reciprocal are both integers, so they are equal. Divisibility is transitive because the product of integer quotients is an integer. Hence this is a partial order.
The vertices are {2,4,5,10,12,20,25}. Starting with every divisible pair, delete the diagonal pairs and any strict pair admitting an intermediate divisor from the set. The remaining covers are
Draw the divisibility Hasse diagram
Draw the Hasse diagram for divisibility on {1,2,3,4,6,8,9,12,18,24}.
Check the partial-order axioms
A poset is a set equipped with a reflexive, antisymmetric and transitive relation. Check the three axioms on the given positive integers.
List the divisibility arrows and remove loops
In the relation digraph, each element has a loop. Remove all the loops first. The diagram uses height to show which of two distinct elements lies above the other.
The table is empty. Press Next step to fill it one row at a time (10 steps).
| Element | Loop removed | Strict successors before removing transitive arrows |
|---|---|---|
Test the remaining arrows for intermediate divisors
Read each strict pair as a proposed edge. Search the given set for an element strictly between its endpoints. A witness lets you follow two shorter links, so cross out that direct arrow. If no witness exists, keep the pair as a cover.
The table is empty. Press Next step to fill it one row at a time (29 steps).
| Strict pair | A two-link route when one exists | Decision |
|---|---|---|
The deleted strict pairs are (1,4),(1,6),(1,8),(1,9),(1,12),(1,18),(1,24),(2,8),(2,12),(2,18),(2,24),(3,12),(3,18),(3,24),(4,24),(6,24).
Draw only the covering pairs
Draw the surviving covers with the divisor below its multiple, then remove the arrowheads.
Check upward reachability against divisibility
Read all upward paths starting at each vertex. Their endpoints should equal its strict multiples in the stated set.
Write this in the booklet
Divisibility on the stated positive integers is reflexive because every integer divides itself. If each of two integers divides the other, their positive quotient and its reciprocal are both integers, so they are equal. Divisibility is transitive because the product of integer quotients is an integer. Hence this is a partial order.
The vertices are {1,2,3,4,6,8,9,12,18,24}. Starting with every divisible pair, delete the diagonal pairs and any strict pair admitting an intermediate divisor from the set. The remaining covers are
Test a relation and build its closures
| Property | Condition for all elements | Matrix test |
|---|---|---|
| Reflexive | (a,a)∈R | Every diagonal entry must be one. |
| Symmetric | (a,b)∈R⟹(b,a)∈R | MR=MRT |
| Antisymmetric | (a,b),(b,a)∈R⟹a=b | MR∧MRT≤I entrywise. |
| Transitive | (a,b),(b,c)∈R⟹(a,c)∈R | MR⊙MR≤MR entrywise |
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Construct a relation from its rule
Test all ordered pairs against the rule
For each row choose an ordered pair from the Cartesian product. Compute the sum and compare it to the strict threshold. An equal sum fails the strict comparison.
Check all four properties on the constructed relation
For reflexivity, check every diagonal pair. Any missing loop defeats reflexivity.
Read closures as additions to the matrix
Since both inputs are at most five, their largest possible sum is 5+5=10. The initial matrix is therefore all zero.
Write this in the booklet
For any (x,y)∈A×A, we have x≤5 and y≤5. Therefore x+y≤10 and no pair satisfies the strict inequality. Thus R=∅, the empty relation.
The empty relation on this nonempty set is irreflexive, symmetric, antisymmetric and transitive. It has no diagonal pairs, and each implication about its pairs holds vacuously.
Complete the diagonal of the relation
Find the missing loop
The table is empty. Press Next step to fill it one row at a time (3 steps).
| Required pair | Action |
|---|---|
Prove the extension is minimal
The diagonal pairs (1,1) and (3,3) are present. Add (2,2) to obtain {(1,1),(1,3),(2,1),(2,2),(3,3)}. Every reflexive superrelation must contain that pair, and it is enough.
Write this in the booklet
The reflexive closure is {(1,1),(1,3),(2,1),(2,2),(3,3)}. Exactly one required loop, (2,2), was absent.
Classify the relation given by three pairs
Test the defining properties on the given pairs
For reflexivity, check every diagonal pair. Any missing loop defeats reflexivity.
Identify the property tested by the options
The only two-step path is 1→2→3, and (1,3) is already present. Thus the relation is transitive, option A. Every off-diagonal arrow lacks its reverse, so the relation is also antisymmetric. The missing loop at one and missing reverse (2,1) show that reflexivity and symmetry fail.
Write this in the booklet
Choose transitive. The only composable pair of arrows gives (1,3), which is present. The reverse of (1,2) and the loop (1,1) are absent. Also, no pair of distinct elements has both orientations, so antisymmetry holds.
Classify the relation represented by a block matrix
| 1 | 1 | 0 |
| 1 | 1 | 0 |
| 0 | 0 | 1 |
Read loops, reverse pairs and paths from the matrix
For reflexivity, check every diagonal pair. Any missing loop defeats reflexivity.
Check that paths stay within their blocks
The diagonal is all ones and the matrix equals its transpose. A two-step path starting in {1,2} stays in that block, where every entry is one. A two-step path starting at three ends at three, where the diagonal is one. Thus MR⊙MR=MR and all three properties hold, option C.
Write this in the booklet
Choose the equivalence relation option. The diagonal is all ones, the matrix is symmetric and its Boolean square equals the original matrix, giving reflexivity, symmetry and transitivity.
Equivalence classes form a partition
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Prove an equivalence relation on the integers
Find the divisibility structure and prove all three properties
Rewrite 3a+4b=7b+3(a−b). Since 3 is coprime to 7, the relation holds precisely when 7∣(a−b). The classes are the residue classes modulo seven. Here is the direct proof using the original expressions.
Read the classes from the divisibility rule
Subtract 7b from the original expression. The difference is 3(a−b). Hence 7∣(3a+4b) exactly when 7∣3(a−b). Because seven is prime and does not divide three, this is equivalent to 7∣(a−b).
Write both integers as multiples of seven plus remainders between zero and six. Their difference is divisible by seven exactly when the remainders are equal. Each remainder therefore determines one class.
Check concrete pairs and a two-step chain
Check concrete pairs using the rule from the question. For each pair, multiply the coordinates by their stated coefficients, add them, and divide by seven to check for remainder zero. The rows include a pair, its reverse, a second link and its required shortcut, followed by a pair in different residue classes.
The table is empty. Press Next step to fill it one row at a time (5 steps).
| Pair | Compute the test expression | Division remainder | Related? |
|---|---|---|---|
Write this in the booklet
For reflexivity, take any integer a. Then 3a+4a=7a is a multiple of seven, so (a,a)∈R.
For symmetry, suppose (a,b)∈R and write 3a+4b=7n for an integer n. Reversing the pair gives
Choose 7(a+b) because subtracting the known expression leaves precisely the swapped coefficients.
The quantity a+b−n is an integer, so (b,a)∈R.
For transitivity, suppose 3a+4b=7n and 3b+4c=7m. Add the equations and move the middle term to the right.
The quantity n+m−b is an integer, so (a,c)∈R. The relation is reflexive, symmetric and transitive, hence an equivalence relation.
Classify divisibility of a difference by three
Test the relation axioms
Every integer is related to itself because a−a=0. If a−b=3k, then b−a=−3k, giving symmetry. If also b−c=3m, then a−c=(a−b)+(b−c)=3(k+m), giving transitivity. Thus it is an equivalence relation. Its classes are the integers congruent to zero, one or two modulo three.
Identify the classes by the division algorithm
Write each integer as a multiple of three plus a remainder in {0,1,2}. The difference is divisible by three exactly when the remainders agree.
Write this in the booklet
This is congruence modulo three, an equivalence relation. Zero, negation, and addition of differences give reflexivity, symmetry, and transitivity respectively.
Recover a relation from a partition
Relate elements in the same block
Relate two elements when they share a block. Each element lies in a block, so it relates to itself. Sharing a block is symmetric. If a,b share one block and b,c share another, both blocks contain b and must be the same. Hence a,c share that block. This defines an equivalence relation.
Check that the original blocks are recovered
The class of any element is precisely its block. Choosing a different element in that block gives the same class because distinct blocks are disjoint.
Write this in the booklet
A partition determines an equivalence relation by declaring two elements related exactly when they share a block.
Translate operations to relation matrices
| Operation | Matrix rule |
|---|---|
| R∪S | Use entrywise OR. |
| R∩S | Use entrywise AND. |
| R⊕S | Use entrywise XOR, with one where the entries differ. |
| R∘S | MR⊙MS |
| R−1 | Transpose the relation matrix. |
| Rc | Flip every entry of the matrix. |
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Compute four relation matrices
| 0 | 1 | 0 |
| 1 | 1 | 1 |
| 1 | 0 | 0 |
| 0 | 1 | 0 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
Compare corresponding cells for the three set operations
Compare entries at the same row and column. For the union, enter one if either input is one. For the intersection, enter one if both are one. For the symmetric difference, enter one if exactly one input is one.
Find every Boolean product entry
For an output cell, hold the first matrix's row and the second matrix's column fixed. Apply AND to each pair of bits at the same middle index, then OR the results. A one means at least one middle element supplies both steps.
Check the product using selected rows
Read the ones in each row of the first matrix. They identify the rows of the second matrix to combine with OR. This gives a second way to calculate the same product a row at a time.
The table is empty. Press Next step to fill it one row at a time (3 steps).
| Row of the first matrix | Rows of the second matrix selected | Expected product row |
|---|---|---|
Write this in the booklet
Compare entries at the same row and column. For the union, enter one if either input is one. For the intersection, enter one if both are one. For the symmetric difference, enter one if exactly one input is one.
| Cell | Input bits | Union | Intersection | Symmetric difference |
|---|---|---|---|---|
| (1,1) | 0,0 | 0 | 0 | 0 |
| (1,2) | 1,1 | 1 | 1 | 0 |
| (1,3) | 0,0 | 0 | 0 | 0 |
| (2,1) | 1,0 | 1 | 0 | 1 |
| (2,2) | 1,1 | 1 | 1 | 0 |
| (2,3) | 1,1 | 1 | 1 | 0 |
| (3,1) | 1,1 | 1 | 1 | 0 |
| (3,2) | 0,1 | 1 | 0 | 1 |
| (3,3) | 0,1 | 1 | 0 | 1 |
To assemble each matrix, read its operation's column in row order and fill the displayed cells.
| 0 | 1 | 0 |
| 1 | 1 | 1 |
| 1 | 1 | 1 |
| 0 | 1 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 0 | 0 | 0 |
| 1 | 0 | 0 |
| 0 | 1 | 1 |
For an output cell, hold the first matrix's row and the second matrix's column fixed. Apply AND to each pair of bits at the same middle index, then OR the results. A one means at least one middle element supplies both steps.
| Output cell | Test every middle index | OR of the AND results |
|---|---|---|
| (1,1) | (0∧0)∨(1∧0)∨(0∧1) | 0∨0∨0=0 |
| (1,2) | (0∧1)∨(1∧1)∨(0∧1) | 0∨1∨0=1 |
| (1,3) | (0∧0)∨(1∧1)∨(0∧1) | 0∨1∨0=1 |
| (2,1) | (1∧0)∨(1∧0)∨(1∧1) | 0∨0∨1=1 |
| (2,2) | (1∧1)∨(1∧1)∨(1∧1) | 1∨1∨1=1 |
| (2,3) | (1∧0)∨(1∧1)∨(1∧1) | 0∨1∨1=1 |
| (3,1) | (1∧0)∨(0∧0)∨(0∧1) | 0∨0∨0=0 |
| (3,2) | (1∧1)∨(0∧1)∨(0∧1) | 1∨0∨0=1 |
| (3,3) | (1∧0)∨(0∧1)∨(0∧1) | 0∨0∨0=0 |
| 0 | 1 | 1 |
| 1 | 1 | 1 |
| 0 | 1 | 0 |
Check the product by reading the first row of MR. Its only one selects row two of MS. Those are exactly the second-step destinations, so the first output row must equal the second row of MS.
Compute the parity relation and its three derived matrices
Build the matrix by comparing the parities
A sum is even when the summands have the same parity. Keep one if both labels are odd or both are even.
Transpose and complement the matrix
Reverse every pair by transposing the matrix. The result is unchanged because equal parity is symmetric.
Calculate the Boolean square
For an output cell, hold the first matrix's row and the second matrix's column fixed. Apply AND to each pair of bits at the same middle index, then OR the results. A one means at least one middle element supplies both steps.
The table is empty. Press Next step to fill it one row at a time (9 steps).
| Output cell | Test every middle index | OR of the AND results |
|---|---|---|
| 1 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
Check the square by selecting whole rows
The first and third rows select the identical odd rows, so their OR is just the original odd row.
Write this in the booklet
Using row and column order 1,2,3, put a one for each pair with equal parity. Transposition gives the inverse, and flipping every entry gives the complement.
| 1 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
| 0 | 1 | 0 |
For the Boolean square, each row is the OR of the same-parity rows of the original matrix. Those rows are equal, so the square is unchanged.
| 1 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 1 |
Compose two relations in the SRM order
Opens chatgpt.com in a new tab with a ready-made prompt for this topic.
Find the composition by matching endpoints
Find R∘S on {1,2,3,4} for the relations below.
Trace every eligible pair of arrows
Read each pair of R as a first arrow. Take its endpoint as the starting point of the second arrow and look through all pairs of S for a match. The resulting pair records the very first and very last vertices.
Verify the pairs with a Boolean product
| 1 | 0 | 1 | 0 |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 |
Write this in the booklet
Read each pair of R as a first arrow. Take its endpoint as the starting point of the second arrow and look through all pairs of S for a match. The resulting pair records the very first and very last vertices.
| First arrow in R | Second arrows available in S | Pairs to keep |
|---|---|---|
| 1→1 | The second relation has no arrow starting there. | This first arrow gives no composed pair. |
| 1→3 | 3→3,3→4 | (1,3),(1,4) |
| 3→2 | 2→1 | (3,1) |
| 3→4 | 4→1 | (3,1) |
| 4→2 | 2→1 | (4,1) |
Two different middle elements can give the same pair. A relation is a set, so keep that pair once. This gives option A.
| 1 | 0 | 1 | 0 |
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 |
| 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 1 | 0 | 0 | 0 |
For an output cell, hold the first matrix's row and the second matrix's column fixed. Apply AND to each pair of bits at the same middle index, then OR the results. A one means at least one middle element supplies both steps.
| Output cell | Test every middle index | OR of the AND results |
|---|---|---|
| (1,1) | (1∧0)∨(0∧1)∨(1∧0)∨(0∧1) | 0∨0∨0∨0=0 |
| (1,2) | (1∧0)∨(0∧0)∨(1∧0)∨(0∧0) | 0∨0∨0∨0=0 |
| (1,3) | (1∧0)∨(0∧0)∨(1∧1)∨(0∧0) | 0∨0∨1∨0=1 |
| (1,4) | (1∧0)∨(0∧0)∨(1∧1)∨(0∧0) | 0∨0∨1∨0=1 |
| (2,1) | (0∧0)∨(0∧1)∨(0∧0)∨(0∧1) | 0∨0∨0∨0=0 |
| (2,2) | (0∧0)∨(0∧0)∨(0∧0)∨(0∧0) | 0∨0∨0∨0=0 |
| (2,3) | (0∧0)∨(0∧0)∨(0∧1)∨(0∧0) | 0∨0∨0∨0=0 |
| (2,4) | (0∧0)∨(0∧0)∨(0∧1)∨(0∧0) | 0∨0∨0∨0=0 |
| (3,1) | (0∧0)∨(1∧1)∨(0∧0)∨(1∧1) | 0∨1∨0∨1=1 |
| (3,2) | (0∧0)∨(1∧0)∨(0∧0)∨(1∧0) | 0∨0∨0∨0=0 |
| (3,3) | (0∧0)∨(1∧0)∨(0∧1)∨(1∧0) | 0∨0∨0∨0=0 |
| (3,4) | (0∧0)∨(1∧0)∨(0∧1)∨(1∧0) | 0∨0∨0∨0=0 |
| (4,1) | (0∧0)∨(1∧1)∨(0∧0)∨(0∧1) | 0∨1∨0∨0=1 |
| (4,2) | (0∧0)∨(1∧0)∨(0∧0)∨(0∧0) | 0∨0∨0∨0=0 |
| (4,3) | (0∧0)∨(1∧0)∨(0∧1)∨(0∧0) | 0∨0∨0∨0=0 |
| (4,4) | (0∧0)∨(1∧0)∨(0∧1)∨(0∧0) | 0∨0∨0∨0=0 |
| 0 | 0 | 1 | 1 |
| 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 |
Check the row with no first arrows. Its output row is all zeros because it offers no middle index at any column.
Part A quick check
| Paper | Question | Answer | Reason |
|---|---|---|---|
| May26 Q1 | Find (B−C)−D for B={1,2,4,8},C={1,2,3,5,7},D={2,4,6,8}. | ∅ | B−C={4,8} and both elements are in D. |
| May26 Q2 | Find the reflexive closure of {(1,1),(1,3),(2,1),(3,3)} on {1,2,3}. | {(1,1),(1,3),(2,1),(2,2),(3,3)} | The only missing diagonal pair is (2,2). |
| May26 Q3 | What relation does every partition determine? | An equivalence relation. | Two elements are related when they are in the same block. |
| May26 Q4 | How are reflexive and transitive edges represented in a Hasse diagram? | They are omitted. | Only covering pairs are drawn. |
| Nov25 Q1 | Classify {(1,2),(2,3),(1,3)} on {1,2,3}. | Transitive. | The only two-step path 1→2→3 already has its direct pair. |
| Nov25 Q2 | Compute f∘g for f(x)=2x+3, g(x)=x2. | 2x2+3 | Substitute x2 into f. |
| Nov25 Q3 | Classify f:N→N, f(x)=x+5. | Injective but not surjective. | Equal outputs force equal inputs and the codomain value 1 has no preimage. |
| Nov25 Q4 | Classify the relation with MR=110110001. | Reflexive, symmetric and transitive. | The all-one blocks on {1,2} and {3} are equivalence classes. |
| Dec23 Q1 | How many subsets does {2,4,6} have? | 23=8 | Each element is independently included or excluded. |
| Dec23 Q2 | How many three-element subsets does a ten-element set have? | (310)=120 | The elements are chosen without regard to order. |
| Dec23 Q3 | Classify aRb⟺3∣(a−b) on Z. | An equivalence relation. | Having the same remainder modulo three is reflexive, symmetric and transitive. |
| Dec23 Q4 | How many functions A→B exist if ∣A∣=2,∣B∣=4? | 42=16 | The two domain elements each have four choices independently. |
| May24 Q1 | Simplify A∩(B∪A). | A | The union already contains every element of A. |
| May24 Q2 | Find R∘S for R={(1,1),(1,3),(3,2),(3,4),(4,2)} and S={(2,1),(3,3),(3,4),(4,1)}. | {(1,3),(1,4),(3,1),(4,1)} | Option A results from matching the end of an R pair to the start of an S pair. |
| May24 Q3 | Find (g∘f)−1 for bijections f:A→B,g:B→C. | f−1∘g−1 | Undo g first, then undo f. |
| May24 Q4, May25 Q4 | Compute f∘g for f(x)=2x+3, g(x)=3x+2. | 6x+7 | Expand 2(3x+2)+3. |
| Jul24 Q1 | Name a reflexive, symmetric and transitive relation. | An equivalence relation. | These three conditions define equivalence. |
| Jul24 Q2 | Find the dual of X=(Bc∩A)∪(A∩B). | X=(Bc∪A)∩(A∪B) | Swap union and intersection throughout while keeping the complement. |
| Jul24 Q3 | Given f:A→B, g:B→A, what is g∘f? | IA if g is a left inverse of f. | As printed, only the type g∘f:A→A follows. |
| Jul24 Q4, May25 Q3 | List pairs on {3,4,5} with x+y>10. | ∅ | Even the maximum sum is 10. |
| Nov24 Q1 | Classify g∘f when f,g are bijections. | A bijection. | The composition preserves injectivity and surjectivity. |
| Nov24 Q2 | Find ∣P(A)∣ if ∣A∣=6. | 26=64 | There are two independent choices per element. |
| Nov24 Q3 | What does MR=MRT imply? | Symmetry. | Every entry agrees with the entry for the reversed pair. |
| Nov24 Q4 | Select a partition of {1,2,3}. | {{1},{2,3}} | The blocks are nonempty and disjoint, and cover the whole set. |
| May25 Q1 | Find P({a,{b}}). | {∅,{a},{{b}},{a,{b}}} | The element {b} stays intact in its singleton subset. |
| May25 Q2 | Compare P={1,{2},4} and Q={1,2,4}. | P=Q | The element {2} is different from 2. |
| Jul25 Q1 | When does A−B=B−A hold? | A=B | The two differences are disjoint, so equality forces both to be empty and gives mutual containment. |
| Jul25 Q2 | Find the inverse of {(6,2),(8,2),(10,2)}. | {(2,6),(2,8),(2,10)} | Reverse each ordered pair. |
| Jul25 Q3 | What does Warshall’s algorithm construct? | The transitive closure. | It adds every pair joined by a directed path of positive length. |
| Jul25 Q4 | Find the inverse of f(x)=3x−7. | f−1(y)=(y+7)/3 | Solve y=3x−7 for x. |
| Jul25P2 Q1 | Expand A−(B∩C). | (A−B)∪(A−C) | An element of the left side lies outside at least one of the two subtracted sets. |
| Jul25P2 Q2 | How many relations are there on an n-element set? | 2n2 | Each of the n2 possible pairs is independently included or excluded. |
| Jul25P2 Q3 | Classify {(1,1),(2,2),(3,3)} on {1,2,3}. | An equivalence relation. | Equality has all three equivalence properties. |
| Jul25P2 Q4 | What property does g∘f have if both maps are onto? | It is onto. | For each target choose a preimage under g, then one under f. |
Unit 1 checklist
Before you move on, can you do each of these without looking?
0 of 8 topics complete
Not sure about one? Go back to it in the topic list and press Next step through the worked question once more. Ticks are saved in this browser. Final checklist for the subject →
Unit complete. Up next: Unit 2, Combinatorics & Number Theory.
All units