Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recursive Definitions

Similar presentations


Presentation on theme: "Recursive Definitions"— Presentation transcript:

1 Recursive Definitions
Theory Of Automata Wasim Ahmad khan

2 Today’s Agenda: Recursive Definitions

3 Any Guess ??? Let me Explain.

4 Introduction: In late 18th Century this word is Originated from the Latin Word Recurs means Returned

5 Recursion: It is the process of repeating items in a self similar way. Example: When the surfaces of two mirrors are exactly parallel with each other, the nested images that occur are a form of infinite recursion.

6

7 Recursive Definition:
It is a method of defining sets. It is a tool used to define Language.

8 Parts/Rules Part/Rule 1: Here we mention /list the smallest possible objects which are the part of other language. Example: {1 , 2 , 3 , 5 , 7 , 9 ,…} ‘ 1 ’ is the part(smallest part) of our language.

9 Part/Rule 2: Here we mention the formula for the processing of certain language. If ‘ w ’ is a valid string of our language then make a formula in this step to produce valid strings of language by using Rule 1. Example: {1 , 3 , 5 , 7 , 9 ,…} ‘ w ’ is a valid string then so is w + 2.

10 OR Part/Rule 3: Nothing else is the part of our language.
No Strings except those constructed in above are allowed to be in the language.

11 Pictorial Representation
Input Formula for Processing Output

12 Example All the strings starting with ‘ a ’ ∑ = { a , b } First, write all the strings of your language separately to understand the structure of language. as in the above sigma the strings are: {a , aa , ab , aaa , aab , aba , abb , . . .}

13 Note All the strings of our language
would be in Lexicographical Order. Now see the recursive definition of the above language.

14 (i) wa is also a valid string (ii) wb is also a valid string
All the strings starting with ‘ a ’ over ∑={ a , b } Rule 1 ‘ a ’ is a valid string of our language. Rule 2 If ‘ w ’ is a valid string then so are: (i) wa is also a valid string (ii) wb is also a valid string Rule 3 Nothing else is the part of our language.

15 Even Palindrome over ∑={ a , b } Rule 1
‘ ƛ ’ is a valid string of our language. Rule 2 If ‘ w ’ is a valid string then so are: (i) a w a (ii) b w b. Rule 3 Nothing else is the part of our language.

16 Practice Questions Now its your turn
All the strings ending with a over ∑ ={ a , b }. All the strings over ∑ ={ p , q }. All the strings starting and ending with different letters over ∑ ={ s , t } All the strings starting and ending with same letter over ∑ ={ s , t } ODD Palindrome Full Palindrome


Download ppt "Recursive Definitions"

Similar presentations


Ads by Google