You are on page 1of 1

CS602-Advance Theory of Computation

Dr. Abdus Salam


Assignment # 1
_____________________________________________________________________________________
1. Let A = {x, y, z} and B = {x, y}.
a. Is A a subset of B?
b. Is B a subset of A?
c. What is A U B?
d. What is A ∩ B?
e. What is A x B?
f. What is the power set of B?
2. If A has a elements and B has b elements, how many elements are in A x B?

3. If C is a set with c elements, how many elements are in the power set of C?

4. Let X = {I, 2, 3, 4, 5} and Y = {6, 7, 8, 9, 10}. The unary function f: X → Y and the binary function g: X x Y
→ Y are described in the following tables.

n f(n) g 6 7 8 9 10
1 6 1 10 10 10 10 10
2 7 2 7 8 9 10 6
3 6 3 7 7 8 8 9
4 7 4 9 8 7 6 10
5 6 5 6 6 6 6 6
a. What is the value of f(2)?
b. What are the range and domain of f?
c. What is the value of g(2, 10)?
d. What are the range and domain of g?
e. What is the value of g( 4, f( 4))?
5. Give five (5) valid and five (5) invalid strings for the following languages.
a) L1 = {w {a, b}* : each a in w is immediately preceded and immediately followed by a b}.
b) L2 = {w  {a, b}* : w has abab as substring}.
c) L3 = {w {a, b}* : w has neither aa nor bb as a substring}.
d) L4 = {w  {a, b}* : w has an even number of substring ab}.
e) L5 = {w  {a, b}* : w has both ab & ba as substrings}.
f) L6 = {w  {a, b}* : w contains a’s and b’s and end in bb}.
g) L7 = {w {a, b}* : w contains different first and last letters. If word begins with a a, to be
accepted it must end with a b and vice versa}.
h) L8 = {w  {a, b}* : w starts with a and has odd number of a’s or starts with b and has even
number of b’s }.
i) L9 = {w  {a, b}* : w has three consecutive b’s (not necessarily at the end)}.
j) L10 = {w  {a, b}* : w contain odd number of a’s and b’s}

6. JFLAP is an application created especially for computer scientists and those who want to study various
computational problems. With this application you can to design and analyze various automata,
pushdown automata, multi-tape parsing, Turing machines, and several other types of grammars and
systems.
You are required to download and install JFLAP (or any other automata simulator) on your PCs. For all
future assignments you will be required to solve those exercises using JFLAP simulator.

You might also like