wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following statements:
I. If L is a regular language then the set of strings in L of odd length is also a regular language.
II. If L is a regular language then the set of strings in L of even length is also a regular language.
Which of the above statements is/are true?

A
None of these
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
Both I and II
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
C
Only I
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Only II
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is B Both I and II
Let L be any language and let Even(L) and Odd (L) be
Even (L) = the set of strings in L of even string.
Odd (L) = the set of strings in L of odd string.
Then note that Even(L) = LEven*
Also note that Odd(L) = L Odd *

So, if L is regular then Even(L) and Odd(L) will also be
both regular and regular languages are closed under intersection.

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Understanding Divisibility
Watch in App
Join BYJU'S Learning Program
CrossIcon