Professional Documents
Culture Documents
CS-73 Solved Assignment 2012
CS-73 Solved Assignment 2012
com
Course Code
CS-73
Course Title
Assignment Number
Maximum Marks
Last Date of Submission
:
:
25
30th April, 2012/30th October, 2012
1)
An automaton with a set of states, and its "control" moves from state to state in response to
external "inputs" is called a finite automaton. A finite automaton, FA, provides the simplest
model of a computing device. It has a central processor of finite capacity and it is based on the
concept of state. It can also be given a formal mathematical definition. Finite automata are used
for pattern matching in text editors, for compiler lexical analysis.
(b) Non-Deterministic Finite Automata (NDFA)
In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene
closure) is a unary operation, either on sets of strings or on sets of symbols or characters. The
application of the Kleene star to a set V is written as V*. It is widely used for regular expressions,
which is the context in which it was introduced to characterize certain automata, where it means
"zero or more".
www.ignousolvedassignments.com
In computing, a regular expression provides a concise and flexible means to "match" (specify
and recognize) strings of text, such as particular characters, words, or patterns of characters.
Abbreviations for "regular expression" include "regex" and "regexp". The concept of regular
expressions was first popularized by utilities provided by UNIX distributions, in particular the
editored and the filter grep. regular expression is written in a formal language that can be
interpreted by a regular expression processor, which is a program that either serves as a parser
generator or examines text and identifies parts that match the provided specification.
www.ignousolvedassignments.com
In theoretical computer science and formal language theory, a regular language is a formal
language that can be expressed using a regular expression. Note that the "regular expression"
features provided with many programming languages are augmented with features that make
them capable of recognizing languages that cannot be expressed by the formal regular
expressions
(f) Primitive Recursive Function
In computability theory, primitive recursive functions are a class of functions that form an
important building block on the way to a full formalization of computability. These functions are
also important in proof theory.
Most of the functions normally studied in number theory are primitive recursive. For example:
addition, division, factorial, exponential and the nth prime are all primitive recursive. So are
many approximations to real-valued functions. In fact, it is difficult to devise a computable
function that is not primitive recursive, although some are known (see the section on Limitations
below). The set of primitive recursive functions is known as PR in complexity theory.
(g) Unsolvable Problem
A computational problem that cannot be solved by a Turing machine. The associated function is
called an incomputable function.
(h) Turing Machine
A Turing machine is a device that manipulates symbols on a strip of tape according to a table of
rules. Despite its simplicity, a Turing machine can be adapted to simulate the logic of any
computer algorithm, and is particularly useful in explaining the functions of a CPU inside a
computer.
(i)
In computer science, a universal Turing machine (UTM) is a Turing machine that can simulate
an arbitrary Turing machine on arbitrary input. The universal machine essentially achieves this
by reading both the description of the machine to be simulated as well as the input thereof from
its own tape
(j) Turing-Decidable Problem
www.ignousolvedassignments.com
(k) Moore Automata
In the theory of computation, a Moore machine is a finite-state machine, whose output values
are determined solely by its current state.
(l) Context-free Language
In formal language theory, a context-free language is a language generated by some contextfree grammar. The set of all context-free languages is identical to the set of languages accepted
by pushdown automata.
(m) Pushdown Automata
In automata theory, a pushdown automaton (PDA) is a variation of finite automaton that can
make use of a stack containing data.
(n) Halting Problem
In computability theory, the halting problem can be stated as follows: Given a description of an
arbitrary computer program, decide whether the program finishes running or continues to run
forever. This is equivalent to the problem of deciding, given a program and an input, whether the
program will eventually halt when run with that input, or will run forever.
(o) NP-Hard Problem
In formal language theory, a context-free language is a language generated by some contextfree grammar. The set of all context-free languages is identical to the set of languages accepted
by pushdown automata.
2)
(2 marks)
Answer:
.
Proof: Assume L would be regular. We will show that this leads to contradiction
using the pumping lemma.
Now by the pumping lemma there is an n such that we can split each word which
www.ignousolvedassignments.com
is longer than n such that the properties given by the pumping lemma hold. Consider
0p,1p,2 L, this is certainly longer than n. We have that xyz = 0p,1p and we know that |xy|
_ n, hence y can only contain 0s, and since y 6 = _ it must contain at least one 0. Now
according to the pumping lemma xy z 2 L but this cannot be the case because it contains
at least one 0 less but the same number of 1s as 0 1 .
n
may try as we like there is no way to _nd out whether we have a got a square
number of 1s by only using _nite memory. And indeed:
Theorem 4.3 The language L = {1p| n is a squareg is not regular.}
Proof: We apply the same strategy as above. Assume L is regular then there is
a number n such we can split all longer words according to the pumping lemma.
Let's take w = 1p
this is certainly long enough. By the pumping lemma we
know that we can split w = xyz s.t. the conditions of the pumping lemma hold.
In particular we know that
1 _ |y| _ |xy| _ p
Using the 3rd condition we know that
xyyz 2 L
that is |xyyz| is a square. However we know that
p = |w|
= |xyz|
< |xyyz| since 1 _ |y| = |xyz| + |y|
2
_ p + p since |y| _ p
< p + 2p + 1
2
www.ignousolvedassignments.com
= (p + 1)
To summarize we have
p < |xyyz| < (p + 1)
2
3)
step (a)
put n=0
F(m,0)=(5m)2*0
=(5m)0
=1
=S(Z(m))
Step (b)
put n=n+1
F(m,n+1) = (5m)2(n+1)
=(5m)2n * (5m)2n
=f(m,n) * (5m)2n
In the last question we already prove that the multiplication is a primitive
Recursive function for two parameters , so that
F(m,n)=(5m)2n is also a primitive recursive function
4)
(a) { ai bj ck | i = 2 j or j = 2k }
www.ignousolvedassignments.com
Construct it yourself
(b) { w { 0, 1}* :
w = wR}
Construct it yourself
5) Construct one Turing Machine for computing each of the following
(a) The language { 0n 1n : n 1 }
www.ignousolvedassignments.com