How to desgin a turing machine that can recognize the strings of balanced parenthesis? For example (())().
Turing Machine For balanced parenthesis
4.7k Views Asked by pankaj shah At
1
There are 1 best solutions below
Related Questions in COMPUTER-SCIENCE
- what's the difference between "nn layout" and "nt layout"
- Theory of Comp Sci - State Diagrams NFAs
- What is devops meaning ? What requirement?
- How to test that a specific sorting algorithm was actually implemented?
- Creating a more efficient algorithm for taking the third largest difference an element has with another element in the list in python
- Theory of computer science problems
- Choosing a sequence of bitwise operations
- How to determine the time complexity of a recursive function that has a loop enclosed in it?
- Find median in constant time O(1)
- The factorial of an inputted number in Flowgorithm
- How come checking for printable bytes is faster with the "in" operator rather than interval comparisons?
- PageRank Algorithm on a Graph with a Sink Node
- recursion relation problem solve only using back substitution method
- Integrating Jenkins CI/CD with WinDev Framework for Academic Project
- Formatting multiplication tables in python; not how to, just some explanation
Related Questions in AUTOMATA
- Converting ENFA To DFA and ENFA NFA
- Need clarification on pumping lemma for context free languages
- Unable to create an DPDA that accepts strings in binary notation multiples of 3
- how to model and verify model
- UPPAAL chooses to loop on instead of a transition of a higher priority
- Build a Turing Machine that counts a's and b's
- Convert the given Moore Machine into Mealy machine
- Converting context free grammar to chomsky normal form
- Intersection of two Deterministic Finite Automata (DFA)
- NFA or e-NFA for the condition , n % 5 = 0 where n is the number of 1s
- Finding a regular grammar for the language L
- Does this DFA satisfy the complement of the given language?
- How to Perform Bottom-Up Parsing for a Given CFG and Input String?
- Regular expressions matching given string
- If an Infinite language is passed to Machine M, the subsidiary which gives a finite solution to the infinite input tape is?
Related Questions in TURING-MACHINES
- Understanding Unary PCP Reduction to a Matching Problem (UPCP)
- Build a Turing Machine that counts a's and b's
- Language for Turing Machine
- Unable to export Chains class from Julia's Turing library
- Complicated, long equations in MCMC [Julia, Turing.jl]
- Turing Pattern Formation
- Is there a way to prove that the intersection of a decidable language and a recognizable language is also recognizable?
- binary search with JFLAP turing machine
- python - 3 Turing Machine script, getting errors on an undefined variable, even though I assigned it
- Prove that the following problem is undecidable by a reduction from the halting problem:
- Construct a Turing Machine that halts on an unbroken string of 1s
- Jump to a specific vector place if a condition is met and start reading it from there
- Binary to unary turing machine
- How to generate an Unrestricted grammar if a language defination is given
- Can we assure a strictly decreasing function is computable?
Related Questions in TURING-COMPLETE
- What is the most basic assembler language that is turing complete?
- Understanding the primitives which Turing showed to be sufficient for a programming language
- How would a Turing machine implement memory protection, interrupts, or real timer that a modern CPU has?
- Fixpoint of type exponentiation as a language
- Can any additional axiom make Coq Turing complete?
- TOC program A that when given any program B as input can determine whether or not B produces “hello world”
- Would x86 still be fully programmable if it didn't have the Sign Flag (SF)?
- Could you mine cryptocurrencies with the LaTeX language?
- Is pure Prolog Turing-complete, and if so, why can't it implement list intersection?
- Why is mov turing complete?
- Turing Machine For balanced parenthesis
- Datalog computational class?
- Turing machine for addition and comparison of binary numbers
- Is MapReduce Turing Complete?
- Is Move a Turing-complete language?
Related Questions in COMPUTER-SCIENCE-THEORY
- Context Free Grammar for L= { a^n b^m c^m d^2n }, where n and m are >= 0
- how to prove {(a^m)(b^n)(c^k): m!=k and m,n,k ∈ N} is non-regular?
- What is a "model of computation"?
- How do we show that the following language is undecidable
- How to check if two binary trees share a node
- the stack size in a PDA M can grow to hold at most k symbols. What kind of language is L(M)?
- What could be the possible cause of this inconsistent time complexity?
- Comparison sorting algorithms evaluating more than 2x elements at each step
- With all the available problems that have been categorized and their time complexities deduced, so why haven't anyone solved NP vs P yet?
- Why second version of dynamic programming is wrong
- Finding the last digits sum with recursion
- Is there any algorithm for converting the 2d images into 3d model?
- Turing machine with one state that converts binary to decimal
- How to find the ith number that has n factors, considering that n isn't prime?
- How to covert bnf to ebnf from that !? bnf <Z> ::= DCd | D<N>C
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
To recognize the strings of balanced parentheses, we just have to make sure there is no prefix which has more closing parentheses than opening parentheses and that the string ends after seeing an equal number of opening and closing parentheses. Clearly, both of these conditions must hold of valid strings; these are necessary requirements. I will leave showing these conditions are sufficient as an exercise or, at any rate, suggest you ask a separate question on that.
So, all we need to do is the following:
Assuming a single-tape TM, you can read a symbol, then write over it with some marker, then move to the end of the tape in a state depending on whether you saw an opening or closing parenthesis; then, either add a new symbol to the end (if opening) or delete one off the end (if closing); then, enter a new state to go back to the first unmarked symbol of input, and repeat.