• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/58

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

58 Cards in this Set

  • Front
  • Back

Are regular languages closed under complement?

Yes

Are regular languages closed under union?

Yes

Regular languages closed under complement?

Yes

Regular languages closed under concatenation?

Yes

Regular languages closed under kleene star?

Yes

Do you remember how to do the product of two automata?

Hopefully yes. M3 has states (a,b) where a is a state from M1 and b is a state from M2 for all combinations. So M3 = run M1 and M2 in parallel.

Is the empty set regular?

Yes

Is the set of all strings regular? (Sum symbol stared)

Yes

Do you remember how to do subset construction? NFA to DFA?

Hopefully yes.

Epsilon NFA to regular NFA how is delta' redefined?

Delta'(q,inp) = {q'|q(=>epsilon)(=>inp)q'}



Or transition state given input goes to any state where there is transition via that input (and epsilon) from given state to that new state.

Epsilon NFA to regular how is F' redefined?

F' = {q|exists: f in F and q(=>epsilon)f}



Final states are states already in F and states with a epsilon transition from them to a state in F

What is kleene's theorem

If a is a reg expression the L(a) is a regular language. If L is a regular languages then L=L(a) for some regex a.

Do you remember how to make an automata for the union of two languages?

Have a new start state with an epsilon transition to the start state of each language.

Do you remember how to make an automata for the concatenation of two languages?

If both are NFAs. Add an epsilon transition from M1s final states to M2s start state.



Or use Kleene's and turn them into regex

Do you remember how to make an automata for kleene start of a language?

Add a new state which accepts and is the start state. Add an epsilon transition from this to the original start state and also epsilon transitions from all original accept states to this state.

Go an revise the automata to regex inductive process

It's confusing

Do you remember how to go from an epsilon NFA to a regular NFA? (General process)

Make states with epsilon transitions to final states final.


Add new transitions where you can go somewhere with one input and any number of epsilon.

How do you easily prove that not all strings are regular?

With counting. There is countably many regular expressions over a language but uncountably many languages over the language.



Aka countably many strings but uncountably many sets of strings.

Go practice the pumping lemma more

You know you need to

All finite languages are...

Regular

Easy way to prove a finite language is regular?

Suppose L ={x1,....,xl} is a finite set of strings accepted by the language. Give the regular expression x1 + ... + xl that matches up with this set. Kleene's theorem states regular expressions define regular languages so having a regex for the language means it is regular.

Time complexity of a Turing machine?

The number of steps

Space complexity on a Turing machine

Amount of additional memory required, measured in cells on the tape

Define a decision problem

A problem where the answer is either yes or no

Define asymptotic upper bound (big O)

F(n) <= cg(n) for all n>=n0



Where c>0, n0>0

Define strict asymptotic upper bound (small o)

Lim n->infinity f(n)/g(n) = 0



So root n is strict o(n)


But (n-1)^2 is not strict o(n^2) even though it is O(n^2)

Multi to single tape Turing machine what happens to time complexity

Multi tape is t(n)


Then single tape is O(t^2(n))

Multi to single tape Turing machine steps and why the time complexity changes the way it does

K tape machine to single tape machine M'


Tape of M' structured into racks


Special markers on M' to mark tape heads


A single step of M requires:


Find positions of heads and read


Update tape content and head pos



M has at most t(n) steps


Running each step takes O(t(n)) time



So overall t(n) * O(t(n)) = O(t^2(n)) steps.


Note copying down take O(n) so is negligible

Describe how to make a DTM from a NTM

The deterministic machine checks all branches of the NTM breadth first. If it reaches a reject state it stops that branch and tries the next. If find accept, accept. If not will loop.



It has one tape for the input (Input tape)


One tape to simulate a branch up to a given depth (simulation tape)


And one tape to remember the branch being simulated. (Adress tape)

What is the defenition of recursively enumerable

A language is rec en if and only if some Non-deterministic TM accepts it

Do all NTMs have equivalent DTMs

Yes.

How to modify a DTM made from a NTM so that it halts if all branches of N halt on the input

Remember branches that halt on a 4th tape


Do not explore those branches again


If no branches left, reject.



With this method if N is a decider, the new machine is Total

What is the defenition of a recursive language

A language is recursive if and only if some non deterministic TM decides it

What happens to time complexity when moving from a NTM to a DTM

If the NTM runs in t(n) the DTM runs in 2^(O(t(n))) two to the big O t(n)

How do you know the time complexity of a DTM made from a NTM

1) how many branches will it need to simulate


2) how much time to simulate one branch



Each branch is at most length t(n)


Each node has at most b children


Hence b^(t(n)) leaves and O(b^(t(n))) nodes/ partial branches.



Multiply these: t(n) * b^(t(n))


Which is 2^(O(t(n)))

What is the time complexity of a DTM made from a O(n) NTM

2^O(n)

Define P

The class of languages which can be decided by a deterministic single tape Turing machine in polynomial time

What is the church Turing thesis

Any machine in a Turing complete computational model can be emulated by a machine in any other Turing complete computational model

What is the strong church Turing hypothesis

The basic operations of the first model can be emulated with a polynomial number of operations of the second model

Algorithms vs Turing machines. Uh its that example of the church Turing stuff idk

Copying a string of length n



Takes O(n) on a random access machine


Takes O(n^2) on a Turing machine



Key observation: copying the string on a RAM model can be emulated in polynomial time on a TM

Define the PATH problem

Given a directed graph does there exist a directed path connecting two given nodes

Define HAMPATH problem

Given a directed graph does there exist a directed path connecting two given nodes that goes through each node exactly once.

Give the steps for polynomial time PATH

On input G,s,t



1) place a mark on node s


2) repeat 3 until no additional nodes are marked


3) scab all edges of G. For each edge (a,b) if a is marked then mark b


4) If t is marked then accept otherwise reject.

What is the time complexity of the HAMPATH verifier

Polynomial

Every language in P is...

Recursive

Every regular language is in...

P

Every context free language is...

In P.



There is a proof for this learn if you have time?

The problem RELPRIME is in... based on...

P based on length of the encoding of the input

Define a verifier (maths like)

L = {w | V accepts (w,c) for some string c}



If V accepts w,c then c is called certificate of w in L

Describe the algorithm for HAMPATH verifier

1. Check for repetitions in the list of nodes in the candidate solution (c)


2. Check if the first node in c is the start and the last is the end


3. For each node check there is an edge connecting it and the next one

Define the class NP

Languages that have polynomial time verifiers e.g. HAMPATH



Or languages that can be decided by non deterministic Turing machines in polynomial time

Non deterministic HAMPATH

Use the verifier algorithm except instead of the candidate solution use non deterministicly chosen set of nodes

Define NTIME

All languages that can be decided by an O(t(n)) time non deterministic Turing machine

Algorithm for SAT with a NTM

Non deterministically choose values 0/1 for all variables


Evaluate using those values


If true accept otherwise reject

Define the TSP(D) problem

Travelling salesperson decision version: given a number D and n cities with given distances between them. Is there a circular route that visits each city exactly once with total distance of at most D

What group is TSPD in

NP

What group is 3COL in

NP

Is HAMPATH NP complete

Yes