0% found this document useful (0 votes)
19 views7 pages

Exercise Sheet : Philipps University of Marburg Winter Semester 2024/25

The document contains exercises for a Theoretical Computer Science course, focusing on DFA minimization, separating words, and constructing minimal automata. It includes tasks such as manually minimizing a given automaton, identifying separable states, and creating a DFA for a decimal number syntax diagram. Additionally, it requires proofs for specific statements related to automata properties.

Uploaded by

hamidrz1372
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views7 pages

Exercise Sheet : Philipps University of Marburg Winter Semester 2024/25

The document contains exercises for a Theoretical Computer Science course, focusing on DFA minimization, separating words, and constructing minimal automata. It includes tasks such as manually minimizing a given automaton, identifying separable states, and creating a DFA for a decimal number syntax diagram. Additionally, it requires proofs for specific statements related to automata properties.

Uploaded by

hamidrz1372
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Machine Translated by Google

Theoretical Computer Science Prof. Dr. H. Peter Gumm

winter semester 2024/25 Philipps University of Marburg

¨
4. Exercise sheet

Deadline: Saturday, November 16, 2024 until 10 p.m. via Ilias.

Task 1 (DFA minimization). Given the following automaton.

(a) Minimize it by manually retracing step by step (using a cross-tabulation)


how and when states are separated.

(b) Which states are merged?

(c) Draw the minimal automaton.

(a) Step: Remove unreachable states: Here: q3q8

(b) Step: Determine separability.

i) Separate terminals from non-terminals.


q0 q1 q2 q4 q5 q6 q7
q0 – x

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 –

viii) 1.5 Done

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.

ix) The minimal automaton is therefore

x)

(3+1+1=5 points)

Task 2 (Separating words). Given the following automaton:

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:

Completed with capture state to DFA:

(b) Minimal separating words


q0 q1 q2 q3 q4 q5
q0 – +z ÿ z ÿ z ÿ z
q1 –ÿzÿzÿ z

q2 ÿ ÿz ÿ

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:
¨

ÿ ÿ (q, ue) = ÿ(ÿ ÿ


(q, u), e).
¨
Explain/prove this equality.
¨
(b) On slide 54 (“Properties of ÿ”) the direction of the jerk is only indicated by the hint: ÿ ” is not explicitly proven. There is
“Case distinction w = ÿ, or w = au”. It remains to show:

From (p ÿ F ÿÿ q ÿ F) together with (ÿa ÿ ÿ.ÿ(p, a) ÿ ÿ(q, a)) follows: p ÿ q.

(a)

ÿ ÿ (q, ue) = ÿ = ÿ ÿ (q, u ÿ (e.ÿ)) (ue = u ÿ (e.ÿ)) (ÿ


ÿ ÿ
(ÿ (q, u), e.ÿ) ÿ (p, u ÿ v)) = ÿ ÿ (ÿ ÿ (p, u), v))
ÿ ÿ
=ÿ (ÿ(ÿ (q, u), e), ÿ) (def.ÿ
ÿ
= ÿ(ÿ (q, u), e) ÿ ) (ÿ ÿ (p, ÿ ) = p)

¨
(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)

You might also like