Construct Derivation Tree for the String aabbabba

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 as a parse tree.PropertiesThe derivation tree contains some properties, which are as follows −The root node is always a node indicating the start symbol.The derivation is read from left to right.The leaf node is always terminal nodes.The interior nodes are always the non-terminal nodes.The given CFG is as follows −S->aB|bA ... Read More

Derive String ABB for Leftmost and Rightmost Derivation

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 to decide which non-terminal has to be replaced.We have to decide which non-terminal has to be replaced by using which production rule.There are two options to decide which non-terminal has to be replaced with production rule −Leftmost derivationRightmost derivationLeftmost derivationThe input is scanned and replaced with production rules from left ... Read More

Generate Language for Context-Free Grammar

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 of terminals (lowercase letters) symbols.V: Vertices or non-terminal symbols (Capital letters).P: Production rules.S: Start symbol.Example 1The grammar is −S->0S, S->λCase 1 − S->0S     ->0Case 2 − S->0S    ->00S    ->00Case 3 − S->0S   ->00S   ->000S   ->000Therefore, the language generated for the given grammar is −L={e, 0, 00, 000……..}Example ... Read More

Explain NFA with Epsilon Transition

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

32K+ 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. On the contrary, we assume that the symbol E does not belong to any alphabet.ε -NFAs add a convenient feature but (in a sense) they bring us nothing new. They do not extend the class of languages that can be represented.Both NFAs and E-NFAs recognize exactly the same languages.Epsilon (ε) ... Read More

Convert NFA to DFA in Theory of Computation

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 a given NFA to a DFA −AlgorithmStep-01Let's take ' q’ as a new set of states of the DFA. It is declared null in the beginning.Let's take T’ be a new transition table of the DFA.Step-02Add the start state of the NFA to q’.Add transitions from the start state to ... Read More

Design a Moore Machine for Binary Input Sequence

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

18K+ 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 we get 101, the output will be A, and if we recognize 110, the output will be B. For other strings, the output will be C.Moore machine has 6 tuples(Q, q0, Σ, O, δ, λ)Where, Q: Finite set of statesq0: Initial state of machineΣ: Finite set of input symbolsO: Output ... Read More

Design a Moore Machine to Generate 1's Complement of a Binary Number

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

12K+ 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 −ExplanationStep 1 − q0 is the start state on input ‘0’ goes to q1 state and on ‘1’ goes to state q2 generating output 0.Step 2 − q1 on input ‘0’ goes to q1 itself and on ‘1’ goes to q2 generating output ‘1’.Step 3 − q2 on input ‘0’ ... Read More

Magnetism, Electromagnetism and Magnetic Materials

Manish Kumar Saini
Updated on 12-Jun-2021 06:57:56

2K+ Views

MagnetismIn the ancient times, people believed that the invisible forces of magnetism was purely a magical quantity. However, with the increasing scientific knowledge over the passing centuries, magnetism assumed a larger and larger role. Today the magnetism has attained a place of pride in electrical engineering. Without the magnetism, it is impossible to operated electrical devices like generators, motors, transformers, TV, radio, telephone etc. Therefore, electrical engineering is much dependent on magnetism.Magnetic polesA magnet has two poles viz. North Pole and South Pole. In order to determine the polarity of a magnet, suspend it at its centre, then the magnet ... Read More

Loaded and Unloaded Voltage Dividers

Manish Kumar Saini
Updated on 12-Jun-2021 06:46:31

8K+ Views

A voltage divider or potential divider is a series circuit that is used to provide more than one reduced voltages from a single source of voltage.Consider a circuit of voltage divider as shown below, in which two reduced voltages V1 and V2 are obtained from a single input voltage source of V volts. Since no load is connected to circuit, it is called unloaded voltage divider.Refer the circuit of unloaded voltage divider, $$\mathrm{Circuit\:Current, I= \frac{V}{R_{1}+{R_{2}}}=\frac{V}{R_{eq}}}\:\:\:… (1)$$        Where, Req=R1 + R2= Total resistance of voltage dividerTherefore, $$\mathrm{V_{1}=IR_{1}=\frac{V}{R_{eq}}×R_{1}=V\frac{R_{1}}{R_{eq}}}\:\:\:… (2)$$$$\mathrm{V_{2}=IR_{2}=\frac{V}{R_{eq}}×R_{2}=V\frac{R_{2}}{R_{eq}}}\:\:\:… (3)$$Hence, equation (2) and (3) shows that, the voltage drop ... Read More

Linear and Nonlinear Resistors

Manish Kumar Saini
Updated on 12-Jun-2021 06:43:22

5K+ Views

A resistor is a circuit element that opposes the flow of electric current in the circuit by virtue of its property called resistance.According to I-V characteristic, the resistors may be classified in two categories viz.Linear ResistorNon-Linear ResistorOhm’s LawIf the physical conditions are constant, then the ratio of applied voltage across a conductor to the current through it remains constant and equal to the resistance of the conductor.$$\mathrm{R=\frac{V}{I}\:or\:V}=IR$$$$\mathrm{∴V\:∝\:I}$$Therefore, I-V characteristic is a straight line passing through the origin at all times.Linear ResistorA linear resistor is defined as a two terminal circuit element which satisfies Ohm’s law i.e. the voltage across the ... Read More

Advertisements