Week 2 - CFG versus FA Flashcards

1
Q

TRUE OR FALSE: A DFA can be converted into a CFG.

A

TRUE, any DFA has an equivalent CFG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you convert a DFA to a CFG.

A

Give every state a variable name. Each state rule has a rule for each forward transition it has. The left hand side of the rule is the state variable name, and the right hand side is the transition label concatentated onto the variable name of the state it transitions to. Once you have all these rules, add one more rule which substitutes the final state variable for an ε.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

TRUE OR FALSE: A regular language is a context-free language.

A

TRUE, because you can convert a DFA to a CFG.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TRUE OR FALSE: There are context-free languages that are not regular.

A

TRUE.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly