Presentation is loading. Please wait.

Presentation is loading. Please wait.

Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science.

Similar presentations


Presentation on theme: "Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science."— Presentation transcript:

1

2 Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science To learn the material that is useful in subsequent course Prerequisites Fundamentals of data structures and algorithms Discrete mathematics that includes set, functions, relations, logic, and mathematical reasoning

3 2.1.1 Sets Definition 1. A set is a group of objects . The objects in a set are called the elements, or members, of the set. Example 1 The set of positive integers less than 100 can be denoted as Definition 2. Two sets are equal if and only if they have the same elements. Example 2 A set can also consists of seemingly unrelated elements: Chapter 2 Introduction to The Theory of Computation

4 A set can be described by using a set builder notation. A set can be described by using a Venn diagram. Example 5 Draw a Venn diagram that presents V, the set of vowels in English alphabet. a,e,i,o,u V U

5 Definition 3. The set A is said to be a subset of B if and only if every element of A is also an element of B. We use the notation to indicate that A is a subset of the set B. The set that has no elements is called empty set, denoted by. A B U

6 Definition 4. The power set of a set S is the set of all subsets of S, denoted by P(S) or. Set Operations:

7 AB U B U AB U A U

8 Set Identities Table 1 Set Identities IdentityName Identity laws Domination laws Idempotent laws Complementation laws Commutative laws Associative laws Distributive laws De Morgan’s law

9

10 2.1.2 Functions and Relations Definition 1. Let A and B be sets. A function f from A to B is an assignment of exactly one element of B to each element of A. We write f(a)=b if b is the unique element of B assigned by the function f to the element a of A. If f is a function from A to B, we write f : A B. Example 1 Let set A={Adams, Chou, Goodfriend, Rodriguez, Stevens} and B={A,B,C,D,F}. Let G be the function that assigns a grade to a student in our theory of computation. Adames Chou Goodfriend Rodriguez Stevens ABCDFABCDF G The domain of G is the set A={Adams, Chou, Goodfriend, Rodriguez, Stevens}, and the range of G is the set {A,B,C,F}. x y z A function x Not a function

11 Considering the function whose domain and range are in the set of integers. We are often interested only in the behavior of these functions as their arguments become very large. Example 2

12 Definition 3 Let A and B be the sets. A relation R from A to B is a subset of. Functions can be consider as relations, but relations are more general than functions. Example 3 Let A={1,2,3,4}. R={(1,2), (2,3),(3,1),(4,4)} is a relation from A to A, and it is also a function from A to A. Example 4 R={(1,2), (2,3),(1,3),(1,4)} is a relation but not a function. Example 5 Let A be the set of students in the TSU. Let B the set of courses. The set R that consists of those pairs (a,b), where a is a student enrolled in course b, is a relation from A to B.

13 Definition 4 R is an equivalence relation if for any pair (x,y) of R xRx for all x (reflexivity) If xRy then yRx (symmetry) If xRy and yRz, then xRz. (transitivity) We usually use to denote equivalence relation. Example 7 ‘=’ on the set of integers is an equivalence relation.

14 Definition 4 R is an equivalence relation if for any pair (x,y) of R xRx for all x (reflexivity) If xRy then yRx (symmetry) If xRy and yRz, then xRz. (transitivity) We usually use to denote equivalence relation. Example 7 ‘=’ on the set of integers is an equivalence relation.

15 2.1.3 Graphs and Trees Example 1 v7 v1 v2 v5 v4 v9 v8 v3 e1 e3 e4 e5 e7 e6 e2 e8 e9 e10 A directed graph (digraph) Example 2 v7 v1 v2 v5 v4 v9 v8 v3 e1 e3 e4 e5 e7 e6 e2 e8 e9 e10 An undirected graph

16 e2 Example 3 v7 v1 v2 v5 v4 v9 v8 v3 e1 e3 e4 e5 e7 e6 e8 e9 e10

17 Definition 3 A tree is a directed graph that has no cycles. There is a one distinct vertex in tree, called the root. v1 v6 v8 v4 v3 v2 v5 v7v9 root Parent of v6 Child of v3 Level 1 Level 0 Level 2 Level 3 Height=3

18 2.1.4 A Proof Technique—Mathematical Induction

19


Download ppt "Theory of Computing Topics Formal languages automata computability and related matters Purposes To know the foundations and principles of computer science."

Similar presentations


Ads by Google