1 / 19

Introduction to the Theory of Computation

Introduction to the Theory of Computation. My name: 冯好娣 My office: 计算中心 430 Email: fenghaodi@sdu.edu.cn. Text book: Introduction to the Theory of Computation, Michael Sipser , 机械工业出版社 References:

bmary
Download Presentation

Introduction to the Theory of Computation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to the Theory of Computation My name: 冯好娣 My office: 计算中心430 Email: fenghaodi@sdu.edu.cn

  2. Text book: Introduction to the Theory of Computation, Michael Sipser, 机械工业出版社 • References: • Martin, John C. Introduction to Languages and The Theory of Computation (3rd edition), MC. GrawHill. 2003 • Garey, Michael R. and Johnson, David S. Computers and Intractability: A guide to Theory of NP-completeness, W.H.Freeman 1979

  3. Grading • Final exam 70% • Homework 30%

  4. Lecture one: Overview and Concepts

  5. What is this course aboutWhy it is important • Subject: • The fundamental mathematical properties of computers • (hardware, software and certain applications). • Questions: • What does computation mean? • What can be computed and what can not? • How quickly? • With how much memory? • On which type of machines?

  6. The main question in TOC: What are the fundamental capabilities and limitations of computers? The three central areas of TOC Each of the three central areas of TOC focuses on this question but interprets it differently. Automata Theory: What can be computed with different sorts of weak machines, such as • Finite automata, • Pushdown automata, etc.? Computability Theory: What can be computed with the strongest possible machines, such as Turing machines? Complexity Theory: How efficiently can things be computed, in particular, in how much • Time, • Space?

  7. Set • Set--Any collection of distinctobjects (“elements”) • E ={1,2,3,…}; E ={x | x = 2y for some positive integer y}; E = {G | G is a spanning tree of graph F}; etc. • aA -- “a is an element of A” or “a is inA” • aA -- “a is not an element of A” or “a is not inA” • ST--- “Sis asubsetofT”,i.e., every element ofSis also an element ofT • AB-- “theunionof A and B”, i.e., the set of objects that are in either A or B or both • AB-- “the intersection of A and B” , i.e., the set of objects that are in both A and B • -- “The complement of a set A” contains exactly those elements under consideration that are not in A • -- “the emptyset” • P(S) --- “the power set of S” • i.e. the set of all subsets of S

  8. Sequence, Tuple, Cartesian Product • Sequence-- a list of objects in order. • E.g., (7, 7, 21,35) is a sequence of natural numbers. • nTuple–a sequence of n elements. • (2,3)—2 tuple (pair) • (3,1,2)– 3 tuple (triple) • Two n-tuples (a1, a2, a3, …, an) and (b1, b2, b3, …, bn)are equal if and only if they contain exactly the same elements in the same order, i.e. ai = bi for 1  i  n. • Cartesian product of two sets A and B is defined by AB = {(a, b) | aA and bB} • A =  Similarly, S1 S2 ...  Sn={(s1,s2,…,sn) | s1S1, s2S2, …, snSn} • Ak =A A … A

  9. Function (mapping) f from set A to set B --- assignment of a unique element f(a)B to each aA function AB the rangeof f the domain of f f a b c 1 2 3 4 f: A  B the type of f N --- natural numbers: {0,1,2,…}R --- rational numbers: {0, 5, 8.6, 1/3, etc.} If x,y always take values from N, what are the types of f,g,h? f(x)=2xg(x)=x/2 h(x,y)=x+y f: g: h: N  N N  R NN  N

  10. Graphs • Undirected graph: G=(V, E), where V is a set of nodes(vertices), and E is a set of edges, i.e., set of unordered pairs of nodes. • Directed graph: edge is ordered. • Path: sequence of nodes connected by edges. • Simple path: no repeat of nodes • Connected: each pair of nodes are connected by path • Cycle: a path with same start and end points • Tree: connected and acyclic • Degree: # ofedges incident with a specified node • Leaves: nodes of a tree with degree one

  11. Strings and Languages • An alphabet is a finite, nonempty set A of objects called symbols. • ={0,1}, ={a,b,c,d,…,z} • A stringover an alphabet A is a finite sequence of symbols from A. • 000110 is a string over {0,1}, abcdefsssg is a string over {a,b,c,…} • String length-- |w|, number of symbols in w. • Empty string-- string with length zero.  • Concatenationof strings x,y, written as xy-- the string obtained by appendingy at the end of x • E.g.,u = “monkey”, v = “business”,uv= “monkeybusiness” xk --- x x … x, i.e., to concatenate a string to itself many times. • A substring of a string s-- a consectutive sequence withhin s. • A Language (over alphabet ) -- a set of strings (over ). • * is the language consists of all the strings on . k

  12. Boolean logic • A Boolean variable takes on one of 0 (FALSE) and 1 (TRUE). • The negation of x, denoted by x, is 1-x. • We will use the following Boolean operators: •  conjunction • disjunction • negation

  13. If and only if • P if and only if Q, or P iff Q. • if: QP • Only if: PQ

  14. Sets equality • A = B • For each xAxB • For each xBxA

  15. Disproof by Counterexample • A counterexample to x P(x) is an object c so that P(c) is false. • Statements such as x (P(x)  Q(x)) can be disproved by simply providing a counterexample. Statement: “All birds can fly.” Disproved by counterexample: Penguin.

  16. Proof by construction • To prove some special objects exist. • Example: for each even number n greater than 2, there exists a 3-regular graph with n nodes.

  17. Proof by contradiction is irrational. Proof: otherwise, is rational. W.l.o.g, suppose , where m and n have no common divisors. Then:

  18. Induction • The principle of mathematical induction is a useful tool for proving that a certain predicate is true for all natural numbers. • If we have a propositional function P(n), and we want to prove that P(n) is true for any natural number n, we do the following: • Show that P(1) is true. (basis step) • Show that if P(n) then P(n + 1) for any nN. (inductive step) • Then P(n) must be true for any nN. (conclusion)

  19. Induction • Example (“Gauss”): P(n): 1 + 2 + … + n = n (n + 1)/2 • Show that P(1) is true.(basis step) • Show that if P(n) then P(n + 1) for any nN (inductive step) • If 1 + 2 + … + n = n (n + 1)/2 • Then 1 + 2 + … + n + (n + 1) = n (n + 1)/2 + (n + 1) • = (2n + 2 + n (n + 1))/2 • = (2n + 2 + n2 + n)/2 • = (2 + 3n + n2 )/2 • = (n + 1) (n + 2)/2 • = (n + 1)((n + 1) + 1)/2 • Then P(n) must be true for any nN (conclusion)

More Related