0% found this document useful (0 votes)
7 views2 pages

Exercise - 3

exercise

Uploaded by

siambasher0009
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)
7 views2 pages

Exercise - 3

exercise

Uploaded by

siambasher0009
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/ 2

CSE 3101(Theory of Computation)

1. Design a NFA for the following language over the alphabet {0,1}:
“Accepts all strings that contain two 0’s separated by a substring whose
length is a multiple of 3”.
2. Is the class of languages recognized by NFAs closed under complement?
Explain your answer.
3. Show by giving an example that, if M is an NFA that recognizes language C,
swapping the accept and non-accept states in M doesn’t necessarily yield a
new NFA that recognizes C complement.
4. Suppose we define a restricted version of the Java programming language in
which variable names must satisfy all of the following conditions:
• A variable name can only use Roman letters (i.e., a, b, . . . , z,
A, B, . . . , Z) or Arabic numerals (i.e., 0, 1, 2, . . . , 9); i.e.,
underscore and dollar sign are not allowed.
• A variable name must start with a Roman letter: a, b, . . . , z, A,
B, . . . , Z
• The length of a variable name must be no greater than 8.
• A variable name cannot be a keyword (e.g., if). The set of
keywords is finite.
Let L be the set of all valid variable names in our restricted version of Java.
Let L0 be the set of strings satisfying the first 3 conditions above; i.e., we do
not require the last condition. Give a regular expression for L0.
5. Let Σm = {a1, . . . , am} be an alphabet containing m elements, for some
integer m ≥ 1. Let Lm be the following language: “Accepts all strings in
which at least one ai occurs an even number of times (not necessarily
consecutively), where 1 ≤ i ≤ m”. Construct an NFA for the language L2.
6. Prove that, for any NFA N there is a DFA D, such that L(D) = L(N), and
vice versa.
7. Prove that "If L = L(A) for some DFA A, then there is an Regular
Expression R such that L = L(R)."
8. Consider machine D1. Apply the Myhill-Nerode theorem using Table-1 to
minimize D1 and then convert it to a regular expression. Table-1 represents
the marking of all pairs of states (P, Q) where P∈ F and Q∉ F for the given
D1.
A B C D
State 0 1
A B C B 0
B B D C 0 0
C B C
D 0 0 0
D B E
E B C E 1 1 1 1
D-1
Table-1

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy