1 / 21

Lecture 2 Theory of Computation

Lecture 2 Theory of Computation. Yasir Imtiaz Khan. Graphs . Set of points with the lines connecting some of the points (also called simple graph). The points are called nodes or vertices and the lines are called edges.

roy
Télécharger la présentation

Lecture 2 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. Lecture 2Theory of Computation Yasir Imtiaz Khan

  2. Graphs • Set of points with the lines connecting some of the points (also called simple graph). • The points are called nodes or vertices and the lines are called edges. Numbers of edges at a particular node is the degree of that node. G = (V, E)

  3. Graphs Continue….. • Path: in a graph is a sequence of nodes connected by edges. • Simple Path: is a path that does not repeat nodes. • Connected Graph: if every two nodes have a path between them. • Cycle: A path is a cycle if it starts and ends with same node. • Simple Cycle: contains at least three nodes and repeats only the first and last nodes

  4. Graphs Continue…. • Tree: if it is connected and has no simple cycles • Directed Graph: If it has arrows instead of lines • Strongly Connected: if a directed path connects every two nodes.

  5. Language: a set of strings String:a sequence of symbols from some alphabet Example: Strings: cat, dog, house Language: {cat, dog, house} Alphabet:

  6. Languages are used to describe computation problems Alphabet:

  7. Alphabets and Strings An alphabet is a set of symbols Example Alphabet: A string is a sequence of symbols from the alphabet String variables Example Strings

  8. Decimal numbers alphabet Binary numbers alphabet

  9. String Operations Concatenation

  10. Reverse

  11. String Length Length: Examples:

  12. Proofs • Theorem • Mathematical statements proved true. • Lemmas • Assist in other proof so we proof • Corollaries • Related statements are true (Conclude other things)

  13. Proof by Contradiction • In a proof by contradiction we assume, along with the hypotheses, the logical negation of the result we wish to prove and then reach some kind of contradiction. • That is, if we want to prove "If P, Then Q", we assume P and Not Q.

  14. Example (Proof by Contradiction) • Theorem. There are infinitely many prime numbers. • Proof. Assume to the contrary that there are only finitely many prime numbers, and all of them are listed as follows: p1, p2 ..., pn. • Consider the number q = p1p2... pn + 1. The number q is either prime or composite. If we divided any of the listed primes pi into q, there would result a remainder of 1 for each i = 1, 2, ..., n. Thus, q cannot be composite. We conclude that q is a prime number, not among the primes listed above, contradicting our assumption that all primes are in the list p1, p2 ..., pn.

  15. Proof by Induction • Mathematical induction: is a method of mathematical proof typically used to establish that a given statement is true of all natural numbers. • Base Case • Inductive Step

  16. Theorem: For all n>=1. Proof #1: (by induction on n) Basis: n = 1 1 = 1

  17. Inductive hypothesis: Suppose that for some k>=1. Inductive step: We will show that by the inductive hypothesis It follows that for all n>=1. 

  18. Example Proof by Induction

  19. Automata theory • Deals with the properties of computation models. • Abstract Model of digital computer so it should have features like • Memory • Control Unit • ALU • Input • Output

More Related