First Term, Academic Year
2024/2025 ﺍ ﻻ ﺳﻡ
Theory of Computations
ﺍﻟﺭﻗﻡ
SHHET-1
ﺍﻟﺘﺨﺼﺺ
First: Choose the correct answer
1. Suppose L1 = {10, 1} and L2 = {011, 11}. How many distinct elements are there in L= L1 L2.
(a) 4 (b) 3
(c) 2 (d) None of these
2. The study of how efficiently a computer can solve a problem.
a.automata b.set c.complexity d.computability
3. Formal Languages is the Study of “strings of symbols,” including their :
A) descriptions. B) properties. C) Physical State. D) Both A and B.
4. Consider the language L = {w ∈ {a, b : ∈ ∈ {a, b w=a a . hich word is not acce ted by
L?
a) a B) aba c) ϵ d) aaa
5. One of the applications of Regular languages is ----
a) Pattern matching b) Compiler Design c) Language processing d) Artificial intelligence
6. Study of problem solving capabilities of computational models is the definition of –
automata set graph Computability
7. Among the Fields Related to Computation based on formal languages
Compiling theory Switching circuit theory
Algorithm analysis Neural networks
8. List some Applications of Theory of Computation in Artificial Intelligence
document description language design computer design
Protocol modeling and verification Expert system design
1
-
- -
2.3 Exercises
1) Consider the language L = {1n2n : n > 0}. Is the string 122 in L?
2) Let L1 = {anbn : n > 0}. Let L2 = {cn : n > 0}. For each of the following strings, state whether or not it is an
element of L1L2:
a) .
b) aabbcc.
c) abbcc.
d) aabbcccc.
3) Let L1 = {peach, apple, cherry} and L2 = {pie, cobbler, }. List the elements of L1L2 in lexicographic
order.
4) Let L = {w {a, b}* : |w| 3 0}. List the first six elements in a lexicographic enumeration of L. (See page 571
for the definintion of 3.)
5) Consider the language L of all strings drawn from the alphabet {a, b} with at least two different substrings of
length 2.
a) Describe L by writing a sentence of the form L = {w * : P(w)}, where is a set of symbols and P is a
first-order logic formula. You may use the function |s| to return the length of s. You may use all the standard
relational symbols (e.g., =, , <, etc.), plus the predicate Substr(s, t), which is True iff s is a substring of t.
b) List the first six elements of a lexicographic enumeration of L.
6) For each of the following languages L, give a simple English description . Show two strings that are in L and two
that are not (unless there are fewer than two strings in L or two not in L, in which case show as many as possible).
a) L = {w {a, b}* : exactly one prefix of w ends in a}.
b) L = {w {a, b}* : all prefixes of w end in a}.
c) L = {w {a, b}* : x {a, b}+ (w = axa)}.
7) Are the following sets closed under the following operations? If not, what are their respective closures?
a) The language {a, b} under concatenation.
b) The odd length strings over the alphabet {a, b} under Kleene star.
c) L = {w {a, b}*} under reverse.
d) L = {w {a, b}* : w starts with a} under reverse.
e) L = {w {a, b}* : w ends in a} under concatenation.
8) For each of the following statements, state whether it is True or False. Prove your answer.
a) L1, L2 (L1 = L2 iff L1* = L2*).
b) ( *) ( – (*)) = (where is the complement of ).
Chapter 2 14 Languages and Strings
c) Every infinite language is the complement of a finite language.
d) L ((LR)R = L).
e) L1, L2 ((L1 L2)* = L1* L2*).
f) L1, L2 ((L1*L2*L1*)* = (L2 L1)*).
g) L1, L2 ((L1 L2)* = L1* L2*).
h) L1, L2, L3 ((L1 L2) L3 = (L1 L3) (L2 L3)).
i) L1, L2, L3 ((L1 L2) L3 = (L1 L3) (L2 L3)).
j) L ((L+)* = L*).
k) L (L* = {}).
l) L ( L+ = L*).
m) L1, L2 ((L1 L2)* = (L2 L1)*).
Chapter 2 15 Languages and Strings