Presentation is loading. Please wait.

Presentation is loading. Please wait.

Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively.

Similar presentations


Presentation on theme: "Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively."— Presentation transcript:

1 Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively enumerable UnrestrictedTM Regular expressions

2 Basic assumptions: 1.Sets and operations on sets 2.Power set, product, relation, function 3.Countable and uncountable sets 4.Equivalence relation 5.Directed graphs, trees

3 Proof Methods

4 If-and-only-if Proofs “X if and only if Y” 1)Prove the if part: Assume Y and prove X 2)Prove the only-if part: Assume X and prove Y. An equivalent form to “if X then Y” is “if not Y then not X”

5 Proof by Contradiction To prove “if H then C” prove “H and NOT C implies falsehood” Counter Examples To prove a statement is not a theorem Provide an example

6 Inductive Proofs Prove a statement S(X) about a family of objects X (e.g., integers, trees) in two parts: 1. Basis: Prove for one or several small values of X directly. 2. Inductive step: Assume S(Y ) for Y “smaller than" X; prove S(X) using that assumption.

7 Example A binary tree with n leaves has 2n-1 nodes. S(T) : if T is a binary tree with n leaves, then T has 2n – 1 nodes. Basis: T has 1 leaf Induction: Assume S(U) for trees with fewer nodes than T. T is (r, U, V) #nodes of T = 1 + #nodes of U + # nodes of V

8 Recursive definition of a set specifies a method to construct elements of a set. Recursive definition consists of two required parts: 1.Basis step 2.Recursive step Also, a closure property is included in the definition. Example: Basis: 0  Recursive step: If n  N, then n + 1   Closure property: n  N only if it can be obtained from 0 by a finite applications of recursive step.

9 Principle of mathematical induction and recursive definition Let X be a set defined by recursion from the basis X 0 and let X 0, X 1,  X i  be the sequence of sets generated by the recursive process. Also, let P be a property defined on the elements of X. If i.P holds for each element in X 0 ii.whenever P holds for every element in the sets X 0, X 1, , X i, P also holds for every element in X i+1. Then, P holds for every element in X. Example: n! > 2 n for n  4 Proof: Let P be the property n! > 2 n. Basis: n=4 (24 =) 4! > 2 4 (= 16) Induction step: Assume that i! > 2 i for i = 4, 5, , n. by assumption n! > 2 n also, if n  4, then n+1 > 2 so, (n+1)n! > 2 n 2 i.e. (n+1)! > 2 n+1 So, P is true for all n  4.

10 Proof Method How to show two sets A and B are equal? Need to show A is a subset of B (A  B) and B is a subset of A How to show A is a subset of B? Need to show that if x is a member of A, then it is member of B

11 Formal languages A formal language is a subset of the set of all strings that can be formed using zero or more symbols of an alphabet. The topic of this course is formal languages.

12 Definitions A string over a set X is a finite sequence of elements from X X is an alphabet The length of a string x denoted by |x| is the number of symbols in the string A language is a set of strings over an alphabet Null string denoted by  is basis for recursive definition of a string; length of null string is 0.

13 Recursive definition of a string Let  be an alphabet. The set of strings over  (denoted by  * ) is defined as follows: 1.Basis:    * 2.Recursive step: If w   * and a  , then wa   *. 3.Closure: w   * only if it can be obtained from  by a finite number of applications of the recursive step. The length of a string is the number of applications of the recursive step A language over an alphabet  is a subset of  *.


Download ppt "Classifications LanguageGrammarAutomaton Regular, right- linear Right-linear, left-linear DFA, NFA Context-free PDA Context- sensitive LBA Recursively."

Similar presentations


Ads by Google