0% found this document useful (0 votes)
8 views8 pages

Automata Midterms

The document provides an introduction to automata theory, covering key concepts such as finite automata, deterministic and non-deterministic finite automata, and regular languages. It discusses the mathematical models of computation, the significance of automata in computer science, and various methods for converting finite automata to regular expressions. Additionally, it includes examples, definitions, and a quiz to test understanding of the material.
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)
8 views8 pages

Automata Midterms

The document provides an introduction to automata theory, covering key concepts such as finite automata, deterministic and non-deterministic finite automata, and regular languages. It discusses the mathematical models of computation, the significance of automata in computer science, and various methods for converting finite automata to regular expressions. Additionally, it includes examples, definitions, and a quiz to test understanding of the material.
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/ 8

INTRODUCTION TO AUTOMATA SET OF SYMBOLS

THEORY OF AUTOMATA - Σ - collection of symbols - e.g. {a, b, c}


- study of abstract computing devices, STRING
or“machines” - sequence of symbols but it is considered as
- what kind of things can you compute one element – e.g. a, b, aa, bb, ab
mechanically LANGUAGE
- deals with different properties of - set of strings
mathematical models L1
AUTOMATON - set of all strings of length 2 – e.g. {00, 01, 10}
2
- abstract model computing machine L
- plural: automata - set of all strings of length 3 – e.g. {000, 111}
3
- self-making machine L
FINITE AUTOMATION - set of all strings that begin with 0 – e.g. {0, 01}
- used in text processing, compilers, and Powers of Σ
hardware design - e.g. Σ = {0, 1}
CONTEXT-FREE GRAMMAR - Σn - set of all strings of length n
- used in programming languages and AI - Σ0 - set of all strings of length 0 - Σ0 = {ε}
WHY STUDY AUTOMATA THEORY (epsilon, means empty)
➢ Theory provides concepts and principles CARDINALITY
➢ Theory is relevant to discipline - numbers of elements in a set.
➢ Help computer scientists understand how - Σn = 2n
machines compute functions and solve problems LENGTH OF STRING
➢ Make function to be defined as computable - number of symbols present in a string
FINITE STATE MACHINES AND FINITE AUTOMATA - denoted as |S|
FINITE STATE SYSTEM - if |S| = 0 , then it is called an empty string,
- mathematical model of a system with denoted as ε or λ
discrete inputs and outputs TYPES OF FINITE AUTOMATA
- a system can be in any one of a finite number DETERMINISTIC FINITE AUTOMATA
of states - fixed number of states and only one state at
- the states summarize the information a time
concerning past inputs that is needed to - single state after reading any sequence of
determine the behavior on subsequent inputs inputs
FINITE STATE MACHINE PREREQUISITE - simplest model of computation
SYMBOL - on each input, there is one and only one state
- a, b, c, 0, 1 to which automaton can transition from its
- used for input current state

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


- has limited memory o Σ = input symbol
- can be specified by 5 tuples (Q, Σ, δ, s, F) o δ = transition function: Q x Σ -> 2^Q (in
where: every state (Q), there is an input
o Q = state symbol symbol (Σ), that goes to 2 to the power
o Σ = input symbol of Q)
o δ = transition function: Q x Σ -> Q (in o s = start state
every state (Q), there is an input o F = set of final state/states of (F ⊆ Q)
symbol (Σ), that goes only to one
state) EXAMPLE OF NDFA:
o s = start state L = {w : w starts and ends with an ‘a’ ; w ∈ Σ*}
o F = set of final state/states of (F ⊆ Q) Σ = {a, b}

EXAMPLE OF DFA:
L = {w : w starts and ends with an ‘a’ ; w ∈ {a, b}}
read as “L is the set of elements w, such that w
starts and ends with an a, where w is an element
of a and b”
DIFFERENCE OF DFA AND NDFA
ACCEPTED INPUTS: aa, aba, abbababaa... DFA NDFA
INVALID INPUTS: ba, abab, abbb… Single transition for each Allows multiple transition
input for each input
Empty string transitions Permits empty string
are not seen transition
Allows backtracking Backtracking not
applicable
Requires more space Requires less space
String is accepted if it At least one of all possible
NON-DETERMINISTIC FINITE AUTOMATA (NDFA) transits to final state transitions transits to final
- fixed number of states, but there could be state is accepted
multiple next states
- the next state may be chosen at random GRAPHICAL REPRESENTATION
- all the next states may be chosen in parallel VERTICES/NODES
- for each state there can be zero or more - represent states
transitions corresponding to a particular ARCS WITH LABEL
symbol - transitions
- can be specified by 5 tuples (Q, Σ, δ, s, F) EMPTY SINGLE INCOMING ARC
where: - initial state

o Q = state symbol DOUBLE CIRCLE


- final state

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


