Prove that the following are not regular languages ONLY c pl
Prove that the following are not regular languages. ONLY c please,
Prove that the following are not regular languages. {0^n|n is a perfect square}. {0^n| is a perfect cube}. {0^n |n is a power of 2}. The set of strings of 0\'s and 1\'s whose length is a perfect square. The set of strings of 0\'s and 1\'s that are of the form ww, that is, some string repeated. The set of strings of 0\'s and 1\'s that are of the form ww^R, that is, some string followed by its reverse. (See Section 4.2.2 for a formal definition o the reversal of a string.) The set of strings of 0\'s and 1\'s of the form wur, where w is formed from w by replacing a 0\'s by 1\'s, and vice-versa; e.g., 011 = 100, and 011100 is an example of a string in the language. h) The set of strings of the form w1^n where w is a string and 1\'s of of 0\'s length n.Solution
L = {0n | n is a power of 2}
Proof:
lets suppose L is regular, then there is a dfa, M, with k states accepting L.
Consider z = 0m where m = 2k
since |z| = 2k >= k, by the pumping lemma we can write
z = u v w with |u v| <= k, length(v) >0 and uviw is also in L for all i >= 0.
Since |u v| < k and length(v) >0, 0’s in v are between 1 and k.
1 <= |v| <= k
So 2k + 1 <= |u v v w| < 2k + k <= 2k + 2k = 2k+1
So u v v w has length between 2k + 1 and 2k + k.
So |uvvw| cannot be a power of 2 and thus uvvw is not in the language.
Therefore L is not regular.
