question 1.
a
If is regular and and is non-regular, then is regular
implies (intersection)
Given that , meaning there is a fixed number of string in ,therefore is finite. Given that all finite language are regular, will contain at-most -string, making regular
b
If is regular and is non-regular, then is regular
If where it only accepts the string , and , then , which is non-regular
c
such that is a non-regular language, such that is regular and
For all non-regular languages , they can be seen as a subset of . Given that is regular (a DFA with one accepting state), this means the aforementioned statement holds.
question 2.
a
accepts all strings which begin with but do not contain the substring

b

c

question 3.
Via production construction, create a DFA such that
:

:

state | a | b | dangling |
---|---|---|---|
0a | 1a | 3b | |
0e | 1e | 3e | ✅ |
1a | 2a | 4b | |
1e | 2e | 4e | ✅ |
2a | 0a | 4b | |
2e | 0e | 4e | ✅ |
3b | 4e | 3c | |
3c | 4e | 3d | |
3d | 4e | 3b | |
3e | 4e | 3e | ✅ |
4a | 4a | 4b | ✅ |
4b | 4e | 4c | |
4c | 4e | 4d | |
4d | 4e | 4b | |
4e | 4e | 4e |
table 1: product construction of
note: the state that are not used will be crossed out

question 4.
Question
NFA which accepts all string in which the third last character is an a. Then via subset construction create an equivalent DFA

state | a | b | note |
---|---|---|---|
0 | 01 | 0 | |
1 | 2 | 2 | not connected in DFA |
2 | 3 | 3 | not connected in DFA |
3 | not connected in DFA | ||
01 | 012 | 02 | |
02 | 013 | 03 | |
03 | 01 | 0 | |
12 | 23 | 23 | not connected in DFA |
13 | 2 | 2 | not connected in DFA |
23 | 3 | 3 | not connected in DFA |
012 | 0123 | 023 | |
013 | 012 | 02 | |
023 | 013 | 03 | |
123 | 23 | 23 | not connected in DFA |
0123 | 0123 | 023 |
table 2: subset construction for given NFA

question 5.
Question
Create a sound argument that the concatenation of two regular languages is also regular. Specifically, if and are regular then is also regular. This does not need to be a formal proof, but the argument should be very convincing.
Hint: if and are regular you can make “machines” for them; how would you make a “machine” for .
Given and are both regular languages, there exists and DFA and that recgonize and respectively
Let and
We can try to construct a NFA to recognize , where we combine both states of and via product construction, then we add -transition from every accepting state in to start state of
Conceptually, for a string , split
- If process in , reach accept states , then transition to , then process in , ending in
- if no valid splits, then it rejects the string
- for empty string: if then it can transition to , and vice versa.
Given that regular language are also closed under NFAs, if we can build a NFA which proves that is regular