The complement of a context-free language is not always context-free. It is not allowed to just swap the final and non-final states of an NPDA and assume that it produces the complement of the language. Could someone give an example where it goes wrong? And why does the above described procedure work for regular languages given a DFA? Maybe because DFA and NFA are equivalent and DPDA and NPDA are not?
Complement of non-deterministic context-free language
531 Views Asked by Tryer outer At
2
There are 2 best solutions below
0
Prasanth Sekhar Rayudu
On
The grammar which does not specify a unique move from at least one sigma element.
From any state by taking one input we can not determine to which step we will reach so the grammar generating such type of situation is called non deterministic grammar.
[enter image description here][1] https://i.stack.imgur.com/U6vaJ.jpg For a particular input the computer will give different output on different execution.
Can’t solve the problem in polynomial time.
Cannot determine the next step of execution due to more than one path the algorithm can take.
Related Questions in LOGIC
- Anybody knows where to learn AIMA python library?
- How to render sprites for a snake game using SFML and C++
- What is causing my towers of hanoi logic to infinitely loop?
- sample query for review for improvement on big query
- How do i return an array to display from backwards
- Can I use Sumproduct arrays and check two separate criteria counting TRUE statements?
- R method for comparing NAs between two vectors
- Get latitude/longitude of an image's corners based on two other points
- How to make a chatbot using python which can understand my question and then answer it
- How to find all the possible combinations with condition?
- Strategies for Linking Recipe Ingredients with Specific Products in a Database
- How to avoid duplicate entry of Shops in a Website
- Compare row values in excel and store time value in a variable
- How to Trace a Circuit Path in a Python Matrix Based on Movement Rules?
- How Can JavaScript Handle Large Amounts of JSON Data Quickly?
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 FINITE-AUTOMATA
- a challenging finite automata - what is the language?
- Correct labeling for this regular language?
- Unable to create an DPDA that accepts strings in binary notation multiples of 3
- Need a DFA for the alphabets {a,b} such that the language must contain equal and even numbers of a and b
- Convert the given Moore Machine into Mealy machine
- What is the flaw in the proof of the countability of the set of finite language?
- NFA or e-NFA for the condition , n % 5 = 0 where n is the number of 1s
- Conversion of NFA having a missing transition for any input character on initial state to DFA
- On the use of subsequential symbol $ in Finite state transducers to pad out the context, for composition
- Convert Nondeterministic Finite Automata to Regular Expression
- How do I make a string validator for Deterministic Finite Automata?
- Can Arden's theorem provide multiple regular expressions for a given DFA if the order and process of solving the equations are changed?
- Automata theory: Formal definition of indistinguishable & distinguishable strings and example confusion
- NFA or DFA accepting # of positions of 4k between 0's
- Using bracket for automata
Related Questions in NON-DETERMINISTIC
- Non-Deterministic behavior in PDF library when accessing Django model in between
- Order of callbacks: setTimeout and ResizeObserver
- Haskell. Not seeing laziness despite using list-t's ListT (State s)
- Redundancy in comparison sort / tournament systems
- yocto programmatically asigned SRCREV trigger metadata not deterministic
- Convert Nondeterministic Finite Automata to Regular Expression
- Can I get an ORDER BY with several columns but still deterministic?
- How do I invoke firebase cloud functions within the client using HTTP if the functions URLS will change depending on environment?
- Is there a way to save execution of ruby code to debug it using step by step replay later?
- How to provide non-determinist value (id, dates, random...) to Domain Entity or Aggregate Root given that its been injected as dependencies
- Are there PRECISE RULES to know when MySQL will apply gap blocking?
- Temporarily storing tables with variable amounts of columns
- Using printf with MPI leads to non-deterministic output
- Confusion on the Syntax of a Python Module named automata.pda.npda within automata -lib
- Is UUID's hashValue non-deterministic?
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?
Well, swapping the final vs non-final states of an NFA doesn't even guarantee you'll get the complement of the language. Consider this rather curious NFA:
This NFA accepts the language {a}. Swapping the final and non-final states, the accepted language becomes {e, a}. These languages are not complementary since they have an intersection.
In exactly the same way, swapping the states of a NPDA is not guaranteed to work either. The difference, as you point out, is that for any NFA, there is some equivalent DFA (indeed, there are lots), and swapping toggling the finality of states will work for those, so the languages are guaranteed to be closed under complementation.
For NPDAs, though, we do not necessarily have equivalent DPDAs (where swapping finality would work fine). Thus, it is possible that the complement of some languages accepted only by NPDAs is not context-free.
Indeed, the context-free language {a^i b^j c^k | i != j or j != k} is accepted only by NPDAs and its complement {strings not of the form a^i b^j c^k or strings of that form with i=j=k) is not context-free.