You are on page 1of 5

Discrete Mathematics I

Exercise sheet 10 2023

Exercise 1. Let R and S be two transitive binary relations on the same set A (so R, S ⊆ A2 ).
Which of the following new relations must also be transitive? For each part, justify your answer
with a short proof if the new relation is transitive and a counterexample if it is not.

Recall the definition of a transitive relation: A binary relation R on a set A is transitive when
∀a, b, c ∈ A: if (aRb ∧ bRc) → aRc.
(a) S −1

Solution:
S −1 is transitive. Since S is transitive we know that ∀a, b, c ∈ A if aSb ∧ bSc then aSc.
Therefore ∀a, b, c ∈ A if aSb ∧ bSc then bS −1 a ∧ cS −1 b and since aSb ∧ bSc we also have aSc
therefore we also have cS −1 a. Therefore whenever S is transitive then also S −1 is transitive.

(b) R ∪ S

Solution:
R ∪ S is not necessarily transitive, we provide a counter-example. Let A = {a, b, c, d}, R =
{(a, b), (b, c), (a, c)}, and S = {(b, d), (d, c), (b, c)}. Therefore since (a, b) ∈ R also (a, b) ∈ R∪S,
furthermore since (b, d) ∈ S also (b, d) ∈ R∪S. But we do not have that (a, d) ∈ R∪S therefore
R ∪ S is not transitive.

(c) S ◦ S

Solution:
S ◦ S is transitive. Since S is transitive we know that ∀a, b, c ∈ A if aSb ∧ bSc then aSc. So
then ∀k, l, m ∈ A if kSSl ∧ lSSm there has to exist x, y ∈ A such that kSxSl ∧ lSySm. Since
S is transitive kSl and lSm and therefore also kSSm is in the composition and so S ◦ S is
transitive.
(d) S ◦ R

Solution:
S ◦ R is not necessarily transitive, we provide a counter-example. Let A = {a, b, c}, R =
{(a, a), (b, b), (c, c), (b, c)}, and S = {(a, a), (b, b), (c, c), (a, b)}. Hence we have that S ◦ R =
{(a, a), (b, b), (c, c), (a, b), (b, c)}; (a, b) because aRaSb and (b, c) because bRcSc. But even
though (a, b) ∧ (b, c) ∈ S ◦ R we have (a, c) ̸∈ S ◦ R therefore the composition S ◦ R is not
necessarily transitive.

2023 1
Discrete Mathematics I
Exercise sheet 10 2023

Exercise 2.

1. Prove that the property: ‘There exists a vertex of degree 3’ is preserved under isomorphism.

Solution:
Let G and H be two isomorphic graphs. Thus, there is a bijection that maps the vertices of
G to the vertices of H.
f : V (G) → V (H)
Assume there exists a vertex of degree 3 in G, lets call it a.
So there exists different b, c, d ∈ V (G) s.t. (a, b), (a, c), (a, d) ∈ E(G).
And if (a, e) ∈ E(G) then e = b or e = c or e = d.
Consider f (a) in H. Then we have different (f (a), f (b)), (f (a), f (c)), (f (a), f (d)) ∈ E(H).
And if x ∈ V (H) s.t. (f (a), x), then x = f (b) or x = f (c) or x = f (d), since f is an
isomorphism.
So f (a) has degree 3.
Hence “∃ vertex of degree 3” is preserved under isomorphism.
2. Prove that the property: ‘There exists a cycle of length 6’ is preserved under isomorphism.

Solution:
Let G and H be two isomorphic graphs. Thus, there is a bijection that maps the vertices of
G to the vertices of H.
f : V (G) → V (H)
Assume there exists a cycle of length 6 such as : abcdega.
So a, b, c, d, e, g must be different vertices.
We have 6 different f (a), f (b), f (c), f (d), f (e), f (g) in H, which are also different vertices.
Thus, we have a cycle of length 6 in H which is: f (a)f (b)f (c)f (d)f (e)f (g)f (a), by the
definition of isomorphism.
Hence “∃ cycle of length 6” is preserved under isomorphism.

3. Determine which among the four graphs pictured below are isomorphic. For each pair of
isomorphic graphs, describe an isomorphism between them. For each pair of graphs that are
not isomorphic, give a property that is preserved under isomorphism such that one graph
has the property, but the other does not. (1pt)

Solution:
G1 and G4 are isomorphic: f : V (G1 ) → V (G4 )
f (a) = g
f (b) = j
f (c) = h
f (d) = f
f (e) = c
f (f ) = a
f (g) = b
f (h) = e
f (i) = i
f (j) = d

G2 is not isomporphic with any of the other graphs because G2 has cycles of length 4, e.g.
abhf a, but G1 , G3 and G4 do not have any cycles of length 4.
G3 is not isomporphic with any of the other graphs because in G3 the vertices c and d have
a degree of 4 and the other graphs do not have any vertex of degree 4.

2023 2
Discrete Mathematics I
Exercise sheet 10 2023

j a

i f

e f g h c g h b

c d j i

a b e d

(a) G1 (b) G2

j d
c e
i

e f g h a b

c d i
f h

a b g
j

(c) G3 (d) G4

2023 3
Discrete Mathematics I
Exercise sheet 10 2023

Exercise 3. In this problem you will establish a basic property of a puzzle toy called the F if teen P uzzle
using the method of invariants. The F if teen P uzzle consists of sliding square tiles numbered
1, ..., 15 held in a 4 × 4 frame with one empty square. Any tile adjacent to the empty square can
slide into it. The standard initial position is shown here:

1 2 3 4
5 6 7 8
9 10 11 12
13 14 15

You would like to reach the target position as shown below.(known as the "The impossible")

15 14 13 12
11 10 9 8
7 6 5 4
3 2 1
A state machine model of the puzzle has states consisting of a 4 × 4 matrix with 16 entries
consisting of the integers 1, ..., 15 as well as one "empty" entry- like each of the two arrays above.
The state transitions correspond to exchanging the empty square and an adjacent numbered
tile. For example, an empty at position (2, 2) can exchange position with tile above it, namely, at
position (1, 2):

n1 n2 n3 n4 n1 n3 n4
n5 n6 n7 n5 n2 n6 n7
−→
n8 n9 n10 n11 n8 n9 n10 n11
n12 n13 n14 n15 n12 n13 n14 n15

We will use the invariant method to prove that there is no way to reach the target state starting
from the initial state. We begin by noting that a state can also be represented as a pair consisting
of two things:
1. A list of the numbers 1, ..., 15 in the order in which they appear—reading rows left-to-right
from the top row down, ignoring the empty square, and

2. The coordinates of the empty square—where the upper left square has coordinates (1, 1) the
lower right (4, 4).

(a) Write out the “list” representation of the start state and the “impossible” state.

Solution:
start: ((1 2 ... 15),(4,4))
impossible: ((15 14 13 ... 1),(4,4))
Let L be a list of the numbers 1, ..., 15 in some order. A pair of integers is an out-of-order pair
in L when the first element of the pair both comes earlier in the list and is larger, than the
second element of the pair. For example, the list 1, 2, 4, 5, 3 has two out-of-order pairs: (4, 3)
and (5, 3). The increasing list 1, 2, ..., n has no out-of-order pairs.
Let a state, S, be a pair (L, (i, j)) described above. We define the parity of S to be 0 or 1
depending on whether the sum of the number of out-of-order pairs in L and the row-number
of the empty square is even or odd. that is
(
0 if p(L) + i is even
parity(S) ::=
1 otherwise

2023 4
Discrete Mathematics I
Exercise sheet 10 2023

(b) Verify that the parity of the start state and the target state are different.

Solution:
The parity of the start state is 0 since (0 + 4) is even. The parity of the target is 1 because
14
(15 × + 4) is odd.
2
(c) Show that the parity of a state is preserved under transitions. Conclude that the "impossible"
state is impossible to reach.

Solution:
To show that the parity is constant, examine how moves may affect the parity. There are only
4 types of moves: a move to the left, a move to the right, a move to the row above, or a move
to the row below.

Note that horizontal moves change nothing, and vertical moves both change i by 1, and move
a tile three places forward or back in the list L. To see how the parity is changed in this case,
we need to consider only the 3 pairs in L that are between the tile’s old and new position.
(The other pairs are not affected by the tile’s move). This reverses the order of three pairs in
L, changing the number of inversions by ±3 or ±1, but always by an odd amount.

To confirm this last remark, note that if the 3 pairs were all out of order or all in order before,
the amount is changed by ±3. If two pairs were out of order and 1 pair was in order or if one
pair was out of order and two were in order, this will change the amount by ±1. So the sum
of i and the number of out-of-order pairs changes by an even amount (either 1 ± 3 or 1 ±
1), which implies that its parity remains the same. Since the initial state has parity 0 (even),
all states reachable from the initial state must have parity 0, so the target state with parity 1
can’t be reachable.

2023 5

You might also like