Question: 5 . [ 4 marks ] Suppose that a DFA M = ( Q , , , q 0 , F ) accepts an infinite
marks Suppose that a DFA M Q q F accepts an infinite number of strings. Prove there is some string ww wn where Q n Q such that is accepted by M
marks Prove that the following language is not regular:
L ww wnbn n and each wi in a b
For example, the strings bababbbb and abbbbb are both in L
marks Consider the regular language L corresponding to the regular expression ab Explain what is wrong with the following proof that L is nonregular.
Assume that L is regular. Let p be the pumping length. Consider the string
s abp in L It has length greater than p Consider s xyz where x a and
y b and z abp Then xyyz ab b abp However, this string is not in
L contradicting the Pumping Lemma. Thus, L is not regular.
marks Give CFGs that generate the following languages over a b:
aw w is nonempty and starts and ends with the same symbol
bb and are strings with the same number of as
cw w has the same number of as as bs but is not of the form bnan for n
Hint: c does not include the empty string. Tweak the reasoning for generating
the same number of as as bs
marks Before the upcoming elections, a CS professor lays awake wondering: When the ballots are enumerated, will candidate x always be tied or ahead of the other candidate y Call such a nonempty sequence of ballots a ballot sequence. For instance xxyyx is a ballot sequence, but xxyyyxx is not. Prove that the set of all ballot sequences is a contextfree language by providing a corresponding CFG
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
