Question: Find a Regular Expression to describe the following language: {b, a, abc, ab, a 2 bc 2 , ab 2 , ..., a n bc

Find a Regular Expression to describe the following language: {b, a, abc, ab, a2bc2, ab2, ..., anbcn, abn, ...}

I am studying for a discrete math class, and we are currently learning about Regular Languages, Regular Expressions, and Finite Automata.

I am stuck on this problem because I don't know how to get the same number of "a" and "c" with a "b" in between, in the expression anbcn. At first, I was thinking the expression a*bc* would match, but I think since they are both raised to "n," this means they have to have the same number of a's and c's, which I can't find a way of doing.

A friend of mine who had the class a year ago said this might actually be a trick question, and that this is meant to showcase a limitation of the regular expressions, but he also said that he wasn't sure since it has been a long time since he took the class.

Please explain how you came up with the Regular Expression that matches this language, or if there is not one, please explain why. I would like to gain a deeper understanding of Regular Expressions, and be able to do more problems similar to this in the future. Thanks!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!