Week 1 and 2 - Regular Expressions and Automata Flashcards

1
Q

What does the regular expression E match to?

A

the empty word

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

What does the regular expression a|b match to?

A

the word a or the word b

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

What does the regular expression a* match to?

A

any number of the word a in a row, including 0 of them

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

What does the regular expression 0 match to?

A

nothing

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

What does the regular expression a+ match to?

A

aa*

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

What does the regular expression a? match to?

A

E | a

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

What is an automata?

A

An automata is used to check if a word matches to a regular expression. Automata are made up of states and transitions. Starting at the initial state, move along the relevant transition for the current letter until you reach the end of the word.

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

When does an automata reject a word?

A

If the word finishes on a non-accepting state or there is no transition for it to take.

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

What are epsilon transitions in an automata?

A

Transitions that can be taken without consuming the current letter. Therefore can be taken even if there are no letters remaining.

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

How do you remove an epsilon transition from an automata?

A

Duplicate all of the transitions that start from vertex V2 on to V1.
If V1 is a start state, make V2 a start state.
If v2 is an accepting state, make V1 an accepting state.

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

What does it mean if 2 DFAs are language equivalent?

A

They both accept the same langauge

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

What needs to be true for an automata to be minimal?

A

Every state is reachable

Each state much have a unique set of letters that transition to an accepting state.

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

How do you minimise an automata?

A

Put all of the accepting states in a set in one accepting state and put all the rejecting states in a set in one rejecting state.
Add the transitions from between the 2 states.
Add any transitions that would keep you in one of the new states, if you would end up making an NFA, split up the state in multiple different states.

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