Bhanu Priya

Bhanu Priya

1,060 Articles Published

Articles by Bhanu Priya

Page 83 of 106

Construct an NFA accepting strings with an even number of 0s or an odd number of 1s

Bhanu Priya
Bhanu Priya
Updated on 15-Jun-2021 15K+ Views

Non-deterministic finite automata (NFA) also have five states which are same as DFA, but with different transition function, as shown follows −δ: Q X Σ → 2QWhere, 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.ProblemConstruct NFA over an alphabet Σ={0, 1}.SolutionDesign two separate machines for the two conditions, as given below −NFA accepting only odd number of 1’sNFA accepting only even number of 0’sNFA accepting only odd number of 1’s over an alphabet Σ= ...

Read More

Design a DFA machine accepting odd numbers of 0’s or even numbers of 1’s

Bhanu Priya
Bhanu Priya
Updated on 15-Jun-2021 12K+ Views

A Deterministic Finite automaton (DFA) is a five 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.ProblemConstruct a DFA machine accepting odd numbers of 0’s or even numbers of 1’s.SolutionDesign two separate machines for the two conditions over an alphabet Σ={0, 1} −DFA accepting only odd number of 0’sDFA accepting only even number of 1’sDFA accepting only odd number of 1’s over an alphabet Σ={0, 1}    The language L= ...

Read More

Design a DFA of a string with at least two 0’s and at least two 1’s

Bhanu Priya
Bhanu Priya
Updated on 15-Jun-2021 5K+ Views

A Deterministic Finite automaton (DFA) is 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.ProblemConstruct DFA of a string with at least two 0’s and at least two 1’s.SolutionThe language generated based on the given condition over the alphabet Σ ={0, 1) is −L={0011, 001011, 0001010, 0011001, 010101, ……}The given language accepts at least two zero’s means it can accept two or more than two zero’s and at least ...

Read More

Construct DFA for strings not ending with "THE"

Bhanu Priya
Bhanu Priya
Updated on 15-Jun-2021 1K+ Views

A Deterministic Finite automaton (DFA) is a five 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.Accept Strings which are not ending with "THE"Observe whether the given string is ending with “the” or not.The different notations of “the” which are avoided in the end of the string are as follows −     "tHE", "thE", "THE", "ThE", "THe", "The", "tHe" and "the"These all strings are not accepted from alphabet (A-Z)Let the ...

Read More

Explain the operation of DFA with block diagram in TOC

Bhanu Priya
Bhanu Priya
Updated on 15-Jun-2021 2K+ Views

The finite automata (FA) is represented as follows in the theory of computation (TOC) −Components of FAThe different components of finite automata are as follows −Input tapeThe input tape has a left end and extends to the right end.It is divided into blocks and each block containing a single symbol from the input alphabet Σ.The end block of the tape contains the end markers ₵ at the left end and the end marker $ at the right end.The absence of end markers indicates that the tape is of infinite length.The left-to-right sequence of symbols between the two end markers in ...

Read More

Design a TM that perform right shift over ∑ = {0, 1}

Bhanu Priya
Bhanu Priya
Updated on 14-Jun-2021 6K+ Views

ProblemShift the input string right by one place and design a Turing Machine (TM) that can perform right shift over ∑ = {0, 1}.SolutionRefer an algorithm given below to design a TM −Step 1 − Move right side to the last character from the initial character.Step 2 − If the character is „0‟, replace it with „B‟ and move one step right to replace the immediate „B‟ to „0‟.Step 3 − If the character is „1‟, replace it with „B‟ and move one step right to replace the immediate „B‟ to „1‟.Step 4 − After processing as above, move left one ...

Read More

Design a TM that increments a binary number by 1

Bhanu Priya
Bhanu Priya
Updated on 14-Jun-2021 5K+ Views

Turing’s machine is more powerful than both finite automata and pushdown automata. These machines are as powerful as any computer we have ever built.Formal Definition of Turing MachineA Turing machine can be formally described as seven tuples(Q, X, Σ, δ, q0, B, F)Where, Q is a finite set of states.X is the tape alphabetΣ is the input alphabetδ is a transition function: δ:QxX→QxXx{left shift, right shift}q0 is the initial stateB is the blank symbolF is the final state.A Turing Machine (TM) is a mathematical model which consists of an infinite length tape divided into cells on which input is given. ...

Read More

Design Turing Machine to reverse string consisting of a’s and b’s

Bhanu Priya
Bhanu Priya
Updated on 14-Jun-2021 6K+ Views

Our aim is to design a Turing machine (TM) to reverse a string consisting of a’s and b’s over an alphabet {a, b}.ExampleInput − aabbabOutput − babbaaAlgorithmStep 1: Move to the last symbol, replace x for a or x for b and move right to convert the corresponding B to          „a‟ or „b‟ accordingly. Step 2: Move left until the symbol left to x is reached. Step 3: Perform step 1 and step 2 until „B‟ is reached while traversing left. Step 4: Replace every x to B to make the cells empty since the reverse ...

Read More

C Program to construct DFA accepting odd numbers of 0s and 1s

Bhanu Priya
Bhanu Priya
Updated on 14-Jun-2021 10K+ Views

Construct deterministic finite automata (DFA) for the language L = { w : w has odd number of 0’s and w has odd number of 1’s}, over the alphabet Σ = {0, 1}.Example0111, 010101, 01110011 is an accepted string, because those strings have an odd number of 0’s and an odd number of 1’s.For the given language we will need four states to draw the main DFA which will read odd no. of 0s and 1s. We can also draw it by merging the two DFAs in which one will accept only an odd number of 0s and one accepts ...

Read More

Construct a Turing Machine for L = {a^n b^n | n>=1}

Bhanu Priya
Bhanu Priya
Updated on 14-Jun-2021 35K+ Views

The Turing machine (TM) is more powerful than both finite automata (FA) and pushdown automata (PDA). They are as powerful as any computer we have ever built.Formal Definition of Turing MachineA Turing machine can be formally described as seven tuples(Q, X, Σ, δ, q0, B, F)Where, Q is a finite set of statesX is the tape alphabetΣ is the input alphabetδ is a transition function: δ:QxX→QxXx{left shift, right shift}q0 is the initial stateB is the blank symbolF is the final state.A Turing Machine (TM) is a mathematical model which consists of an infinite length tape divided into cells on which ...

Read More
Showing 821–830 of 1,060 articles
« Prev 1 81 82 83 84 85 106 Next »
Advertisements