-
Consider the following two statements:
S1 - {02n | n ≥ 1|} is regular language.
S2 - {0m 1n 0m + n | m ≥ 1 and n ≥ 1|} is a regular language
Which of the following statements is correct?
-
- Only S1 is correct
- Only S2 is correct
- Both S1 and S2 are correct
- None of these
- Only S1 is correct
Correct Option: B
Lets consider both the statements separately to find the correct option.
S1 : {02n | n ≥ 1|}
Applying the values of n,
→ S1 = 00, 0000, 000000, ............ The behaviour shown by the output is regular and hence, the language is a regular language.
S2 : { 0m 1n 0m + n | m ≥ 1 and n ≥ 1| }
Applying the values of m and n,
S2 = 0100, 00110000, 000111000000, .........
Here the values of m and n are kept same so thay are showing the output in symmetry but if we use the different values of m and n then the output will display a behaviour which is not regular. Therefore, confirmed is that S1 is a regular language.