8: Tutorial Stuff Flashcards

1
Q

How do you convert an NFA to a DFA?

A

To make a DFA M from an NFA N = (A, S, F, s0, T). The alphabet of M is A.

  1. Begin with a new start state S0 labelled by {s0} ∪ {s : there exists a path labelled only by ϵ-arrows from s0 to s}.
  2. For each newly constructed state Si, and for each a ∈ A:
    (a) For each s ∈ Si, find all states s’ that can be reached from s by reading (ϵ ^ i)a(ϵ ^ j) (for any i and j).
    (b) Let Sj be the set of all of these states s’. (The set Sj may be the empty
    set ∅) Put an arrow labelled a from Si to Sj .
  3. Repeat Step 2 until every new state Si has one arrow leaving it for each letter a ∈ A.
  4. Make each state Si that contains at least one state from T into an accept state for M.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you convert from a regular expression to a language?

A

You can just define the language as being equal to the regular expression, e.g. L((a + b* + ϵ)(c + d)) or L2 = 010.

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

How do you convert a language to an NFA?

A

??

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

How do you convert from a language to a regular expression?

A

By breaking down the parts of each word into atomic subsections before notating them as a regular expression. Note only regular languages can be converted into regular expressions.

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

What is Kleene’s theorem?

A

A language is described by a regular expression if and only if there is a DFA which defines it.

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

What is the proof of Kleene’s theorem?

A

??

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

How can you use Kleene’s theorem to convert from automata to regular expressions (of the languages they accept)?

A

??

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

How can you use Kleene’s theorem to convert from languages to automata?

A

??

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

How do you prove if a language is regular?

A

Find a regular expression to express it to show it to be regular, or use the pumping lemma to show it isn’t.

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

How do you convert from a language to a PDA?

A

??

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

What are derivations of CFGs?

A

??

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

How do you find CFG derivations?

A

??

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

How do you convert from languages to CFGs?

A

??

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

How do you convert from a CFG to a PDA?

A

??

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

How do you show whether a language is context-free?

A

??

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

How do you convert from a language to a TM?

A

??

17
Q

How do you prove a TM is a decider?

A

Show it halts within finite time; consider how it will iterate over its tape/s for different possible inputs and consider if there could ever be a condition in which it will loop repeatedly, at some point returning to the same state, tape contents, and tape head position. If not, it is a decider.

18
Q

How do you encode a DFA and its input words?

A

??

19
Q

Prove that given two DFAs, A and B, there exists a length N such that if A and B accept the same strings up to length N then L(A) = L(B).

A

??

20
Q

How do you show if a language is decidable?

A

Show there is a decider TM that accepts it.

21
Q

What is Rice’s theorem?

A

Let P be a nontrivial property of the languages recognised by Turing machines. Then the following language is undecidable:

LP = { | M satisfies P}.
That is, there is no algorithm to decide whether a TM satisfies P.

22
Q

How do you prove a language is in P?

A

??

23
Q

How can you tell if the Master Theorem applies to an algorithm?

A

If it is of the general form of 𝑇(𝑛) = 𝑎 ⋅ 𝑇 (𝑛 / 𝑏) + 𝑓 (𝑛)

Where 𝑎 ≥ 1 and 𝑏 > 1 are constants, and 𝑓 (𝑛) is asymptotically positive.

24
Q

How can you use the Master Theorem to find a Θ(n) bound for the growth rate of an algorithm to which it applies?

A

??

25
Q

How do you find the time complexities of an algorithm?

A

??

26
Q

How do you show a graph is in P?

A

??

27
Q

What does it mean for a set of algorithms to be closed?

A

A set is closed under an operation if the operation returns a member of the set when evaluated on members of the set.

28
Q

What does PSPACE mean?

A

PSPACE is the set of all decision problems that can be solved by a Turing machine using a polynomial amount of asymptotic space.

29
Q

What does PSPACE-hard mean?

A

A problem is PSPACE-hard if it has a reduction in polynomial time from every problem in PSPACE to the problem. This means that if we can solve the problem, then we can solve any other problem in PSPACE.

30
Q

How do you find a reduction between 2 algorithms?

A

??