Programming Languages
Sample Final Exam
Question 1
Give a regular expression for each of the following languages over Σ = {0, 1, . . . , 9}.
1. All 5-digit integers that contain no leading zeros.
2. All positive integers that begin with 9 and that are multiples of 5.
3. All strings that begin with 9 and contain three consecutive 1s.
Question 2
Give a DFA for each of the languages in Question 1.