Você está na página 1de 9

www.ignousolvedassignments.

com

For More Ignou Solved Assignments Please Visit : www.ignousolvedassignments.com Connect on Facebook :
http://www.facebook.com/pages/IgnouSolvedAssignmentscom/346544145433550

Subscribe and Get Solved Assignments Direct to your Inbox :


http://feedburner.google.com/fb/a/mailverify?uri=ignousolvedassignments_com

Course Code
Course Title Assignment Number

:
: :

CS-73
Theory of Computer Science BCA (2)-73/Assignment/ 2012

Maximum Marks Last Date of Submission

: :

25 30th April, 2012/30th October, 2012

This assignment has five questions. Answer all the questions.

1)

Define the following concepts formally: (a) Finite Automata

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 the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite state machine where from each state and a given input symbol the automaton may jump into several possible next states. This distinguishes it from the deterministic finite automaton (DFA), where the next possible state is uniquely determined. Although the DFA and NFA have distinct definitions, a NFA can be translated to equivalent DFA using powerset construction, i.e., the constructed DFA and the NFA recognize the same formal language. Both types of automata recognize only regular languages.
(c) Kleene Closure of a set of expressions

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

(d) Regular Expression

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

(e) Regular Language

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) Universal Turing Machine

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

NP-hard (non-deterministic polynomial-time hard), in computational complexity theory, is a class of problems that are, informally, "at least as hard as the hardest problems in NP". A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H (i.e., L TH). In other words, L can be solved in polynomial time by an oracle machine with an oracle for H
(p) 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.
2) Show that the language L = { ap : p is positive prime integer} is not regular

(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 n

Hence, our assumption that L is regular must have been wrong. It is easy to see that the language {1p|p is eveng} is regular (just construct the appropriate DFA or use a regular expression). However what about {1p | p is a squareg} where by saying n is a square we mean that is there is an k 2 N s.t. n = k . We 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 2

_ p + p since |y| _ p < p + 2p + 1


2

www.ignousolvedassignments.com

= (p + 1) To summarize we have p < |xyyz| < (p + 1)


2 2

3)

Show that each of the following function is primitive recursive function. (a) f (m, n) = 4mn

step (a) put n=0 F(m,0)=4m*0 =z(m) =0 Step (b) put n=n+1 F(m,n+1)=4m(n+1) =4mn+4m =f(m,n)+4m=F{ f(m,n),4m} [ we know addition function is a primitive Recursive function for two parameters] Where F represences additional function.
(b) fib (n), where fib (n) is defined by fib (0) = 0 fib (1) =1 fib ( n + 2) = fib (n) + fib (n + 1) , n 0

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) Construct one grammer for each of the following languages

(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

(b) The function f (m, n) = m * n, where '*' denotes multiplication

Você também pode gostar