Let Σ = {0, 1}. Give a regular expression that expresses the language {w | w contains exactly two 0s}.
Here I am providing the regular expresssion for the given question.
Given that the language {w | w contains exactly two 0s}
That means we can have any number of 1's and 0's should be exactly 2
some possible strings are,
00,1010,001,100,1100,1001 etc.
So, The Regular Expression is : 1*01*01*
by using this expression we can generate different strings which starts with 0,ends with 0,starts with 1,ends with 0etc. But most important thing is that it will always contain 2 0's which is required solution.
Get Answers For Free
Most questions answered within 1 hours.