You are on page 1of 13
7.6 Cee ae a eS ee ae Church’s Hypothesis [FAQ 5] [Nov. - 2008, Set ~ 4, Q8(a)] 1M 6] According to church’s hypothesis, all the functions which can be defined by human beings can be computed by turing machine. The turing machine is believed to be ultimate computing machi The church’s original statement was slightly different because he gave his thesis before machines were actually developed. He said that any machine that can do certain list of operations will be able to perform all algorithms. TM can perform what church asked, so they are possibly the machines which church described. Church tied both recursive functions and computable functions together. Every Partial recursive function is computable on TM. Computer models such as RAM also give rise to partial recursive functions. So they can be simulated on TM which confirms the validity of churches hypothesis. Important of church’s hypothesis is as follows. 1) First we will prove certain’ problems which cannot be solved using TM. 2) If churches thesis is true this implies that problems cannot be solved by any ‘computer or any programming languages we might every develop. 3) Thus in studying the capabilities and limitations of Turing macl studying the fundamental capabilities and limitations of any computational device It provides a general principle for algorithmic computation and, while not provable, gives strong evidence that no more powerful models can be found. Counter Machine [FAQ 5] Counter machine has the same structure as the multistack machine, but in place of each stack is a counter. Counters hold any non negative integer, but we can only distinguish between zero and non zero counters. Counter machines are off-line turing machines whose storage tapes are se: and whose tape alphabets contain only two symbols, Z and B (blank). Furthermore the symbol Z, which serves as a bottom of stack marker, appears initially on the cell scanned by the tape head and may never appear on any other cell. An integer i can be stored by moving the tape head i cells to the right of Z. A stored number can be incremented or decremented by moving the tape head right or left. We can test whether a number is zero by checking whether Z is scanned by the head, but we cannot directly test whether two numbersare equal. 5: lz B\B/...|B] Bhp]... ig. 7.7.1 : Counter Machine ¢ and $ are customarily used for end markers on the input. Here Z is the non blank symbol on each tape. An instantaneous description of a counter machine can be described by the state, the input tape contents, the position of the input head, and the distance of the storage heads from the symbol Z (shown here as d, and d,). We call these distances the counts on the tapes. The counter machine can only store a count an each tape and tell if that count is zero. i a a cele Chomsky Hierarchy of Languages [FAQ 1] [Nov. ~ 2008, Set ~ I» g8(a)f IM 6] free, context sensitive and ing relationships among these jal classification into four languages We have four classes of languages regular, cont recursive enumerable languages. JOne way of ex! languages is by chomsky hierarchy provided an i types, type 0 to type 3. ‘The type 0 languages are those generated by unrestricted grammars 1-6» recursive enumerable languages. Type 1 consists ofthe context sensitive languages, YPe 2 £om of the context free language and type 3 consists of regular languages: For | < i < 3, every language of type i is a proper subset of type | ~ 1, except that a context free language isa context sensitive only i it does not contain the null sting (for any context free language, the set of.non null strings in the languages is @ context sensitive language) Type 3 & Type 2 & Type 1 & Type 0. ‘The Fig. 8.1.1 shows chomsky hierarchy of grammars and their corresponding automata, LANGUAGE AUTOMATA It fig. 8.1.1 : Chomshy Hierarchy of Longuages Computapiity Theory [Unit - 9) Several other languay ode nevage fails can beaded to this hierarchy including the fai ° stic content free languages (Ley) and recursive languages % tended hierarchy is shown in Fig. 8.1 ae eecen ly Fig. 8.1.2 # &tended Hierarchy Other language families can be defined and their place in the above diagram studied, although their relationships do not always have the neatly nested structure as in the Fig. 8.1.2. In some instances relations are not completely understood. 4.4 Type 0 (or) Unrestricted Grammars (or) Phrase Structured Grammar MA iar G = (V, T, P, S) is said to bet ar.if its productions are of the form, kK (a>BY with atleast terminal anda 2c, where a is a string of symbols with atlew:t one nonterminal «, sBe(WuT & B is a string of terminals and nonterminals including ¢ i ‘gpa enteerinale There are no restrictions on productions of type 0 grammar except a + ¢. Hence it is known as unrestricted granimar) ‘The language of type 0 ie is known as type 0 languages or unrestricted langhages or phrase structred language or recursively enumerable language.) J 3 ‘Turing Machine (TM) is constructed to recognize the sentences generated by this grammar. ¢ Teme dear utablity Theory [Unit - 8) Example V=ABO. T= tbo C= TRA) A is start symbol “The set of productions P consists, A> AB,AB > BCB >a ~~ Type 1 (or) Context-Sensitive Grammar (CSG) ‘A grammas G = (V,T, PS) is said to be content sensitive grammar if the are of the form, productions eae «where a is any string of terinals and nonterminals with atleast one non-terminal ep is any string of terminals and non-terminals with Bl * € with exception for starting symbol where. S > « is possible. {AC The restriction on the productions is that the length of the consequent is atleast as much as antecedent a i.e, [B| > Ia. When $ -» € is production in the grammar then the starting symbol i.e., $ should not appear on the right hand side of any production, ‘The term context-sensitve originates fom productions of the form, a, Aa > ay, Bet (B+ €) Where a, is known as left context of A and ct is known as right context of A. Replacement of a non-terminal A in any production of B depends on the context of «, 1 and a. Language generated by Type | grammar is known as type 1 language or Context ‘Sensitive Language (CSL). . ‘A Linearly Bounded Automaton (LBA) which is a TM with its tape restr str linear function of input recognizes the CSL. Tee PEPER Languages and Automata Theory EE Examples ) v= (8B, C), T= ( S is start symbol. bch O= (TPS) P consists of, S + SB, SB + SC, C > abe. This grammar is context-sensitive grammar. 2) V=(S,B, A), T= (a, b,c), = (TPS) S is start symbol. P consists of, SaABle AB ab Here § > ¢ is in P so S does not appear in RHS of any production hence it is context-sensitive. 8.1.3 Type 2 (or) Context Free Grammar ¥ A grammar G = (V, T, P, $) is said to be context free grammar if the productions are of the form, yAsa) {-Cwhere A is a non-terminal A € V, ae (Vu T)*.) {The productions of the form A -> « are also permitted and for S -> ¢ . S can appear in RHS of the pre 4uction. {The language generated by type 2 grammar is Anown as type 2 languages oF context free language.) Push Down Automata (PDA) is constructed to recognize the sentences generated by this grammar. ‘The grammars of most programming languages approximate to this grammar. ¥ Example : V = {S, A, B}, T= {a, b}, G = (VT, BS) S is start symbol. Productions P consists of, ng S + SB,A — abSB | aS |b, B > ab. ‘The grammar G is a type 2 or CFG. Type 3 (or) Regular Grammar {A grammar G = (V, T, PS) is said to be type 3 grammar if its produetions 7° 7 form, D A+ xB (or) Asx where A is-a non-terminal A, B ¢ V and x € T*- 2) A> Bx (or) Asx where, A, B ¢ Vand xe Tt. ng of productions only of 1* type is known as right 2 ‘The grammar consist grammar and the grammar consisting of productions only of 2% type is known either left-or right linear-is known as ‘The language of type 3 grammar is known as type 3 language. Regular language is recognized by finite automaton i.e., finite state machine. V = {S, A, B}, T= {a}, G=(V,T, P, S) S is start symbol and productions P consists of, Sad 4 S>B A> aS Boa This grammar is type 3 or regular grammar. Undecidabitity of Post's 1k was first introd Problem (PCP) be of equal length, general and next line B = xy, x, tobea Corresponding pair. ini i « War Wig + Wig = Xp Kge % The sequence iy, i Examples. '$ Correspondence Problem FAQ 5] iced by Emil post in 1946. An instance if Post Correspondence Consists of two lists of strings over some alphabet E the two lists must ily refer them as A and B lists and write A = Wy, Wy «- « + %< for some integer k. For each i, the pair (wy x) is said ™ ‘This instance of PCP has a solution, if there isa sequence of one or more integers {,, that, when interpreted as indices for strings in the A and B lists, yield the same string i.e, ig is a solution to this instance of PCP, PCP is undecidable, 1) Let = (0, 1). Let A and B lists of 3 strings each. list | fist wie dep sue Peat 2 | 100 | 001 3) m]u lg. 8.7.1 : A Instance of PCP In this case there PCP has a solution | 23. m sie iy i= ‘The sequence is W, Wy Ws =X; XX ~ HITOOIIT. 2) Let B= (0, 1). Let A and B lists of three strings each, Hist | list ifow| ow - 1] 0 | 0 2) or | ou 3 | 1000 | on Fig. 8.72 + Ain lnstonce of PCP bane a In this case, there cannot be any PCP - solution simply because any string composed of elements of A will be fonger than the corresponding string frm B - in this ease, PCP has no solution. post correspondence problem can be treated as gain: « BBoininoes. Each doming orm i group has string x, on the top half and string y, on the bottom half i x, x, | |X x, 5 “TS wf iy |b Aig. 8.7.3 + Typical Dominoes nding a solution for this instance means lining up dominoes in a horizontal by top half matches with string row, each one positional vertically so that st formed by bottom half as shown in Fig. 8.7.4. ‘xi, | xiz f xis | Xigg, yin [ via | vis Yin Fig. 8.7.4 : Solution String for PCP 3) Let instance of PCP be, 1 ]{ tor |} 10 un 10 ° (@) An Instance of PCP Sequence for it, ton | 1 i} 10 ie, 101NII110. ‘The soluti solic Us 0 | un 0 (b) A Solution String for PCP Flg. 8.7.5 1 Solution using PCP ee meSTTMTON of P ang NP Problems [FAQ 6] A problem j. IS said to pb, . e 1 categorized into two gro Solvable if it has an algorithm to solve it. Problems can be UPS depending on time taken for their execution. 1) The Problems wi 7 Example bubble hose Solution times are bounded by polynomials of small degree. Pn) =n? = 2n 4 Sort algorithm obtains n numbers in sorted order in polynom 1 where n is the length of input. Hence, it comes under this group. 2) Secon i ; d group is made up of problems whose best known algorithm are non Polynomial exaiz>'e, travelling salesman problem has complexity of O(n? 2") which comes under this group. (A problem can be solved if there is an algorithm to solve the given problem and «me required is expressed as @ polynoinial p(n), n being length of input string, The problems of fit group are of this kind. The problems of second group require larce amount of time to execute and even require moderate size so these problems are difficult to solve. Hence, problems of first kind are tractable or easy and problems of second kind are intractable or hard. 3.9.1 P-Problem (7 stands for deterministic polynomial time. A deterministic machine at each time ex fan instruction. Depending on instruction, it then goes to next state which is ue UN Tue yhoce ts comely of denis TM be manu nmh oar nye pocening by ip hing OC gh taken aver al po oe ee Class p consists of those problem that are solvable in polynomial time by DTM, NP-Problem NP stands for nondeterministic polynomial time. The class NP consists of those problems that are verifiable in polynomial tim iven certificate of a solution then we can ver ime in size of input problem. What we mean here is that if we are that the certificate is correct in polynor Example : Hamiltonian circuit problem. Given a directed graph G = , a centific would be a sequence of IV] vertices. It is easy to verify in polynom time that (V, + V, + 1) € E fori= 1, 2,... [V|- and (Vy) ¢ Eas well usin nondeterministic algorithm. Hence it is in class NP. There doesnot appear any determini algorithms to recognize those graphs with Hamiltonian circuit. Hence it is not in clas A nondeterministic machine has a'choice of next steps. It is free to choose move that it wishes and if the problem has a solution one of these steps willlea solution. Definition :(A language L is in class NP it these is a nondeterministic-TM such M is of.time complexity P(n) for some polynomial P and M accepts L.\, The difference’ between P and NP problems is analogous to difference bet efficiently finding a proof of a statement (such as “This graph has Hamiltonian cir and efficiently verifying a proof of a statement (“i.e., checking a particular cir hamiltonian”). It is easier to check a proof than finding a one. 4 ' in other words class NP consists of problems for which solution are ‘ Ry) cons of problems which can be solved quickly. ) quick Any problem in p is also in NP, but it is not yet known that p = NP. ymmonly believed relationship between-P and NP is, @® » einen Relationship between P and NP Problems probl ‘ lems are classified into two types, NP-complete and NP-hard problems. NP-Complete Problems pe Fig. 8.9.1 known Ca class of “tes pebble town es Neon OMENS SE status a FNP complete problems D0" B6.Pas one been able to prove that no polynomial time exists for any of them ‘These are hardest of NP problems. The P and NP complete problems are disjoint. se that P, polynomially iy. Since P, is NP- be further reduced ‘Suppose we have an NP-complete problem P,- Suppo: reduces to P, so that-can solve P, using P, with only «time pend complete, every problem in NP polynomially reduces to P, which can to Pp, So P, also said to be NP-complete. + So if P, is NP-complete and P, can be polynomially reduction of P, to Pa, then P, is Np-complete. (if ye-know one NP-complete problem, we can find all NP-complete Pr lems. | ‘The first NP-complete problems whether ‘boolean expression is satisficable-is proved ‘NP-comy explicitly reducing the language of any non ¢ ‘erministic, polynomial time TM to the sutfabiligyproblem.— » a = = Examples : The satisfibility problem. ‘The boolean expressions are built from, iy _ Variables whose v4 2) Binsry operators “ and V+ nary operator - standing fOr logical negation erators and operands, if necessary to alter the default “Thighest, then and finally v. ales are boolean ie, they either have the value I (true) or 0 (false). standing for the logical AND and OR of two expression. d 4) Paromthesis t0 gFOUP OP precedence of operators g0g oS to eee

You might also like