Regular expression for the language of an odd number of 1s

What is the regular expression for the language of an odd number of 1s?

Regular expression for the language of an odd number of 1’s is given below.

R.E = 010(01010)

Now, let’s discuss that what strings should be accepted or rejected by our Regular Expression.

Accepted Strings
You should check some small, some medium and some large size strings that are part of the language and all of them(100% strings) should be accepted by our R.E.
Small strings:

1, 01, 10, 010, 001, 100, 111, 1011 …… and all such strings that contain odd numbers of 1’s in the strings.

Medium size strings:

100100001, 11000001, 10110011,……and all such strings that contain odd numbers of 1’s in the strings.

Large size strings:

100000000100000001, 110001011100100000,…….and all such strings that contain odd numbers of 1’s in the string.

 

Rejected Strings
You should check some small, some medium and some large size strings that are not part of the language and all of them(100% strings) should be rejected by our R.E.
Small strings:

0, 00, 11, 011, 101, 100, 110, 1111 …… and all such strings that are not part of our language( does not contains odd numbers of 1’s in the strings).

Medium size strings:

1000001, 0100100101, 111100011 …… and all such strings that are not part of our language (does not contains odd numbers of 1’s in the strings).

Large size strings:

100000000100000011, 110001011100110000,…….and all such strings that do not contain odd numbers of 1’s in the string(not part of the language).

Topic Covered: 

Regular expression for the language of an odd number of 1s.
  List of All Regular Expression examples : Click Here 
.

Fazal Rehman Shamil
Welcome to all friends. The reason for our success is only your love for T4Tutorials. Our team is always available to answer your queries regarding any kind of confusions or discussion regarding your study and career matters. For discussion with us please join our facebook group "T4Tutorials.com". The link of the group is mentioned below. Thanks and love to all for connecting with us. We are nothing without you. Love you all.....
https://web.facebook.com/groups/2066136233601097/

Leave a Reply