Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

CS-73 Ignou solved Assignment 2012 Theory Of Computer Science

ind me on f!ce"oo# http$%%f!ce"oo#&com%y!gnesh&shenoy

1)

Define the following concepts formally: (a) Finite Automata

An !utom!ton 'ith ! set of st!tes( !nd its )control* moves from st!te to st!te in response to e+tern!l )inputs* is c!lled ! finite !utom!ton& A finite !utom!ton( A( provides the simplest model of ! computing device& It h!s ! centr!l processor of finite c!p!city !nd it is "!sed on the concept of st!te& It c!n !lso "e given ! form!l m!them!tic!l definition& inite !utom!t! !re used for p!ttern m!tching in te+t editors( for compiler le+ic!l !n!lysis&
(b) Non-Deterministic Finite Automata (NDFA)

In the !utom!t! theory( ! nondeterministic finite !utom!ton ,- A. or nondeterministic finite st!te m!chine is ! finite st!te m!chine 'here from e!ch st!te !nd ! given input sym"ol the !utom!ton m!y /ump into sever!l possi"le ne+t st!tes& This distinguishes it from the deterministic finite !utom!ton ,0 A.( 'here the ne+t possi"le st!te is uni1uely determined& Although the 0 A !nd - A h!ve distinct definitions( ! - A c!n "e tr!nsl!ted to e1uiv!lent 0 A using po'erset construction( i&e&( the constructed 0 A !nd the - A recogni2e the s!me form!l l!ngu!ge& 3oth types of !utom!t! recogni2e only regul!r l!ngu!ges&
(c) Kleene Closure of a set of e pressions

In m!them!tic!l logic !nd computer science( the Kleene star ,or Kleene operator or Kleene closure. is ! un!ry oper!tion( either on sets of strings or on sets of sym"ols or ch!r!cters& The !pplic!tion of the 4leene st!r to ! set V is 'ritten !s V5& It is 'idely used for regul!r e+pressions( 'hich is the conte+t in 'hich it '!s introduced to ch!r!cteri2e cert!in !utom!t!( 'here it me!ns 62ero or more6&
(!) "egular # pression

In computing( ! regul!r e+pression provides ! concise !nd fle+i"le me!ns to 6m!tch6 ,specify !nd recogni2e. strings of te+t( such !s p!rticul!r ch!r!cters( 'ords( or p!tterns of ch!r!cters& A""revi!tions for 6regul!r e+pression6 include 6rege+6 !nd 6rege+p6& The concept of regul!r e+pressions '!s first popul!ri2ed "y utilities provided "y 7-I8 distri"utions( in p!rticul!r the editored !nd the filter grep& regul!r e+pression is 'ritten in ! form!l l!ngu!ge th!t c!n "e interpreted "y ! regul!r e+pression processor( 'hich is ! progr!m th!t either serves !s ! p!rser gener!tor or e+!mines te+t !nd identifies p!rts th!t m!tch the provided specific!tion&

(e) "egular $anguage

In theoretic!l computer science !nd form!l l!ngu!ge theory( ! regul!r l!ngu!ge is ! form!l l!ngu!ge th!t c!n "e e+pressed using ! regul!r e+pression& -ote th!t the 6regul!r e+pression6 fe!tures provided 'ith m!ny progr!mming l!ngu!ges !re !ugmented 'ith fe!tures th!t m!#e them c!p!"le of recogni2ing l!ngu!ges th!t c!nnot "e e+pressed "y the form!l regul!r e+pressions
(f) %rimiti&e "ecursi&e Function

In comput!"ility theory( primitive recursive functions !re ! cl!ss of functions th!t form !n import!nt "uilding "loc# on the '!y to ! full form!li2!tion of comput!"ility& These functions !re !lso import!nt in proof theory& 9ost of the functions norm!lly studied in num"er theory !re primitive recursive& or e+!mple$ !ddition( division( f!ctori!l( e+ponenti!l !nd the nth prime !re !ll primitive recursive& So !re m!ny !ppro+im!tions to re!l-v!lued functions& In f!ct( it is difficult to devise ! comput!"le function th!t is not primitive recursive( !lthough some !re #no'n ,see the section on :imit!tions "elo'.& The set of primitive recursive functions is #no'n !s ;< in comple+ity theory&
(g) 'nsol&able %roblem

A comput!tion!l pro"lem th!t c!nnot "e solved "y ! Turing machine& The !ssoci!ted function is c!lled !n incomputable function&
(h) (uring )achine

A (uring machine is ! device th!t m!nipul!tes sym"ols on ! strip of t!pe !ccording to ! t!"le of rules& 0espite its simplicity( ! Turing m!chine c!n "e !d!pted to simul!te the logic of !ny computer !lgorithm( !nd is p!rticul!rly useful in e+pl!ining the functions of ! C;7 inside ! computer&
(i) 'ni&ersal (uring )achine

In computer science( ! uni&ersal (uring machine ,'(). is ! Turing m!chine th!t c!n simul!te !n !r"itr!ry Turing m!chine on !r"itr!ry input& The univers!l m!chine essenti!lly !chieves this "y re!ding "oth the description of the m!chine to "e simul!ted !s 'ell !s the input thereof from its o'n t!pe
(*) (uring-Deci!able %roblem

(+) )oore Automata

In the theory of comput!tion( ! )oore machine is ! finite-st!te m!chine( 'hose output v!lues !re determined solely "y its current st!te&
(l) Conte t-free $anguage

In form!l l!ngu!ge theory( ! conte t-free language is ! l!ngu!ge gener!ted "y some conte+tfree gr!mm!r& The set of !ll conte+t-free l!ngu!ges is identic!l to the set of l!ngu!ges !ccepted "y pushdo'n !utom!t!&
(m) %ush!own Automata

In !utom!t! theory( ! push!own automaton ,;0A. is ! v!ri!tion of finite !utom!ton th!t c!n m!#e use of ! st!c# cont!ining d!t!&
(n) ,alting %roblem

In comput!"ility theory( the halting problem c!n "e st!ted !s follo's$ =iven ! description of !n !r"itr!ry computer progr!m( decide 'hether the progr!m finishes running or continues to run forever& This is e1uiv!lent to the pro"lem of deciding( given ! progr!m !nd !n input( 'hether the progr!m 'ill eventu!lly h!lt 'hen run 'ith th!t input( or 'ill run forever&
(o) N%-,ar! %roblem

N%-har! ,non-deterministic polynomi!l-time h!rd.( in comput!tion!l comple+ity theory( is ! cl!ss of pro"lems th!t !re( inform!lly( 6!t le!st !s h!rd !s the h!rdest pro"lems in -;6& A pro"lem H is -;-h!rd if !nd only if there is !n -;-complete pro"lem : th!t is polynomi!l time Turing-reduci"le to > ,i&e&( :?@?T>.& In other 'ords( L c!n "e solved in polynomi!l time "y !n or!cle m!chine 'ith !n or!cle for H
(p) Conte t-free $anguage

In form!l l!ngu!ge theory( ! conte t-free language is ! l!ngu!ge gener!ted "y some conte+tfree gr!mm!r& The set of !ll conte+t-free l!ngu!ges is identic!l to the set of l!ngu!ges !ccepted "y pushdo'n !utom!t!&
-) .how that the language $ / 0 ap : p is positi&e prime integer1 is not regular

(- mar+s)

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

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 .
0 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.}
2

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| _ p + p since |y| _ p < p + 2p + 1
2 2 2

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


2 2

2)

.how that each of the following function is primiti&e recursi&e function3 (a) f (m4 n) / 5mn

step ,!. put nA0 ,m(0.ABm50 A2,m. A0 Step ,". put nAnC1 ,m(nC1.ABm,nC1. ABmnCBm Af,m(n.CBmA D f,m(n.(BmE F 'e #no' !ddition function is ! primitive <ecursive function for t'o p!r!metersG Hhere represences !ddition!l function&
(b) fib (n)4 where fib (n) is !efine! by fib (6) / 6 fib (1) / 1 fib ( n 7 -) / fib (n) 7 fib (n 7 1) 4 n 6

step ,!. put nA0 ,m(0.A,Im.250 A,Im.0 A1 AS,J,m.. Step ,". put nAnC1 ,m(nC1. A ,Im.2,nC1. A,Im.2n 5 ,Im.2n Af,m(n. 5 ,Im.2n In the l!st 1uestion 'e !lre!dy prove th!t the multiplic!tion is ! primitive <ecursive function for t'o p!r!meters ( so th!t ,m(n.A,Im.2n is !lso ! primitive recursive function
5) Construct one grammer for each of the following languages

,!. 0 ai b* c+ 8 i / - * or * / -+ 1

Construct it yourself
(b) 0 w 0 64 119 : w / w"1

Construct it yourself
:) Construct one (uring )achine for computing each of the following (a) (he language 0 6n 1n : n 1 1

(b) (he function f (m4 n) / m 9 n4 where ;9< !enotes multiplication

You might also like