Regular Languages – Pumping Lema

For this assessment we only consider languages over the alphabet {0,1,2}. We also view words over this alphabet as ternary numbers, e.g. 112 corresponds then to the decimal number 14 (1*9+1*3+2*1), and the decimal number 112 corresponds to the ternary 11011 (1*81+1*27+0*9+1*3+1*1). For the following languages give either a regular expression that describes them, or a proof that the language is not regular. Note that e.g. the set of integers {4,7,11} (in decimal notation) becomes in this view the language {11,21,102}. a. the set of all words that contain more 1s than 2s. b. the set of all words such that the sum of the number of 0s and 1s occurring in it is an even number, e.g. 222, 02010 would be two such words, 2122 and 0201021 would not be such words. c. the set of odd numbers. For example, the words 1,12, 210 would be in the language, since they equate to the decimal numbers 1, 5 and 21, because for example 2*32+1*31+0=21. d. the set of all finite substrings of the infinite string e. 012001122000111222000011112222... For example, 0120 and 20001 are substrings of it, 0122 and 111220 are not.