# Regular expression for the language of an odd number of a

## What is the regular expression for the language of an odd number of as?

A regular expression for the language of an odd number of a’s is given below.

Regular expression = bab(babab)

Now, let’s discuss 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: a, ba, ab, bab, bba, abb, aaa, abaa…… and all such strings that contain odd numbers of a’s in the strings. Medium size strings: baabaaaab, bbaaaaab, babbaabb,……and all such strings that contain odd numbers of a’s in the strings. Large size strings: abbbbbbbbabbbbbbba, aabbbabaaabbabbbbb…….and all such strings that contain odd numbers of a’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: b, bb, aa, baa, aba, abb, aab, aaaa …… and all such strings that are not part of our language( does not contains odd numbers of a’s in the strings). Medium size strings: abbbbba, babbabbaba, aaaabbbaa…… and all such strings that are not part of our language (does not contains odd numbers of a’s in the strings). Large size strings: abbbbbbbbabbbbbbaa, aabbbabaaabbaabbbb,…….and all such strings that do not contain odd numbers of a’s in the string(not part of the language).

## Tutorial: Regular Expression

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

• Give a regular expression.
• Describe the strings of the regular expression.
• write a regular expression.
• create all strings from regular expression.
• Generate all strings from regular expression.
• Extract all strings from regular expression.
• Find all strings from regular expression.
• Examples of regular expression.