2. [10 marks] Give a PDA (Pushdown Automata) that recognizes the language L = {o€ {n,y,...
Give a PDA (Pushdown Automata) that recognizes the language L = {σ ∈ {x, y, z} ∗ | 2|σ|x = |σ|y ∨ 2|σ|y = |σ|z} You can choose whether your PDA accepts by empty stack or final state, but make sure you clearly note, which acceptance is assumed.
Construct a PDA (pushdown automata) for the following language L={0^n 1^m 2^m 3^n | n>=1, m>=1}
6. Consider a Pushdown Automata with TWO STACKS. Show that this machine is more powerful than a single stack PDA. (Use the language L = {a"\"c"which is not a CFL. Explain bow a two stack automata can accept this language.) HINT : Give a table representation of the 2PDA - it should have 7 columns : state, input, stack 1, stack 2, new state, stack 1 operation, stack 2 operation.
Give a context free grammar for the language L where L = {a"bam I n>:O and there exists k>-o such that m=2"k+n) 3. Give a nondeterministic pushdown automata that recognizes the set of strings in L from question 3 above. Acceptance should be by accept state. 4. 5 Give a context-free grammar for the set (abc il j or j -k) ie, the set of strings of a's followed by b's followed by c's, such that there are either a...
Consider the language defined over the alphabet Σ (0, 1): [10] 2nin i. Show that L1 is context-free by specifying a CFG Gi for L1 ii. Convert the CFG Gi to a pushdown automaton Pv that accepts L1 by empty 12 stack iii. Give a pushdown automaton PF that accepts L by final state
1. Give a context-free grammar for the set BAL of balanced strings of delimiters of three types (), and . For example, (OOis in BAL but [) is not. Give a nondeterministic pushdown automata that recognizes the set of strings in BAL as defined in problem 1 above. Acceptance should be by accept state. 2. Give a context free grammar for the language L where L-(a"b'am I n>-o and there exists k>-o such that m-2*ktn) 3. Give a nondeterministic pushdown...
Show that L = {anbm : m ≥ n +3} is deterministic. This is for formal languages and automata... Can you please try to explain what you are doing and why (if necessary, if not ill try my best to figure it out.) The definitions i'm working based off of are posted as a image below. Thanks! DEFINITION 7.3 A pushdown automaton M-О. Е, Г, 0, qo, z, Fİs said to be deterministic ifit is an automaton as defined in...
3. [5 marks] Is the language L = {o € {a, b}* | |0la- l0b is divisible by 2",n 2 1} regular? Be sure to prove your answer 3. [5 marks] Is the language L = {o € {a, b}* | |0la- l0b is divisible by 2",n 2 1} regular? Be sure to prove your answer
(10] Eliminate left recursion from the grammar A Ba |Aa c B Bb | Ab 1 d A Ad IB A BA ASJAE Consider the following grammar G: S'S S (S)S|e fa) (10] Construct the collection of the sets of LR(0) items (b) [5] When constructing the action table of SLR parser of G what are the rules to determine the parsing actions? That is, what is the rule for a shift action at state /? What is the rule...
Stacks and Java 1. Using Java design and implement a stack on an array. Implement the following operations: push, pop, top, size, isEmpty. Make sure that your program checks whether the stack is full in the push operation, and whether the stack is empty in the pop operation. None of the built-in classes/methods/functions of Java can be used and must be user implemented. Practical application 1: Arithmetic operations. (a) Design an algorithm that takes a string, which represents an arithmetic...