Vous êtes sur la page 1sur 2

CS301: Theory of Automata

Assignment # 1

Due on Thursday, 27th Sept, 2018, in the start of the class


Late submissions shall be heavily penalized. Plagiarism gets minimum zero and
maximum of F in the course.

QUESTION NO. 1: Solve the following:


I. Show that the following is recursive definition of the set EVEN.
Rule 1: 2 and 4 are in EVEN.
Rule 2: If x is in EVEN, then so is x + 4.

II. Using the fact that

3x^2 + 7x - 9 = (((((3) x) + 7) x) - 9)

Show how to produce this polynomial from the rules for POLYNOMIAL using
multiplication only twice.
The set POLYNOMIAL is defined by these four rules:
Rule 1: Any number is in POLYNOMIAL.
Rule 2: The variable x is in POLYNOMIAL.
Rule 3: If p and q are in POLYNOMIAL, then so are p + q and (p) and pq.
Rule 4: POLYNOMIAL contains only those things which can be created by the
three rules above.

III. The recursive definition for PALINDROME wrote by student over the alphabet I = {a, b}:
Rule 1: a and b are in PALINDROME
Rule 2: If x is in PALINDROME, then so are axa and bxb
Unfortunately all of the words in the language defined above have an odd length and so
it is not all of PALINDROME. Fix this problem.

IV. Give two recursive definitions for the set POWERS-OF-TWO = {1 2 4 8 16 . . . }


Use one of them to prove that the product of two powers of two is also a power of two.

V. (i) Consider the following recursive definition of 3-PERMUTATION


(a) 123 is a 3-PERMUTATION
(b) if xyz is a 3-PERMUTATION then so are zyx and yzx.
Show that there are six different 3-PERMUTATIONs

(ii) Consider the following recursive definition of 4-PERMUTATION


(a) 1234 is a 4-PERMUTATION
(b) if xyzw is a 4-PERMUTATION then so are wzyx and yzwx.
How many 4-PERMUTATION’s are there (by this definition)?

QUESTION NO. 2: Write the regular expression for following:


I. Language T defined over T= {a,b}, Let V be the language of all strings of a’s and b’s
in which the strings are either all b’s or all a’s.
II. A language T defined over T= {a,b}, having all words in which a appears tripled, if at
all. This means that every clump of a’s contains 3 or 6 or 9 or 12... a’s.
III. A language T defined over T= {a,b}, having all strings that do not have substring
“bba”.
IV. The set B of all strings defined over T= {a,b}with at most one pair of consecutive a’s
and at most one pair of consecutive b’s.
V. The set A of binary strings defined over T= {0,1}which have no substring 001.
VI. Let us reconsider the regular expression (a + b)*a(a + b)*b(a + b)*
1) Show that this is equivalent to (a + b)*ab(a + b)* in the sense that they define the
same language.
2) Show that (a + b)*ab(a +b)* + b*a* = (a + b)*

QUESTION NO. 3: Design FAs for the following:


I. Build a new FA that accepts only the word A.
II. Build an FA that accepts only those words that do not end with “ba”.
III. Build an FA that accepts only those words that have even no. of “a’s” and even
number of “b’s”.
IV. Write regular expressions and build a finite automata for language contains all the
words having even number of a’s?
V. Write regular expressions and finite automata for language that starts with “aa”,
ends at “bb” and fourth character should be “b”
VI. Build transition Graph that accepts the language of all words in which the a’s
occur only in even clumps and that end in three or more b’s.
VII. FA accepts all strings without a double b.

GOOD LUCK! :)

Vous aimerez peut-être aussi