Exercise Sheet : Philipps University of Marburg Winter Semester 2024/25
Exercise Sheet : Philipps University of Marburg Winter Semester 2024/25
¨
4. Exercise sheet
q1 –x
q2 – xxxx
–
q4
–
q5
–
q6
q7
1
Machine Translated by Google
ii) Separating by 0
q0 q1 q2 q4 q5 q6 q7
q0 – q1 x x
q2 –x x
q4 – xxxx
q5 –
– xx
q6 –
q7 –
iii) 1.3 Separation according to 1. Example: ÿ(q0, 1) = q5, ÿ(q1, 1) = q6 and q5 already separated from q6 , etc.
q0 q1 q2 q4 q5 q6 q7
q0 – x x x x
q1 – xxxx
q2 – xxxx
q4 –x x
q5 – xx
q6 –x
q7 –
iv) 1.3 Separating by 0. Example: ÿ(q4, a) = q3, ÿ(q5, a) = q6 and q3 already separated from q6 , etc.
q0 q1 q2 q4 q5 q6 q7
q0 – xx q1 xxx
– xxxx
q2 – xxxx
q4 –xxx
q5 – xx
q6 –x
q7 –
¨
v) 1.4 Separation according to 1. No change
q0 q1 q2 q4 q5 q6 q7
q0 – xx xxx
q1 – xxxx
q2 – xxxx
vi) q4 – xxx
q5 – xx
q6 –x
q7 –
¨
vii) 1.5 Separation to 0. No change
q0 q1 q2 q4 q5 q6 q7
q0 – xx xxx
q1 – xxxx
q2 – xxxx
q4 – xxx
q5 – xx
q6 –x
q7 –
2
Machine Translated by Google
q0 q1 q2 q4 q5 q6 q7
q0 – xx ÿ xxx
q1 – xxxx ÿ
q2 – xxxx
q4 – xxx
q5 – xx
q6 –x
–
q7
The states q0, q4 and q1, q7 are merged, all others remain separate.
x)
(3+1+1=5 points)
Enter the shortest possible words in the following table that can be used to separate the corresponding states:
For example, q0 and q3 can be replaced by the word ” a" since ÿ ÿ (q0, a) ÿÿ F and ÿ ÿ (q0, a) ÿ F.
You write ”—“ into the table if the states are not separable.
3
Machine Translated by Google
q0 q1 q2 q3 q4 q5 q6 q7
q0 —
—
q1
—
q2
—
q3
—
q4
—
q5
—
q6
q7
q0 q1 q2 q3 q4 q5 aaba q6 q7
q0
–
aaba a ÿ a ÿ aa
q1 aaba q2
– –
aÿ a ÿ aa
aaba
– –
aÿ a ÿ aa
q3 a a a –
ÿ aba ÿ ÿ ba ÿ a
q4 ÿ ÿ ÿ ÿ–
q5 a a a aba ÿ – ba ÿ a
q6 ÿ ÿ ÿ ÿ ÿ –ÿ
q7 aa aa aa aÿ a ÿ–
(3 points)
Task 3 (Minimal automaton for syntax diagram). In the script we have a syntax diagram for a
Decimal number with optional sign discussed.
(a) Create a DFA that recognizes the corresponding language. Use the alphabet
¨
ÿ = {+, ÿ, ÿ, z}. Here z is to be ” digit" and '*' for the decimal point (because a dot '.'
is poorly visible).
¨
(b) Explain why this is minimal by describing the states pairwise by suitable words
separate.
(c) Enter the automaton into JFLAP and let JFLAP find the minimal automaton
¨
(If you did everything correctly, the machine should not have changed except for formatting).
4
Machine Translated by Google
¨
(a) Automaton with partial transition function:
q3
–
ÿ z
q4 –ÿ
–
q5
(c) Decimal automaton after minimization. All leaves are single-element classes. Therefore, the automaton is
minimal
5
Machine Translated by Google
(d)
(2+1+1=4 points)
¨
Task 4 (proof tasks). Provide proofs for the following two statements from the lecture:
(a) On slide 76 (uniqueness of the minimal automaton) a symbol e ÿ ÿ is added in proof step (ii). The resulting word is then also
ÿ
called ue. Then a word u ÿ ÿ is used at the end, which holds for any state q ÿ Q:
¨
(a)
¨
(b) We have to show: ÿw ÿ ÿ ÿ .(ÿ ÿ (p, w) ÿ F ÿÿ ÿ ÿ (q, w) ÿ F).
ÿ
So let w ÿ ÿ be chosen arbitrarily. It remains to show: ÿ ÿ (p, w) ÿ F ÿÿ ÿ ÿ (q, w). We first show ÿ ÿ (p, w) ÿ F ÿ ÿ ÿ (q, w). (The
reverse direction “ ” works analogously.) ÿ
¨
We therefore assume ÿ ÿ (p, w) ÿ F and must show ÿ ÿ (q, w) ÿ F. To do this, we make a case distinction:
6
Machine Translated by Google
1st case: w = ÿ :
Because ÿ ÿ (p, w) = ÿ ÿ (p, ÿ) = p ÿ F, the first assumption implies: q ÿ F, so ÿ ÿ (q, w) = ÿ ÿ (q, ÿ) = q ÿ F.
2nd case: w = au :
From ÿ ÿ (p, w) = ÿ ÿ (p, au) = ÿ ÿ (ÿ(p, a), u) ÿ F, the assumption, it follows ÿ ÿ (q, w ) = ÿ ÿ (q, au) = ÿ ÿ (ÿ(q, a), u). Because ÿ(p,
a) ÿ ÿ(q, a) and because we proved ÿ ÿ (ÿ(p, a), u) ÿ F, it follows from the definition of ÿ that ÿ ÿ (ÿ(q, a ), u) ÿ F, so ÿ ÿ (q, au) = ÿ ÿ
(q, w) ÿ F.
(2+2=4 points)