0% found this document useful (0 votes)
38 views65 pages

CS402 Midterm MCQs 2020 With Reference

1. A Mealy machine produces an output string that is equal in length to the input string. 2. Kleene's Theorem states that if a language can be expressed by a regular expression, then it can be accepted by a finite automaton. 3. To create a non-deterministic finite automaton (NFA) that accepts the union of languages accepted by two finite automata, a new start state is introduced that connects to the original start states with the same transitions.

Uploaded by

Zee
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)
38 views65 pages

CS402 Midterm MCQs 2020 With Reference

1. A Mealy machine produces an output string that is equal in length to the input string. 2. Kleene's Theorem states that if a language can be expressed by a regular expression, then it can be accepted by a finite automaton. 3. To create a non-deterministic finite automaton (NFA) that accepts the union of languages accepted by two finite automata, a new start state is introduced that connects to the original start states with the same transitions.

Uploaded by

Zee
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/ 65

It may be noted that in Mealy machine, the length of output string is equal to that of input string.

A pictorial representation with states and directed edges labeled by an input letter along with an output character.
If a TG has more than one start states, then introduce a new start state connecting the new state to the old
start states by the transitions labeled by Λ and make the old start states the non-start states.
Hence an FA is also called a Deterministic Finite Automaton (DFA).
Recursive definition of Regular Expression(RE)
Step 1: Every letter of Σ including Λ is a regular expression.
Step 2: If r1 and r2 are regular expressions then
(r1)
r1 r2
r1 + r2 and
r1*
are also regular expressions.
Step 3: Nothing else is a regular expression.
Kleene’s Theorem Part III
If a language can be expressed by a RE then it can be accepted by an FA as well.
NFA corresponding to Union of FAs
Method
Introduce a new start state and connect it with the states originally connected with the old start state with the
same transitions as the old start state, then remove the –ve sign of old start state. This creates non-determinism
and hence results in an NFA.
Now consider another language L3 of strings of length three or more, defined over Σ = {a,b}, and the third letter
from the right is a. As discussed by Martin, there is a straight forward method to build an FA recognizing L3 i.e. a
distinct state for every possible substring of length less then or equal to 3. It is obvious that for each length i,
i=0,1,2,3, of substring, the number of states are 2i and thus total number of states required to recognize the language
L3 are20+21+22+23 = 23+1-1=15 (using 20+21+22+…+ 2n= 2n+1-1)
It is to be noted that according to the Kleene’s theorem, if a language can be accepted by an FA, then there
exists a TG accepting that language. Since, an NFA is a TG as well, therefore there exists an NFA accepting the
language accepted by the given FA.
It may be noted that the length of output string is l more than that of input string as the initial state prints out the
extra character 1, before the input string is read.
sahir
Closure of an FA, is same as concatenation of an FA with itself,
It may be noted that corresponding to a given language there may be more than one FA accepting that language,
but for a given FA there is a unique language accepted by that FA
sahir
Method
Thus, to accommodate this situation, introduce an initial state which should be final as well
Since the language corresponding to r1+ r2 is the union of cor-
responding languages L1 and L2, consists of the
strings belonging to L1or L2 or both, therefore a final state of
FA3 must correspond to a final state of FA1 or FA2
or both.

It is to be noted that an NFA can be considered to be an intermediate


structure between FA and TG.
Two regular expressions are said to be equivalent if they generate the same language.
The language EQUAL, of strings with number of a’s equal to number of
b’s, defined over Σ={a,b}, can be
written as
{Λ ,ab,ba,aabb,abab,baba,abba,…}
Finite Automaton with output
Finite automaton discussed so far, is just associated
with the RE or the language.
There is a question whether does there exist an FA
which generates an output string corresponding to
each input
string ? The answer is yes. Such machines are
called machines with output.
There are two types of machines with output.
Moore machine and Mealy machine

You might also like