You are on page 1of 2

FAST NATIONAL UNIVERSITY OF COMPUTER AND

EMERGING SCIENCE CHINIOT FAISALABAD CAMPUS

ASSIGNMENT No. 01
SUBJECT: THEORY OF AUTOMATA
SECTION 5D
_________________________________________
Q#1
Give recursive definitions for the following languages over the alphabet {a,b}:
1. The language NOTAA of all words not containing the substring aa.
2. Write recursive definition of factorial.
3. The language AA of all words containing the substring aa.
4. The language EVENSTRING of all words of even length.
5. Consider the following recursive definition of 3-PERMUTATION
1. 123 is a 3-PERMUTATION
2. if xyz is a 3-PERMUTATION then so are zyx and yzx Show that there are six different 3-
PERMUTATION's.
6. Consider the following recursive definition of 4-PERMUTATION
1. 1234 is a 4-PERMUTATION
2. if xyzw is a 4-PERMUTATION then so are wzyx and yzwx
How many 4-PERMUTATION's are there (by this definition)?
7. The language ODDSTRING of all words of odd length
3!
8. Prove that 𝑖𝑠 𝑖𝑛 𝑓𝑎𝑐𝑡𝑜𝑟𝑖𝑎𝑙 𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑖𝑜𝑛
5!∗(3−4)!

Q#2
Write a regular expressions to describe each of the following languages
1. Language that doesn’t contain substring aba.
2. {w  {a, b}* : w contains exactly two consecutive a}.
3. {w  {a, b}* : w contains no more than two occurrences of the substring aa}.
4. All the strings in L1 have the none or double letter of a and many b’s.
5. {w  {0-9}* : w represents the decimal encoding of an odd natural number without leading 0’s
L1 – L2, where L1 = a*b*c* and L2 = c*b*a*.
6. String that has at least three number a’s or at most 1 number of b’s.t least two a’s.
7. {w  {a, b}* : w has both aa and aba as substrings}.
8. {w  {a, b}* : w starts and ends on different alphabet}.
9. {w  {0, 1}* : w contains 01 but does not contain the 010 as a substring}.
10. {w  {a, b}* : w contains ab but does not end with aba}.
11. All the words over {0,1} that doesn’t end with 01
12. All the strings in L1 have the same number of a’s and b’s.
13. All strings of length < 3.
14. All the words that doesn’t contains substring 011
15. All words with b as a third letter.
16. {w  {0, 1}* : 3rd last element must be 1}.
FAST NATIONAL UNIVERSITY OF COMPUTER AND
EMERGING SCIENCE CHINIOT FAISALABAD CAMPUS

17. All strings in which any b's that occur are found in clumps of an odd number at a time, such as
abaabbbab.
18. All strings that have an even number of a's and an odd number of b's.
19. All strings that have an odd number of a's and an odd number of b's.
20. All words that begin or end with triple letter.

Q#3
Write statement / language of following regular expression. Also draw the Finite Automata of the
following;
1. (0 + 1)*(010 + 0010)
2. (aa)*(bb)*b
3. (1*(1*01*01*01*)*1*)
4. (a + b)* bbb (a +b)*
5. ((0+1)*1(0+1)*0(0+1)*1(0+1)*)
6. (a+b)*a(a+b)*b(a+b)
7. (aa + ab + ba + bb)*
8. ((0+1)*101(0+1)*)
9. (b + c)* (λ + a) (b + c)* (λ + a) (b + c)* (λ + a) (b + c)*

Q#4 Let S = {ab, bb} and let T = {ab, bb, bbbb}. Show that S* = T*.
Q#5 Consider the language S*, where S = {aa aba baa}. Show that the words aabaa, baaabaaa, and
baaaaababaaaa are all in this language.
Q#6 When Σ= {a, b, c} Provide the regular expressions of the following:
i. the second last symbol of language L is not 'a'.
ii. contains at least two a's and at most one b.
iii. all strings which begins with a and ends with b and not contains substring "bb".

SUBMISSION GUIDELINES
1. Assignment must be submitted in hard form (Hand Written) within due date.
2. Plagiarism is not allowed. In case of pledge you will score zero marks.
3. Don’t submit your assignment after deadline.
4. Don’t copy from any other source.
5. Its individual submission.
6. The deadline for this assignment is September 18, 2023.

You might also like