By: Prof. Dr. Fazal Rehman | Last updated: March 3, 2022
A regular expression of the second last symbol is 1.
Regular Expression (1+0)*(10+11)
The set of strings where the second last symbol is 1. For example, in the case of string 100010 and 00100110010, the second last symbol is 1
FA for the language of strings of second last symbol is 1.
Rejectable strings (not part of the language)
These strings must be rejected by our Regular expression.
3 strings of length 1 ={ 0, 1, no more strings}
3 strings of length 2 ={00, no more string}
3 strings of length 3 ={101, 100, 001, and many more similar possible strings }
3 strings of length 4 ={1001, 1101, 1000,0001, … and similar possible strings }
3 strings of length 7 ={1010001, 1011000,1001001, ….. and many more similar possible strings }
3 strings of length 10 ={1010000000, 1010000001, 10100000011….. and many more similar possible strings }
3 strings of length 15 ={101000000011100, 101000000101000, 1010000010000001….. and many more similar possible strings }
3 strings of length 20 = {10100000001010000000, 10100000011010000001, 1010000010010100000100….. and many more similar possible strings }
3 strings of length 25 = {1010000000101000001111100, 1010111110000111001101100, 0000111100000001111000000……. and many more similar possible strings }
Much more similar possible
Acceptable strings (part of the language)
These strings must be accepted by our Regular expression.
3 strings of length 1 ={no string of length 1}
3 strings of length 2 ={11, 10 no more similar possible string of length 1}
3 strings of length 3 ={110, 111,o11 no more similar possible string of length 3}
3 strings of length 4 ={0010, 1111,0110,…… and many more similar possible strings}
3 strings of length 7 ={0110010, 0010110, 1100010,….. and many more similar possible strings }
3 strings of length 10 ={0001100010, 1100010110, 1100010110, 1110001010….. and many more similar possible strings }
3 strings of length 15 ={101000000011110, 101000000101010, 1010000010000011….. }
3 strings of length 20 = {10100000001010000010, 10100000011010000010, 1010000010010100000110….. }
3 strings of length 25 = {1010000000101000001111010, 1010111110000111001100110, 0000111100000001111000010…….}
Much more similar possible
Regular Expression (b+a)*(ba+bb)
The set of strings where the second last symbol is b. For example in the case of string baaaba and aabaabbaaba the second last symbol is b.
Rejectable strings (not part of the language)
These strings must be rejected by our Regular expression.
3 strings of length 1 ={ a, b, no more strings}
3 strings of length 2 ={aa, no more string}
3 strings of length 3 ={bab, baa, aab, and many more similar possible strings }
3 strings of length 4 ={baab, bbab, baaa,aaab, … and similar possible strings }
3 strings of length 7 ={babaaab, babbaaa,baabaab, ….. and many more similar possible strings }
3 strings of length 10 ={babaaaaaaa, babaaaaaab, babaaaaaabb….. and many more similar possible strings }
3 strings of length 15 ={babaaaaaaabbbaa, babaaaaaababaaa, babaaaaabaaaaaab….. and many more similar possible strings }
3 strings of length 20 = {babaaaaaaababaaaaaaa, babaaaaaabbabaaaaaab, babaaaaabaababaaaaabaa….. and many more similar possible strings }
3 strings of length 25 = {babaaaaaaababaaaaabbbbbaa, bababbbbbaaaabbbaabbabbaa, aaaabbbbaaaaaaabbbbaaaaaa……. and many more similar possible strings }
Many more similar possible
Acceptable strings (part of the language)
These strings must be accepted by our Regular expression.
3 strings of length 1 ={no string of length b}
3 strings of length 2 ={bb, ba no more similar possible string of length b}
3 strings of length 3 ={bba, bbb,obb no more similar possible string of length 3}
3 strings of length 4 ={aaba, bbbb,abba,…… and many more similar possible strings}
3 strings of length 7 ={abbaaba, aababba, bbaaaba,….. and many more similar possible strings }
3 strings of length 10 ={aaabbaaaba, bbaaababba, bbaaababba, bbbaaababa….. and many more similar possible strings }
3 strings of length 15 ={babaaaaaaabbbba, babaaaaaabababa, babaaaaabaaaaabb….. }
3 strings of length 20 = {babaaaaaaababaaaaaba, babaaaaaabbabaaaaaba, babaaaaabaababaaaaabba….. }
3 strings of length 25 = {babaaaaaaababaaaaabbbbaba, bababbbbbaaaabbbaabbaabba, aaaabbbbaaaaaaabbbbaaaaba…….}
A detailed tutorial of the regular expression is here in the link of regular expression tutorial. This page contains the practice questions of regular expressions with solutions.
Tutorial covering the topics