Question

In: Computer Science

Provide an informal description and state diagram of pushdown automata for the following languages, with the...

Provide an informal description and state diagram of pushdown automata for the following languages, with the alphabet {a, b}

A) {w | w = (a^i)(b^j) where i > j > 0}

B) {w | w contains an even number of b's}

C) {w | (a^k)bbb(a^k) where k >= 0}

D) {w | w=(b^k)a(b^k)(a^j)(b^j) where j, k >= 0}

Solutions

Expert Solution

Solution of A) : Push all a's onto stack and then pop one a for each b. If there is at least one a on stack then the string will be accepted.

Solution of B) : There has to be one b for each b. i.e when a comes as input symbol do not perform any operation and when b comes as input symbol, push it first time and pop it second time.

Solution of C) push all a's onto stack first. Then count 3 b's and then pop one a for each input symbol a.

Solution of D) : Initially push all b's onto stack. One a is seen as input symbol, start pop operation for each b as input string. pop one b for each input symbol b. Then count number of a's and number of b's using stack. If at the end there is no symbol on stack and no input symbol remains then accept the string.

If you have any doubts, you can ask in comment section.


Related Solutions

(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting...
(a) How Context Free languages are different from Regular languages. (b) What are the automata accepting those languages and how they are different from DFA and NFA. (c) How the grammar of Context Free Languages looks different from those in Regular languages.
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA in which set of all strings can be accepted which end with ‘a’ DFA in which set of all strings can be accepted which start with ab DFA in which set of all strings can be accepted which contain ab DFA in which set of all strings can be accepted which ends with ab
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA...
Automata Theory and Formal Languages Instructions: Draw the DFA (Deterministic Finite Automaton) of the following: DFA for binary number divisible by 2 DFA for binary number divisible by 3 DFA in which set of all strings can be accepted which start with a DFA in which set of all strings can be accepted which contains ‘a’
Provide the complete valence bond description for C2H4 with a orbital diagram showing overlap
Provide the complete valence bond description for C2H4 with a orbital diagram showing overlap
1. (a) State if the sign in (+) or (-) for the following description.
  1.       (a) State if the sign in (+) or (-) for the following description.                       Q is (      ) if the test tube is getting hot.                         W is (      ) if the system is expanding.                         W is (      ) if the work is done by the surrounding on the system.                         H is (      ) if the reaction is endothermic.                         S is (      ) if solid sublimes.                         G is (      ) if the reaction is...
Description: In this assignment, you will implement a deterministic finite automata (DFA) using C++ programming language...
Description: In this assignment, you will implement a deterministic finite automata (DFA) using C++ programming language to extract all matching patterns (substrings) from a given input DNA sequence string. The alphabet for generating DNA sequences is {A, T, G, C}. Write a regular expression that represents all DNA strings that begin with ‘A’ and end with ‘T’. Note: assume empty string is not a valid string. Design a deterministic finite automaton to recognize the regular expression. Write a program which...
Diagram the classical pathway of complement activation. Include terminal pathway. Provide a brief description of major...
Diagram the classical pathway of complement activation. Include terminal pathway. Provide a brief description of major events at each step
Are the following languages regular languages or not ? Justify your answer with a proof. ?...
Are the following languages regular languages or not ? Justify your answer with a proof. ? = {? | ? represents an integer strictly greater than 2020}, on alphabet Σ = {0,…,9}. ? = {? | |?|a > |?|b} on alphabet Σ = {a,b} ? = {? | ? is the code of a LOOP program syntactically correct } ? = {02?| ? ∈ ℕ} sur alphabet Σ = {0}.
Write a program that implements the pseudocode ("informal high-level description of the operating principle of a...
Write a program that implements the pseudocode ("informal high-level description of the operating principle of a computer program or other algorithm") below: 1. Ask the user for the size of their apartment in square meters (size) 2. Convert the size to square feet using the formula: convertedSize = size * 10.764 3. Print out the converted size. Have meaningful prompts and meaningful explanation of any numbers printed.
In what respects does a UML state diagram differ from a state transition diagram?
In what respects does a UML state diagram differ from a state transition diagram?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT