L = { w | w ∈ {a, b}* and a(w) != b(w) }.
Implement the pushdown automaton A in python
Pushdown Automata that accepts the given language is as follows:

Above PDA is implemented below:
CODE:
def PDA(string):
Stack = ['Z']
for s in string:
TOS = Stack[-1]
if (s == 'a' or s == 'b') and TOS == 'Z':
Stack.append(s)
if (s == 'a' and TOS == 'a') or (s == 'b' and TOS == 'b'):
Stack.append(s)
if (s == 'a' and TOS == 'b') or (s == 'b' and TOS == 'a'):
Stack.pop()
if Stack == ['Z']:
return 'REJECTED'
else:
return 'ACCEPTED'
s1 = 'ababab'
s2 = 'baba'
s3 = 'abbba'
s4 = 'abbbbbbbbbbaaaaaa'
print(s1,":",PDA(s1))
print(s2,":",PDA(s2))
print(s3,":",PDA(s3))
print(s4,":",PDA(s4))
OUTPUT:
![def PDA (string): stack = [,2] for s in string: TOS stack[-1] = Stack.append(s) if (s == a, and TOS . a.) or (s- , b. and TO](http://img.homeworklib.com/questions/7aef0280-8dcd-11eb-83c2-6dd9ed13706e.png?x-oss-process=image/resize,w_560)
AUTOMATA Given the language L, L = {w | w ∈ {a, b}* and w starts and ends with the same symbol} (a) Define the context free grammar G that generates the formal language L. (b) Define the deterministic pushdown automaton A that recognize the formal language L.
Let M be a pushdown automaton and let L ⊆ A∗ be a language such that L = L(M). Prove that if the length of the stack never exceeds a fixed number k ∈ N, then L is a regular language.
Construct a pushdown automaton to accept the following language L = { axbycz where x,y,z >= 0 }
Construct a deterministic finite-state automaton for the language L = {w ∈ {0, 1} | w starts with but does not end with 010}
Prob 2. Implement the logic function Y = (Ā + B)D in static CMOS. a) Size the transistors so that the output resistance is the same as that of a an nMOS (W/L-0.4/0.18) and pMOS (W/L-0.8/0.18). b) What input combination(s) result in the worst case tpiti.? c) Determine the worst case tpl for a 100 iF load capacitance. Use equivalent resistance model, Req
Prob 2. Implement the logic function Y = (Ā + B)D in static CMOS. a) Size the...
Please solve it with explaining.
Exercise4: Consider the language L on Σ= {0.1 } with L-(w such that w starts with l and ends with 00 } 1. Find 3 strings accepted by the automaton 2. Show that the language L is regular
Theory of Computation
need ASAP 2-3 hours
1. For the following grammar: a) Give an example of a string accepted by the grammar. b) Give an example of a string not accepted by the grammar. c) Describe the language produced by the grammar. 2. Using the following grammar find a derivation for the string: 0001112 A0A1le C 0C2 | D Create a grammar for the language described by the following RE: Create a grammar for the following language: For the...
Write a program in python programming language using functions to implement/simulate a finite automaton that accepts (only): Signed and unsigned real numbers. // .12345, 1.2345, -12345., +12345E0, .12345E-10, 1.2345E+1, etc. Show: Finite Automaton Definition, Graph, Table
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