16
Recap CS605: The Mathematics and Theory of Computer Science

Recap CS605: The Mathematics and Theory of Computer Science

Embed Size (px)

Citation preview

Page 1: Recap CS605: The Mathematics and Theory of Computer Science

Recap

CS605: The Mathematics and Theory of Computer Science

Page 2: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Mathematical Preliminaries• Language Theory• Regular Languages• Finite State Machines/ Finite Automata – only one

path of execution• Nondeterministic FSM – multiple paths of

execution• Regular Expressions• Nonregular Languages and the Pumping Lemma

– can only be used non regularity

Page 3: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Context Free Languages

• Context Free Grammars

• Pushdown Automata – extra stack element over the FSM

• Regular Languages subset of context free languages

• Non-context free languages and the pumping lemma

Page 4: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• David Hilbert:– Is maths complete– Is maths consistent– Is maths decidable

• Godel answered the first two – every sufficiently powerful formal system is either inconsistent or incomplete.

• Third question remained open and brought about the concept of Turing machines.

Page 5: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Turing would design machine which were unable to solve some problems – proving computation (and maths) was undecidable.

• Turing Machines were models of human computation, and can do anything a real computer can do.

• TM’s are only models and can never be built.

Page 6: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• TM’s can both read and write to its tape and can also move left or right.

• There are three possible outcomes of a TM – accept, reject or loop.

• A language is Turing-recognisable if some Turing machines recognises it.

• A language is known as Turing-decidable if some Turing machine decides it.

• TM’s have the ability to inspect another machines table of behaviour and emulate it.

Page 7: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Multitape Turing have multiple tapes which they can read or write to.

• Every multitape TM has an equivalent single tape TM.

• Nondeterministic TM’s is a generalisation of the standard TM for which every configuration may yield none, or one, or more than one next configuration.

• Every NTM has an equivalent DTM.

Page 8: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• A Universal TM is capable of simulating any other TM.

• An abstract machine or programming language is Turing-complete if it has the same computational power as a UTM.

• Church-Turing thesis states that if any mathematical construction can solve a problem then there is a TM that can solve the problem.

Page 9: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Decidability of languages.• Showing that a language is decidable is

the same as showing that the computational problem is decidable.

• The Halting Problem: Will a TM accept a given input – in other words, will it always halt?

• Use Diagonalisation Technique to show the Halting Problem is undecidable.

Page 10: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Reductions are a way of converting one problem to another in such a way that a solution to the second one can be used to solve the first problem.

• Undecidable Problems.

• Completeness: The concept that a solution to a problem in a set can be applied to all others in the set.

Page 11: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Time Complexity and O-Notation.• Complexity Classes.• PTIME (P) – class of decision problems

solvable (or languages recognised) by DTM’s obeying a polynomial bound on its running time.

• Some problems in P: Path, hcf, …• Problems for which a proof can be found

in polynomial time.

Page 12: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• Tractability – what is feasible with limited resources, and intractability.

• To place the intractable problems in a class a new class was designed – NP.

• NP are the class of problems for which a solution can be verified in polynomial time.

• Travelling salesman, Clique, Vertex-Cover, Subset-Sum…

• Is NP = P?

Page 13: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• NP-Complete problems are the hardest in NP.

• Polynomial-time reductions.• Proving Membership of NP-

Completeness:– A language B is NP-Complete if it satisfies

two conditions:1. B is in NP2. Every A in NP is polynomial time reducible to B.

Page 14: Recap CS605: The Mathematics and Theory of Computer Science

Course Review

• SAT was proven to be NP-Complete by Cook.

• As 3SAT is a special case of the SAT problem it is therefore NP-Complete.

• We use 3SAT to prove that other problems are NP-Complete.

Page 15: Recap CS605: The Mathematics and Theory of Computer Science

Pointers

• If you are asked to prove a language is regular: design a FSM to recognise it.

• If you are asked to prove a language is irregular: use the Pumping Lemma.

• If you are asked to prove a language is context free: design a PDA to recognise it.

• If you are asked to prove a language is not context-free: use the Pumping Lemma.

Page 16: Recap CS605: The Mathematics and Theory of Computer Science

Pointers

• Decidability = can it be either accepted or rejected for every possible input on a machine?

• Verifiability = can we verify that a solution to the problem is correct?

• If you are asked to show that a problem is NP-Complete then show that a problem already shown to be in NP-Complete can be reduced to it.