Sie sind auf Seite 1von 8

CS-73 Ignou solved Assignment 2012 Theory Of Computer Science

Find me on facebook http://facebook.com/yagnesh.shenoy

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".
(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.

(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

(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., LTH). 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:AssumeLwouldberegular.Wewillshowthatthisleadstocontradiction usingthepumpinglemma. Nowbythepumpinglemmathereisannsuchthatwecanspliteachwordwhich

islongerthannsuchthatthepropertiesgivenbythepumpinglemmahold.Consider 0p,1p, 2L,thisiscertainlylongerthann.Wehavethatxyz=0p,1p andweknowthat|xy| _n,henceycanonlycontain0s,andsincey6=_itmustcontainatleastone0.Now accordingtothepumpinglemmaxy z2Lbutthiscannotbethecasebecauseitcontains atleastone0lessbutthesamenumberof1sas0 1 .


0 n n

Hence,ourassumptionthatLisregularmusthavebeenwrong. Itiseasytoseethatthelanguage {1p |piseveng} isregular(justconstructtheappropriateDFAorusearegularexpression). Howeverwhatabout {1p|pisasquareg}

wherebysayingnisasquarewemeanthatisthereisank2Ns.t.n=k .We maytryaswelikethereisnowayto_ndoutwhetherwehaveagotasquare numberof1sbyonlyusing_nitememory.Andindeed: Theorem4.3ThelanguageL={1p|nisasquaregisnotregular.}


2

Proof:Weapplythesamestrategyasabove.AssumeLisregularthenthereis anumbernsuchwecansplitalllongerwordsaccordingtothepumpinglemma. Let'stakew=1p thisiscertainlylongenough.Bythepumpinglemmawe knowthatwecansplitw=xyzs.t.theconditionsofthepumpinglemmahold. Inparticularweknowthat 1_|y|_|xy|_p Usingthe3rdconditionweknowthat xyyz2L thatis|xyyz|isasquare.Howeverweknowthat p =|w| =|xyz| <|xyyz|since1_|y|=|xyz|+|y| _p +psince|y|_p <p +2p+1
2 2 2

=(p+1) Tosummarizewehave 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 }

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 }

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

Das könnte Ihnen auch gefallen