Question
Given the following English descriptions of a language, write a regular expression which defines the language, and draw a state diagram of the FA which
Given the following English descriptions of a language, write a regular expression which defines the language, and draw a state diagram of the FA which accepts the language. For all languages, let = {a, b}.
1) The language consisting of all words which have an even number of a's. 2) The language consisting of all words which contain "abb". 3) The language consisting of all words which end in "ba". 4) The language consisting of all words which do not end in "ba".
5) John is training for a marathon and he can easily alternate between running a mile and walking a mile. If he runs for 2 miles in a row, he becomes fatigued, and must then walk for 2 miles in a row in order to no longer be fatigued. When he is fatigued, he can still alternate between running a mile and walking a mile, but if he runs 2 miles in a row while already fatigued, he will collapse on the side of the road. If he runs 3 miles in a row at any point, he will also collapse. Let the letter 'a' stand for John running 1 mile, and the letter 'b' stand for John walking 1 mile. Draw a DFA which accepts all possible runs in which John does not collapse on the side of the road.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started