Construct a Pushdown automaton that accepts the strings on alphabet {a,b,(, ) }, where parenthesis “(””)” matched in pairs. For example strings “((ab))”,”(a)b()” are in the language, while “((”,”(ab))” are not. Please determine if your PDA deterministic or nondeterministic. (With Proper Steps and explanation)
PLEASE DO NOT COPY PASTE THE ANSWER FROM OTHER SOLUTIONS, AND PROVIDE PROPER EXPLANATION AND STEPS.
( ), (( )), ( )( ) are the examples of valid pairs of
parenthesis which are supposed to the accepted by the PDA we are
meant to create.
), (, ( )), ( )( are the examples of invalid pairs of parenthesis
which are supposed to be rejected.
Here is the reuired PDA according to the requirements specified
in the question.
The PDA shown above is deterministic because every state is having
a transaction on every input. In the PDA given above,
Here, we are not making transaction to another state on seeing 'a' and 'b' because here we only need to concern about the parenthesis. This is what we are doing here:
The transition functions are as follows.
b.cc acle ciclcc C, 2/C20 (20/20 9,51€ (le Ecce ade b, cic a. 20/20 9,20/20 b. 20/20 720/20 (2 e zdro ), 2010 a 20/20 birolo
8690,(,0) 80%,2,2)=(2, 2) 8C%, C, Z) = Clo, cz.) Clo,CC) SC4, a. C) = (to, e) Scr, b, c) = (2,0) SClo, a, 2o) (2012) 8C%0.6, 2.) = (2, 2) - . SC4,7,9) (2,6) 8(9,2,0) =(4,() Sea, b, c) C4,C) SCU,(,0) (&o, () 8C1,,,Z) - Cis, z.) 8C93,6,2) (23, 20) SCP, 720) (93,2o) SCL, a, ro) (220) SC23, 6, 20) = (93120) 869, , 2) = (1,7) a string accepted. -
Constructed PDA in the image below
where each transition is a,b;c
a = input symbol
b = pop from stack (stack symbol)
c = push to stack
Also, Z is initial stack symbol and pushed into the stack from the beginning of automation.
This PDA is deterministic because there is only one transition for each pair of input symbol and stack symbol.
Construct a Pushdown automaton that accepts the strings on alphabet {a,b,(, ) }, where parenthesis “(””)”...
Describe a pushdown automata (PDA) that accepts palindromes over the alphabet {a,b}. Is your PDA deter-ministic or nondeterministic.
1. Consider the alphabet {a,b,c}. Construct a finite automaton that accepts the language described by the following regular expression. 6* (ab U bc)(aa)* ccb* Which of the following strings are in the language: bccc, babbcaacc, cbcaaaaccbb, and bbbbaaaaccccbbb (Give reasons for why the string are or are not in the language). 2. Let G be a context free grammar in Chomsky normal form. Let w be a string produced by that grammar with W = n 1. Prove that the...
Construct an DFA automaton that recognizes the following language of strings over the alphabet {a,b}: the set of all strings over alphabet {a,b} that contain aa, but do not contain aba.
4. Show that the pda constructed in Example 7.6 accepts the strings aabb and aaabbbb, and that both strings are in the language generated by the given grammar. EXAMPLE 7.6 Construct a pda that accepts the language generated by a grammar with productions We first transform the grammar into Greibach normal form, changing the productions to A bB, The corresponding automaton will have three states (go, 91,92), with initial state go and final state q2. First, the start symbol S...
Please actually answer it For both of the following languages, provide a grammar that generates it, an intuitive explanation why this grammar generates this language, and a graphical representation of a push-down automaton that recognizes this language. (a) The language of properly nested sets of parentheses over the alphabet G)). Note that the string (COO))) belongs to this language, while the string (O) () does not because the third closing parenthesis does not have a matching opening parenthesis. Provide a...
C++ please Programming Assignment #6 Help Me Find The Secret Message Description: This assignment will require that you read in an encrypted message from a file, decode the message, and then output the message to a file. The encryption method being used on the file is called a shift cipher (Info Here). I will provide you with a sample encrypted message, the offset, and the decrypted message for testing. For this project I will provide you main.cpp, ShiftCipher.h, and ShiftCipher.cpp....