DEAD STATE - x* means zero or more occurrence of x
- filter out invalid strings - x+ means one or more occurrence of x
FINITE AUTOMATA WITH EPSILON MOVES REGULAR LANGUAGES
NFA WITH ε MOVES - languages accepted by some regular
- δ = Q x (Σ U ε) → 2Q expressions
- epsilon (ε) - empty string OPERATORS IN REGULAR EXPRESSION AND
- in case of epsilon move, we have the union of REGULAR LANGUAGE
epsilon UNION
UNION OF EPSILON - R1 | R2, R1 U R2, R1 + R2
- any state that is getting a particular input - L(R1 | R2) = L(R1) U L(R2)
could go to the power of Q states, or it could - example: R1 = {ab, d} and R2 = {m, np}
also go to no states R1 U R2 = {ab, d, m, np}

EXAMPLE OF NFA – ε:
Finite Automata:

q1 on getting epsilon means that q1 on seeing


empty value could still go to q2
Note: every state on epsilon goes to itself, which CONCATENATION
means that, for example, even if the q2 state does - R1R2 or R1.R2
not have any epsilon, q2 on getting epsilon goes to - L(R1R2) = L(R1) concatenated with L(R2)
itself. - example: R1 = {ab, d} and R2 = {m, np}
R1R2 = {abm, abnp, dm, dnp}

ε - CLOSURE
Finite Automata:
- all the states reachable from a particular
state in following ε-transitions only by seeing
the ε symbol
REGULAR EXPRESSION AND REGULAR
LANGUAGE
KLEENE CLOSURE
REGULAR EXPRESSIONS
- simple expressions describing the languages - R1*

accepted by finite automata - L(R1*) = ε U L(R1) U L(R1R1) U L(R1R1R1) U …

- sequence of pattern that defines a string - example: R1 = {ab, d} and R2 = {m, np}
R1* = { ε, ab, d, abd, dab,abab, …}
- used to match character combinations in
strings

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


Finite Automata: METHODS IN CONVERTING FINITE AUTOMATA TO
REGULAR EXPRESSION
➢ Transitive Closure Method
➢ State Elimination Method
➢ Arden’s Theorem
FINITE AUTOMATA WITH OUTPUT
CONVERSION OF FINITE AUTOMATA DIAGRAM - there will be no final states
TO REGULAR EXPRESSION USING TRANSITIVE - can be specified by 6 tuples: (Q, Σ, δ, q0, Δ , λ),
CLOSURE METHOD
where:
o Q = finite set of states
o Σ = input symbols
o δ = transition function, δ = Q x Σ → Q
o q0 = initial state
o Δ = output symbols
o λ = output function
MOORE MACHINE
- the output symbol is associated with the
Basis: K = 0 states
➢ if i = j, - λ: Q → Δ
o there is an epsilon - “/” or “,” to represent the output symbol
o if there is no transition, Rij(0) = ø - the ouput might be n + 1
o if there is one transition, Rij(0) =a - most of the time, have longer length of
o if there are more than one transition, characters and number of states than mealy
Rij(0) = a1 + a2 + a3 + … - the next state is decided by the current state
➢ if i ≠ j, and current input symbol
o there is no epsilon - can create a state without output symbol
o if there is no transition, Rij(0) = ø MEALY MACHINE
o if there is one transition, ε + a - the output symbol is associated with the
o if there are more than one transition, transition
Rij(0) = ε + a1 + a2 + a3 + … - λ: QxΣ → Δ
Basis: K > 0
- Rij(k) = Rij(k-1) + Rik(k-1) (Rkk(k-1))* Rkj(k-1)
Rij(k)
- i = initial state
- j = final state
- k = total number of state

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


QUIZ 1 b. δ (0, n) = m
1. Which of the following is correct? c. δ (m, 1) = n
Statement 1: ε represents a single string in the set. d. All of the mentioned
Statement 2: Ф represents the language that 5. Given: ∑= {a, b}
consist of no string L= {x ϵ ∑* | x is a string combination}
Σ^4 (Sigma power of 4) represents which among
a. Statement 1 and 2 both are correct the following?
b. Statement 1 is false but 2 is correct
c. Statement 1 and 2 both are false a. {aa, ab, ba, bb}
d. There is no difference between both the b. {aaa, aab, aba, bbb…}
statements, ε and Ф are different notation for c. {aaaa, abab, ε, abaa, aabb…}
same reason d. All of the mentioned
2. Which of the following statements makes the 6. Which language is accepted by the following
correct combination? DFA?
Statement 1: A Finite automaton can be
represented graphically
Statement 2: The nodes can be its states
Statement 3: The edges or arcs can be used for
transitions

a. Statement 1 is false but Statement 2 and 3 are


