


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



a) What is recursive definition of language A recursive language is a formal language for which there exists a Turing machine that, when presented with any finite input string, halts and accepts if the string is in the language, and halts and rejects otherwise. Recursion is a very important concept in computer science. Many problems can be simplified by the use of recursion. A formal definition of recursion is โ A function that calls itself directly or indirectly and terminates after a finite number of steps. So that the program does not continue to run indefinitely, a well-defined recursive function should have the following properties: There must be a base criterion for which the function does not call itself. With every call to itself the function must be closer to the base criteria. For example, a factorial can be defined recursively as: factorial(x) = x * factorial (x โ 1) for x > 1= 1 for x = 1 or x = 0 The base criteria for the function is at x = 1 or x = 0. i.e. the function does not call itself when it reaches x = 1 or x = 0. The function calls itself whenever x is not 1 or 0 and moves closer to the base criteria as x is reduced at every recursive call. b) Define a Recursive language L beginning and ending on the different letters defined over โ={a,b}. Definition: A recursive language is a formal language for which there exists a Turing machine that, when presented with any finite input string, halts and accepts if the string is in the language, and halts and rejects otherwise. โ={a,b} Language L beginning and ending on the different letters ๐ฟ = {๐๐, ๐๐, ๐๐๐, ๐๐๐, ๐๐๐, ๐๐๐๐, ๐๐๐๐, ๐๐๐๐๐๐๐, โฆ }
How regular expression is different from Descriptive Method explain with the help of example? Definition The language accepted by finite automata can be easily described by simple expressions called Regular Expressions. ... A regular expression can also be described as a sequence of pattern that defines a string. Regular expressions are used to match character combinations in strings ๏ท The language accepted by finite automata can be easily described by simple expressions called Regular Expressions. It is the most effective way to represent any language.
๏ท The languages accepted by some regular expression are referred to as Regular languages. ๏ท A regular expression can also be described as a sequence of pattern that defines a string. ๏ท Regular expressions are used to match character combinations in strings. String searching algorithm used this pattern to find the operations on a string. For instance: In a regular expression, x* means zero or more occurrence of x. It can generate {e, x, xx, xxx, xxxx,.....} In a regular expression, x+ means one or more occurrence of x. It can generate {x, xx, xxx, xxxx,.....} Operations on Regular Language The various operations on regular language are: Union: If L and M are two regular languages then their union L U M is also a union.
Backtracking It is possible to use backtracking in DFA. It is not possible to use backtracking at all times in the case of NFA. Ease of construction Given its complex nature, it is tougher to construct DFA. NFA is more easily constructed in comparison to DFA. Supremacy All DFAs are derived from NFAs. All NFAs are not DFAs. Transition functions The number related to the next state is one. The number related to the next state/ states is either zero or one. Complexities of time The total time required for running any input string in DFA is less than what it is in NFA. The total time required for running any input string in NFA is larger than that in comparison to DFA. Full form The full form of DFA is Deterministic Finite Automata. The full form of NFA is Nondeterministic Finite Automata (NFA). Space requirement More space allocation needed. Less space needed. The setting of the next possible set The next possible state is clearly set in DFA. In NFA, every single pair of input symbols and states may contain many possible next states.
If โ={a,b} write all possible strings and Draw NFA contains exactly 2aโs. R. E=babab* All possible strings: ๐ฟ = {๐๐, ๐๐๐, ๐๐๐๐, ๐๐๐๐๐, ๐๐๐๐, ๐๐๐, ๐๐๐, ๐๐๐๐} Draw NFA contains exactly 2aโs.