Found 1261 Articles for Computers

Explain the Greibach Normal Form (GNF)

Bhanu Priya
Updated on 16-Jun-2021 13:24:31

1K+ Views

Let G = (V, T, P, S) be a CFL. If every production in P is of the form as given belowA -> aaWhere A is in V, a is in T, and a is in V*, then G is said to be in Greibach Normal Form (GNF).ExampleS -> aAB | bB A -> aA | aB -> bB | cTheorem − Let L be a CFL not containing {s}. Then there exists a GNF grammar G such that L = L(G).Lemma 1 − Let L be a CFL. Then there exists a PDA M such that L = LE(M).Proof ... Read More

Explain Type-2 and Type-3 Grammar in TOC?

Bhanu Priya
Updated on 16-Jun-2021 13:20:38

5K+ Views

The Chomsky hierarchy is given below −Type 2 − Context Free Grammar (CFG)Type 2 grammars are generated by context free languages.The language that is generated by the grammar is recognized by Push Down Automata.Type 2 must be in Type 1.Left-hand side of production can have only one variable.|alpha| =1There is no restriction on beta.The production rules are in the form of −A->alphaWhere, A is any single non-terminal and is any combination of terminals and nonterminals.ExampleS->ABA->aB->bType 3 − Regular grammarType 3 grammars are generated by regular languages.These languages are exactly all those languages that can be accepted by finite state automata.Type ... Read More

Explain Type-1 grammar in TOC

Bhanu Priya
Updated on 16-Jun-2021 13:19:14

4K+ Views

Chomsky Hierarchy represents the class of languages that are accepted by the different machines.Chomsky hierarchyHierarchy of grammars according to Chomsky is explained below as per the grammar types −Type 0. Unrestricted grammars   Turing Machine (TM)Type 1. Context-sensitive grammars   Linear Bounded Automaton (LBA)Type 2. Context-free grammars   Pushdown Automaton (PDA)Type 3. Regular grammars   Finite Automaton (FA)Type-1 Context Sensitive Grammar (CSG)Type 1 grammar is also known as context sensitive grammarThe context sensitive grammar is used to represent context sensitive languageThe CSG follows some rules, which are as follows −The context sensitive grammar may have more than one symbol on the left hand side ... Read More

Explain Type-0 grammar in TOC

Bhanu Priya
Updated on 16-Jun-2021 13:18:29

8K+ Views

Chomsky Hierarchy represents the class of languages that are accepted by the different machines.Chomsky hierarchyHierarchy of grammars according to Chomsky is explained below as per the grammar types −Type 0. Unrestricted grammars   Turing Machine (TM)Type 1. Context-sensitive grammars   Linear Bounded Automaton (LBA)Type 2. Context-free grammars   Pushdown Automaton (PDA)Type 3. Regular grammars   Finite Automaton (FA)Type-0 unrestricted grammarType-0 grammars generate recursively enumerable.In type-0 the production has no restrictions.There may be any phase structure grammar which includes all formal grammarsThey generate the language which is recognized by the Turing machine.The productions can be in the form of a->b where, a is a string ... Read More

Explain Chomsky hierarchy in TOC

Bhanu Priya
Updated on 16-Jun-2021 13:17:35

9K+ Views

Chomsky Hierarchy represents the class of languages that are accepted by the different machines.Chomsky hierarchyHierarchy of grammars according to Chomsky is explained below as per the grammar types −Type 0 − It is an Unrestricted grammarsUnrestricted grammar − an unrestricted grammar is a 4-tuple (T, N, P, S), which consisting of −T = set of terminalsN = set of nonterminalP =as set of productions, of the form −v->wwhere v and w are strings consisting of nonterminal and terminals.S = is called the start symbol.Example − Turing Machine (TM)Type 1 − Context-sensitive grammarsAll productions are of form, v -> w where ... Read More

Explain the balancing parenthesis of PDA

Bhanu Priya
Updated on 16-Jun-2021 13:04:29

4K+ Views

Pushdown Automata (PDA) are the finite automata (FAs), but with the ability to push and pop symbols to/from a stack.PDA accepts strings if there is a legal path from start state to acceptance state for input. Otherwise, the string is rejected.A PDA can be represented by a 7-tuple(Q, ∑, ℾ, q0, ha, ∆, δ)WhereThe PDA is to finite subsets of Q ☓ (ℾ ∪ {∆})*.Parentheses are balanced ifWhile reading string, number of opening parentheses >= number of closing parentheses.When string is read, number of opening parentheses = number of closing parentheses.Examples(())() − Balanced((()() − Not balanced)()(() − Not balancedThe context ... Read More

What is Non deterministic finite automata?

Bhanu Priya
Updated on 16-Jun-2021 13:03:51

946 Views

For each state, there is exactly one transition corresponding to each symbol of the respective alphabet. This is termed as the Deterministic Finite Automaton (DFA)Nondeterministic Finite Automaton (NFA)For each state there can be zero, one, two, or more transitions corresponding to a particular symbol.If NFA gets to a state with more than one possible transition corresponding to the input symbol, we say it branches.If NFA gets to a state where there is no valid transition, then that branch dies An NFA accepts the input string if there exists some choice of transitions that leads to ending in an accept state.Thus, ... Read More

Construct Finite State Machine as Processing input

Bhanu Priya
Updated on 16-Jun-2021 13:03:02

326 Views

Finite automata is an abstract computing device. It is a mathematical model of a system with discrete inputs, outputs, states and a set of transitions from state to state that occurs on input symbols from the alphabet Σ.Formal definition of Finite AutomataFinite automata is defined as a 5-tuplesM=(Q, ∑, δ, q0, F)Where, Q − Finite set called states.∑ − Finite set called alphabets.δ − Q ☓ ∑ → Q is the transition function.q0 ∈ Q is the start or initial state.F − Final or accept state.Consider the Oyster card barriers at tube stations −States −ClosedOpenTransitions −Swipe cardEnter gateSuccess − Will ... Read More

Design a PDA which recognizes the language

Bhanu Priya
Updated on 16-Jun-2021 12:58:17

397 Views

ProblemGenerate the push down automata (PDA) that recognizes the language E={aibj| i is not equal to j and I is not equal to 2j}.SolutionConsider the two languages as given below −L1={aibj|i,j>=0 and i>2j}L2={aibj|i,j>=0 and iaA   A->aaAb|aA|epsilonIn L2, the number of a's are less than double the number of b'sSo the CFG for L2 becomes as follows −   S2->Bb|aBb   B->Bb|aBb|aaBb|epsilon   S->S1|S2L1: {aibj:i>2j}L2:{aibj: i

What are the Turing machine variations in TOC?

Bhanu Priya
Updated on 04-Nov-2023 01:36:28

27K+ Views

Turing machines (TM) can also be deterministic or non-deterministic, but this does not make them any more or less powerful.However, if the tape is restricted so that you can only see use of the part of the tape with the input, the TM becomes less powerful (linear bounded automata) and can only recognise context sensitive languages.Many other TM variations are equivalent to the original TM. This includes the following −Multi-trackMulti-tapeMulti-headMulti-dimensional tapeThe off-line Turing machineMulti-tape Turing MachineA Turing machine with several tapes we call it a multi tape Turing machine.Every tape’s have their own Read/Write headFor N-tape Turing MachineM={( Q, X, ... Read More

Advertisements