Bhanu Priya has Published 1449 Articles

Construct the derivation tree for the string aabbabba.

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:31:05

15K+ Views

ProblemDerive a derivation tree for the string aabbabba for the given context free grammar (CFG) −S->aB|bA A->a|aS|bAA B->b|bS|aBBSolutionDerivation is a sequence of production rules, which is used to get input strings.Derivation treeIt is a graphical representation for derivation of given production rules for a given CFG. It is also called ... Read More

Derive the string “abb” for leftmost and rightmost derivation

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:24:35

3K+ Views

ProblemLet’s consider a grammar to derive “abb” string using LMD and RMD   S->AB/ ε   A-> aB   B-> SbSolutionWe have to use context free grammar.Derivation is a sequence of production rules, which is used to get input strings.During parsing, we have to take two decisions, which are as follows −We have ... Read More

How to generate the language for context free grammar?

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:22:44

5K+ Views

ProblemGenerate the language for the given context free grammar.S->0S, S-> λS-> A0, A->1A, A-> λS->000S, S-> λSolutionContext free grammar (CFG) is a formal grammar that is used to generate all the possible patterns of strings in a given formal language.CFG is defined by four tuplesG=(V, T, P, S)Where, T: Set ... Read More

Explain NFA with epsilon transition.

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:20:10

31K+ Views

We extend the class of NFAs by allowing instantaneous ε transitions −The automaton may be allowed to change its state without reading the input symbol 2.In diagrams, such transitions are depicted by labeling the appropriate arcs with ε.Note that this does not mean that E has become an input symbol. ... Read More

How to convert from NFA to DFA in TOC?

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:14:20

3K+ Views

In Non-Deterministic Finite Automata, for any current state and input symbol, there exists more than one next output state.Any string is accepted if and only if there exists at least one transition path which is starting at initial state and ending at final state.The following steps are followed to convert ... Read More

Design a Moore machine for some binary input sequence.

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:12:34

17K+ Views

ProblemDesign a Moore machine for a binary input sequence such that if it has a substring 101, the machine outputs A, if the input has substring 110, it outputs B otherwise it outputs C.SolutionFor designing such a machine, we will check two conditions, and those are 101 and 110. If ... Read More

Design a Moore machine to generate 1's complement of a binary number.

Bhanu Priya

Bhanu Priya

Updated on 12-Jun-2021 09:08:25

11K+ Views

Moore machine has 6 tuples, which are as follows −(Q, q0, Σ, O, δ, λ)Where, Q: Finite set of statesq0: Initial state of machineΣ: Finite set of input symbolsO: Output alphabetδ: Transition function where Q × Σ → Qλ: Output function where Q → OThe transition diagram is as follows ... Read More

Draw DFA which accepts the string starting with ‘ab’.

Bhanu Priya

Bhanu Priya

Updated on 11-Jun-2021 14:39:49

33K+ Views

ProblemDraw the state transition diagram over an alphabet Σ={a, b} that accepts the string starting with ‘ab’.SolutionThe formal definition of Deterministic Finite Automata (DFA) is as follows −A DFA is a collection of 5-tuples as shown below −M=(Q, Σ, δ, q0, F)Where, Q: Finite set called states.Σ: Finite set called ... Read More

Design NFA with Σ = {0, 1} and accept all string of length at least 2.

Bhanu Priya

Bhanu Priya

Updated on 11-Jun-2021 14:03:26

23K+ Views

Non-deterministic finite automata also have five states which are same as DFA, but with different transition function, as shown follows −δ: Q X Σ -> 2QNon-deterministic finite automata is defined as a 5 tuple, M=(Q, Σ, δ, q0, F)Where, Q: Finite set of statesΣ: Finite set of the input symbolq0: ... Read More

Construct DFA with Σ= {0,1} accepts all strings with 0.

Bhanu Priya

Bhanu Priya

Updated on 11-Jun-2021 13:47:32

37K+ Views

A Deterministic Finite automata (DFA) is a collection of defined as a 5-tuples and is as follows −M=(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 ... Read More

Advertisements