Give a regular expression for the set of all strings on the alphabet {0,1} with no runs of length greater than 3(for example, no substrings 0^i or 1^i with i > 3)
(1) Given that the input symbol is {0,1}.
(2)Given condition is that the length of the string must not be greater than 3.
(3)The language for the given condition is given as L = { epsilon, 1, 0, 11,00,10,01,000,111,100,110,001,011,101,010}.
(4)The length of the minimum string is 0.
(5)So the regular expression for the string of length 0 is "epsilon".
(6)Now, the length of the string cannot be greater than 3.
(7)Therefore, the regular expression is given as (epsilon+0+1) (epsilon+0+1) (epsilon+0+1) .
Get Answers For Free
Most questions answered within 1 hours.