Question
1) Given the following English descriptions of a language, write a regular expression which defines the language, and draw a state diagram of the FA
1) 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}. a) The language consisting of all words having a number of a's that is a multiple of 3. b) The language consisting of all words that contain "babb". c) The language consisting of all words that end in "ba". d) The language consisting of all words that do not end in "ba".
2) 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.
3) One of the defining properties of regular languages is that they're recognized by DFAs. a) Write "every regular language can be recognized by some DFA" as a first-order formula, and find its complement, contrapositive, and dual. Express each of these as both a first-order formula and a written description in English. b) What can we infer about non regular languages from this?
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