Could you please help me with this question?
Consider the language C = { w ∈ {a, b} ∗| w contains at least as many as as bs }
For example, ǫ, aaa, aba, and bbaababaa are all in C, but bbb and bbaaabb are not.
a. Construct a 3-state push-down automaton to recognise C. Provide the solution as a transition diagram.
b. Prove formally that the following context-free grammar G generates C
S → ǫ | a | a S b | b S a | S S
Hint: Proceed in two steps; prove that every string in L(G) is in C (by structural induction) and prove that every string in C is in L(G) (by induction on the length of the string).
Could you please help me with this question? Consider the language C = { w ∈...
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.
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...
Automata: solve a - e
2. (10+10+10+10+10-50 points) Agrammar is a 4-tuple G, G-ON,E,11,L$) where N is a finite set of nonterminal symbols Σ is a finite set of terminal symbols is a finite set of rules S is the starting symbol Let N- (S, T s-{a, b, c} s-> ab aT >aaTb aT-ac S is the starting symbol. (a 10 points) Prove that the given grammar G is a context sensitive grammar. (b-10 points) What is the language L-...
A grammar is a 4-tuple G, G = (Ν, Σ, Π, Σ, S) where, Ν is a finite set of nonterminal symbols, Σ is a finite set of terminal symbols, Π is a finite set of rules,S is the starting symbol. Let, Ν = {S, T} Σ = {a, b, c} Π = { S -> aTb S -> ab aT -> aaTb aT -> ac } S is the starting symbol. A) Prove that the given grammar G is...
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...
1. Construct a DFSM to accept the language: L w E ab): w contains at least 3 as and no more than 3 bs) 2. Let E (acgt and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg. ge. Construct both a DFSM to accept the language and a regular expression that represents the language. 3. Let ab. For a string w E , let w denote the string w with the...
Additional 9-13 Prove that the language {w#w|w is a string over the alphabet {a,b,c}} is not regular Tip: here are some strings in that language: abbc#abbc a#a aaa#aaa aaab#aaab cab#cab
formal language automata
1. (15p) Consider the Context-free grammar G defined by: S → 0A1A1A1A A0A1A a) Describe L(G). (5p) b) Convert G into a Pushdown Automaton (PDA). (10p)
Question 4 (a) If = {0,1,2}. What is »?? What is the cardinality of 54? (b) Build a finite automaton that accepts every binary string that contains 101. (c) Write a regular expression for the language of all binary words that does not contain ab. (d) What is the language of the following regular expression b*a*b*a* ? Give three words that are and three words that are not in this language. (e) Give a context-free grammar G such that L(G)...
1. Construct a DFSM to accept the language: L = {w € {a,b}*: w contains at least 3 a's and no more than 3 b's} 2. Let acgt} and let L be the language of strings consisting of repeated copies of the pairs at, ta, cg, gc. Construct both a DFSM to accept the language and a regular expression that represents the language 3. Let a,b. For a string w E ', let W denote the string w with the...