Exercises Unit3 Part2 OCW
Exercises Unit3 Part2 OCW
Exercises Unit3 Part2 OCW
Authors:
Araceli Sanchis de Miguel
Agapito Ledezma Espino
Jose A. Iglesias Martínez
Beatriz García Jiménez
Juan Manuel Alonso Weber
* Several exercises are based on the ones proposed in the following books:
Enrique Alfonseca Cubero, Manuel Alfonseca Cubero, Roberto Moriyón Salomón.
Teoría de autómatas y lenguajes formales. McGraw-Hill (2007).
Manuel Alfonseca, Justo Sancho, Miguel Martínez Orga. Teoría de lenguajes,
gramáticas y autómatas. Publicaciones R.A.E.C. (1997).
Pedro Isasi, Paloma Martínez y Daniel Borrajo. Lenguajes, Gramáticas y Autómatas.
Un enfoque práctico. Addison-Wesley (1997).
Formal Languages and Automata Theory
1. Indicate the graph of a DFA which recognizes each one of the following languages. The
alphabet is {0, 1}.
a) The language {0}
b) The language 0m1n0p ( m ≥ 0,n ≥ 0, p ≥1 )
AF 2 0 ,1
0
S C
1 1
0
1
A B
3. [Exam] We have a door with only one lock. To open it, it is necessary to use three
different keys (called a, b, and c), in a predefined order, which is following described:
If this order is not followed, then the lock is blocked (for instance, if the key a is used and
following it is introduced again).
Once the door is open, the introduction of keys in the lock (in every possible order) does
not affect the closing device (i.e. the door remains open).
Consider that the names of the different keys are symbols of an alphabet, over which a
language L whose words are the valid sequences for the opening of the door is defined.
For instance, abcbc is a word included in the language.
It is required:
1
0
q2 1
q1
0
1
0 1 q2
q0 q1
0 0,1
1
AF 3 1
1 1 0
q1 q3 q5 q7
1 0
0 0
1 1 1
q2 q4
0 q6 q8
0
0 0
DFA_1=({a,b,c},{Q0,Q1,Q2,Q3,Q4},f,Q0,Q3)
DFA_3=({a,b,c},{Q0,Q1,Q2,Q3,Q4,Q6,Q7,Q8,Q9},f,Q0,{Q7,Q8})
DFA_4=({c,f,d},{Q0,Q5,Q8,Q9,Q10,Q11,Q12},f,Q0,Q10)