correct a. x is a string such that it ends with ‘101’
b. Statement 1 and 2 are correct while 3 is wrong b. x is a string such that it ends with ‘01’
c. None of the mentioned statements are c. x is a string such that it has odd 1’s and even
correct 0’s
d. All of the mentioned d. x is a string such that it has starting and
3. Which of the following is not part of 5-tuple finite ending character as 1
automata? 7. Which of the following will not be accepted by
the following DFA?
a. Transition Function
b. Output Alphabet
c. Initial State
d. Input Alphabet
4. For the following change of state in FA, which of
a. ababaabaa
the following codes is an incorrect option?
b. abbbaa
Q = {m, n}
c. abbbaabb
Σ = {0, 1}
d. abbaabbaa
a. δ (m,0) = Φ

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


8. Which of the following will not be accepted by 12. Which of the following represents a language
the following DFA? which has no pair of consecutive 1’s if Σ = {0,1}?

a. (0+10) *(1+ε)*
b. (0+101) *(0+ε)
c. (1+010)*(1+ε)
d. (0+10)*(1+ε)
13. The finite automata accept the following
languages:

a. 11010 a. Context Sensitive Languages


b. 10001010 b. Context Free Languages
c. ε c. Regular Languages
d. String of letter count 11 d. All the mentioned
9. Which of the following is not an example of finite 14. Which of the following regular expressions
state machine system? represents the set of strings which do not
contain a substring “rt” if: Σ = {r, t}
a. Control Mechanism of an Elevator
b. Combinational Locks a. (rt)*
c. Traffic Lights b. (tr)*
d. Digital Watches c. (r*t*)
10. The password to the admin account = d. (t*r*)
”administrator”. The total number of states 15. According to the given transitions below, which
required to make a password-pass system among the following are the epsilon closures of
using DFA would be what? q1 for the given NFA?
δ (q1, ε) = {q2, q3, q4}
a. 13 states δ (q4, 1) = q1
b. 12 states δ (q1, ε) = q1
c. 14 states
d. A password pass system cannot be created a. q4
using DFA b. q1, q2, q3, q4
11. Which of the following accurately portrays the c. q1
connection between the Regular Expression ‘R’ d. q2, q3, q4
and the corresponding language ‘L’? 16. An NFA can be modified to allow transition
without input alphabets, along with one or
a. L(R), R(L) more transitions on input symbols
b. R, L(R)
c. R, R(L) a. True
d. All of the mentioned b. False

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


17. For NFA with ε-moves, which among the 22. Which of the following options is correct?
following is correct? Statement 1: Initial State of NFA is Initial State
of DFA
a. δ: Q x (Σ U ε) -> Q^2 Statement 2: The final state of DFA will be every
b. δ: Q x (Σ ε) -> Q^1 combination of final state of NFA
c. δ: Q x (Σ U ε) -> 2^Q
d. δ: Q x (Σ U ε) -> Q2 a. Statement 1 is true and Statement 2 is false
18. The ε-NFA recognizable languages are not b. Statement 1 is true and Statement 2 is true
closed under: c. Statement 1 can be true and Statement 2 is
true
a. Union d. Statement 1 is false and Statement 2 is also
b. Negation false
c. Kleene Closure 23. Which of the following option is correct?
d. None of the mentioned
19. Mon is asked to make an automaton which a. NFA is slower to process and its
accepts a given string for all the occurrence of representation uses more memory than
“1001” in it. How many transitions would Mon DFA
use such that, the string processing application b. NFA is slower to process and its
works? representation uses more memory than
DFA
a. 9 c. NFA is slower to process and its
b. 11 representation uses less memory than DFA
c. 12 d. DFA is slower to process and its
d. 15 representation uses less memory than NFA
20. Which is the transition function of DFA 24. Which of the following does not represents the
given language? L1 = {0, 01}
a. Q x Σ -> Q
b. Q x Q -> Σ a. 0+01
c. Σ x Σ -> Q b. {0} U {01}
d. Σ x Q -> Σ c. {0} U {0}{1}
21. What is wrong in the given definition? d. {0} ^ {01}
Def: ({q0, q1, q2}, {0,1}, δ, q3, {q3}) 25. The total number of states (including the
dead/trap state) required to automate the
a. The definition does not satisfy 5 Tuple given regular expression: (00)*(11)*
definition of NFA
b. There are no transition definition a. 3
c. Initial and Final states do not belong to the b. 4
Graph c. 5
d. Initial and final states can’t be same d. 6

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)


26. Which property makes NFA seemingly more
flexible than DFA?

a. NFA has multiple start states


b. NFA can transition on an empty string
c. NFA has a larger alphabet set
d. NFA always has fewer final states than DFA
27. (0+ε) (1+ε) represents

a. {0, 1, ε}
b. {0, 1, 01 ,11, 00, 10, ε}
c. {0, 1, 01, ε}
d. {0, 1}
28. The minimum number of states required to
automate the following Regular Expression: (1)*
(01+10) (1)*

a. 4
b. 3
c. 2
d. 5
29. Regular Expression denote precisely the
________ of Regular Language

a. Power Set
b. Class
c. Super Sweet
d. None of the mentioned

NICOLE MARCELLANA | BSCS 3-1N (2023 - 2024)

You might also like