1 / 84

CSCI 4325 / 6339 Theory of Computation Chapter One

CSCI 4325 / 6339 Theory of Computation Chapter One. Zhixiang Chen Department of Computer Science University of Texas-Pan American. Background. Experience in at least one high-level programming language Data structures Discrete math Others …. Topics. What is computation?

Télécharger la présentation

CSCI 4325 / 6339 Theory of Computation Chapter One

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. CSCI 4325 / 6339Theory of ComputationChapter One Zhixiang Chen Department of Computer Science University of Texas-Pan American

  2. Background • Experience in at least one high-level programming language • Data structures • Discrete math • Others …

  3. Topics • What is computation? • Or what is an algorithm? • Formal languagesand computing devices? • Computation vs. Formal language understanding? • What can be computed? • Or what cannot be computed? • What can be efficiently computed? • Or what cannot be efficiently computed?

  4. Reading Materials • Chapter 0, Introduction

  5. The World of Theoretical Foundations of Computation … PARTIALLY COMPUTABLE COMPUTABLE PSPACE NEXP EXP NP P

  6. CHAPTER 0Introduction

  7. Automata, Computability, and Complexity • Want to know • What are the fundamental capabilities and limitations of computers?

  8. Complexity • What makes some problem computationally hard and others easy? • How to classify problems according to their computational difficulties? • How to understand the computational difficulties in the worst case, randomized, or approximate settings? • How to harness the computational difficulties for applications like cryptography?

  9. Computability • What are limitations of Computers? • Want to know what problems are solvable by computers, and what are not? • Note: In complexity, we are interested in “solvable” problem, but want to know how difficult to solve.

  10. Automata • Automata theory deals with the definitions of properties of mathematical models of computation. These models play a role in several applied areas of computer science. • Finite automata = regular expression: for text processing • Context-free grammar: for programming language design and implementation, AI, natural language processing • Context-sensitive grammar: for natural language processing

  11. Sets • What is a Set? • A set is a collection of objects • Ex’s? • Notes: • We use capital letters to denote sets • An object contained in a set is called a set element. We use lower-case letters to denote set elements. • Notations • Given a set A and an object x, if x is an element of A, we write • Otherwise we write

  12. Finite Sets and Infinite Sets • A set is finite if it has a finite number of elements • Ex’s? • A set is infinite if it has an infinite number of elements • Ex’s?

  13. Set Cardinality • Given a set A, the cardinality of A, denoted by |A|, is the number of elements in A. • Ex’s?

  14. Empty set • The empty set is a set without elements. • The empty is denoted as Ø.

  15. Set Representation • By enumeration: • List all elements. Only good for finite sets • Ex’s. • A = {1, 2, 3, 4, 5}, B = {a, b, c, d, e} • C = { Joe, Jose, Chen_1, Chen_ 2} • D = { Black_Cat, White_Cat} • By Property: • Give property for set elements. Good for infinite sets (and finite sets as well) • Ex’s. • A = {x: x is an integer} • B = {y: y is a student at UTPA} • C = {z: z is a student in the CS department} • D = {w: and w is even}

  16. Set Operations • Union • A U B is a set of elements in either A or B • A U B = {x: } • Intersection • is a set of elements in both A and B. • Difference • A – B is a set of elements in A but not in B.

  17. Set Operations • Subset • if any implies • Proper Subset • if and • Equivalence • A = B if • Want example’s?

  18. Properties of Set Operation • Idempotency • A U A = A • Commutativity • Associativity

  19. Properties of Set Operation • Distributivity • Absorption • DeMorgan’s Law

  20. Can You See DeMorgan’s Law? A B C

  21. Disjoint Sets and Power Sets • Disjoint Sets • A and B are disjoint if • Power Sets • Given a set A, the power set of A, denoted by is the collection of all subsets of A. • Ex’s. • A = {1, 2, 3} • = {, {1}, {2}, {3}, {1, 2}, {1, 3}, {2, 3}, {1, 2, 3}}

  22. Two Notations • Let S be a set such that any element in S is also a set, define • Ex’s • What is ? • What is ?

  23. Set Partition • Given a nonempty set A, we say is a partition of A if • Any two elements of are disjoint.

  24. Set Partition Examples • Ex’s • Let S = {a, b, c, d} • What partition of S has the fewest members? The most members? • List all partitions of S with exactly two members?

  25. Relations and Functions- Ordered Pairs • Given any two objects a, b, let (a, b) denote the ordered pair of a and b. • The ordered pair of a and b tells that a and b is related under some relationship • The differences between (a, b) and {a, b}: • (a, b) (b, a), while {a, b} = {b, a} • (a, a) is a good ordered pair, while {a, a} is not. • The equivalence • (a, b) = (c, d) if and only if a = c, b = d.

  26. Ordered Tuples • Given any n objects • is an n-ary ordered tuple. • Note: • The objects may not be distinct. • Ordered tuple examples?

  27. Cartesian Products • Given two sets A and B, the Cartesian Product of A and B is • Given n sets , the n-fold Cartesian Product of these sets is • Ex’s?

  28. Relations • A binary relation is defined as • A n-ary relation is defined as

  29. Functions • A function is a binary relation on A and B such that • there is exactly one such that • A is called the domain of f. • For any , we denote y as f(x). f(x) is called the image (or value) of x. • The range of f is defined as • f [A] = { y: y = f(x) for some }

  30. Function Mapping f A B

  31. One-to-One, Onto, Bijection • One-to-One • A function is one-to-one if for any two distinct elements • Onto • A function is onto B, if • Bijection • A function is a bijection if f is one-to-one and onto

  32. Inverse • The inverse of a binary relation is • The inverse of a function may not be a function any more. • Why? • If a function is bijection then its inverse is still a function. • Why?

  33. Composition • Let Q and R to be two relations • Then RQ is also a relation Q R C A B

  34. Composition Examples • Let R = {(a, b), (a, c), (c, d), (a, a), (b, a)}, • What is RR? • What is ? • Is R, RR or a function?

  35. Graph Representation of a Binary Relation • Given a binary relation for each • draw a node to represent a, • draw another node to represent b, • draw an edge from a to b. • Then, we obtain a directed graph for R.

  36. An Graph Representation Example • Let R = {(a, b), (b, a), (a, d), (d, c), (c, c), (c, a)}. • The Graph is b a c d

  37. Reflexive • A relation R: A→A is reflexive, • if for any • For a reflexive relation R, the directed graph for R has a self-circle for each node • Graph example? • Other examples? • The less-than-or-equal-to relation over integers

  38. Symmetric • A relation R: A→A is symmetric • if for any • In the directed graph of a symmetric relation, if there is an edge from node a to node b, then there must be another edge from node b to node a. • Graph examples? • Other Examples? • The friend relation over a group of people.

  39. Antisymmetric • A relation R: A A is antisymmetric • if for any • In the direct graph of a antisymmetric relation, if there is an edge from a to b, then there must be no edge from b to a. • Some graph examples? • Other examples? • The parent relation over a group of people.

  40. Transitive • A relation R:A  A is transitive if (a, b) and (a, c) are in R, then (a, c) is also in R. • In the directed graph of a transitive relation, if there a path from a to b, then there is an edge from a to b. • Some graph examples? • Other examples? • The ancestor relation over a group of people. • The less-than relation over integers.

  41. Equivalence Relation • A relation R: A A is equivalent if R is reflexive, symmetric and transitive. • Let R be an equivalence relation, for any a in A, we define the equivalence class containing the element a as • [a] = {x: (a, x) in R} • That is, [a] is the set of all elements related to a. • Examples? • The same-family relation • The x=y (mod p) relation for the given p.

  42. A Equivalence Relation Theorem • Theorem. Let R: A→A to be an equivalence relation, then the equivalence classes of R is a partition of A. That is {[a]: a in A} is a partition of A. • Proof.

  43. Partial Order • A relation R: A→A is a partial order if R is reflexive, antisymmetric, and transitive. • Ex’s • Some graph examples? • The boss-employee relation, assuming any person is the boss of him/herself. • Minimal elements ofa partial order R: A→A • An element a in A is minimal if for any b in A, • (b, a) in R implies b = a. • Ex’s

  44. Total Order, Path, Length, Cycles • Total Order • A relation R: A A is a total order, if R is a partial order, and for any a, b in A, either (a, b) in R or (b, a) in R. • Path, Length, Cycles • Easy to see from the directed graph of a relation R. • Examples?

  45. Countable and Uncountable Sets • Countable • A set S is countable if one of the following is true • S is finite • S is infinite but there is a bijection f: SN, where N is the set of natural numbers. • In other words, S is countable, if elements in S are enumerable. • Countable set examples? • Uncountable • Sets that are not countable

  46. Unions of Countable Sets • The union of a finite collection of countable sets is countable • Proof. By dovetailing • The Union of a countably infinite collection of countable sets is countable • Proof. By dovetailing

  47. There Are Uncountable Sets • Proof. By diagonalization. • Will give a proof later.

  48. Definitions • Definitions describe the objects and notions that we use. A definition may be simple, or complex. Precision is essential to any mathematical definition. When defining some object we must make clear what constitutes that object and what does not.

  49. Theorems • A theorem is a mathematical statement proved true. Generally a theorem is used to refer to a mathematical statement of special interest. Sometimes we prove statements that are interesting only because they assist in the proof of another, more significant statement. Such statements are called lemmas. Occasionally a theorem or its proof may allow us to conclude easily that other, related statements are true. These statements are called corollaries of the theorem.

  50. Proofs • A proof is a convincing logical argument that a statement is true. In mathematics an argument must be airtight, that is, convincing in an absolute sense. This is rather different from the notion of proof that we use in everyday life or in the law. A mathematician demands proof beyond any doubt.

More Related