 Hello, welcome to the session Types of Grammars and Languages. At the end of this session, the student will be able to differentiate between various types of grammars in the theory of competition. Grammars are nothing but language generators. Grammars consist of terminal symbol, alphabet of non-terminal symbols and starting symbol and rules. Each language generated by some grammar can be recognized by some automaton. Languages can be classified according to the minimal automaton which can recognize them. The Chomsky Hierarchy has comprised four types of language and their associated grammar and machines. Chomsky Hierarchy, here we can see we are having four types, type 0 is recursively innumerable or it is also called as non-restrictive. Then second type 1 is contact sensitive, type 2 is context free grammar and third one is regular grammar. Now we will see one by one type 3 grammar, type 3 grammar generate regular language and they are accepted by DFA and NFA. Now here in type 3 grammar at the left hand side it must have non-terminal and at the right hand side it may have single terminal or single terminal followed by a single non-terminal. The production must be in this format x producing a or x producing a. As we said here left hand side it should be non-terminal and right hand side it may be a single terminal or single terminal followed by non-terminal. Here x and y are non-terminals and a is terminal. Here in the rule x producing null is allowed if s does not appear on the right hand side of any rule, any production. So here some examples we are showing here x producing null, x producing a or x producing a y, y producing b, a producing xb or x and here a producing bx or x. Now here non-terminal b is at right hand side and non-terminal b here is left hand side. So it is called as a which is at right hand side it is called as a right bound and when it is at left hand side it is called as left bound. Second it is a type 2 grammar. Type 2 grammars generate context free languages. Here the format is a producing alpha where a is any single non-terminal and alpha is the combination of terminal and non-terminals. These languages generated by these grammars are recognized by non-deterministic push down automata or they are also determined by CFG. Example of CFL are some simple programming languages. So here you can see s is producing x a left bound as x is at the left side, x is producing a, x is producing a, x right bound, x is producing a, b, c and x is producing null. So some examples. Now next is type 1 grammar. Type 1 grammar generate context sensitive languages. context sensitive languages or grammars may have more than one symbol on the left hand side of their grammar rules. But here condition is there alpha must be less than or equal to beta. It means that left hand side should be less than right hand side and provided that at least one of them is non-terminal and the number of symbols on the left hand side does not exit the number of symbols at the right hand side. So here it is given alpha a gamma producing alpha beta gamma. So where a is a single non-terminal symbol and alpha beta gamma are any combination of terminals and non-terminals. Here type 1 grammar, type 1 grammar generate context sensitive languages. The rule in type 1 grammar is again we have already seen the rules but one more rule s producing null is allowed to appear at the right hand side of the rule. The language generated by these grammar are recognized by a linear bounded atom. So these are example a, b producing a, b, b, c, a producing b, c, a and b producing b. And this is undistricted grammar type 0 grammar. Here no restriction is there on grammar rules. So any word, any grammar is allowed in type 0 grammar except that there must be at least one non-terminal on the left hand side. On the left hand side there should be one non-terminal which is producing beta where alpha and beta are arbitrary string of terminal and non-terminal symbol. And also it they belongs to the empty string also. The type of automata which can be recognized such languages Turing machine with an infinite long memory. Example of undistricted language are almost all natural languages pause for a while and determine grammar type of following. So here a is producing a or b, a. So this is the solution grammar here given grammar is third type which means that it is also include in the type 2, 1, 0 as we have seen grammar 3 is a subset of type 2, type 1 and type 0. So these we have seen type 0, type 1, type 2 and type 3. So here summary table is there, grammar type is type 0, here alpha producing beta, alpha and beta terminals or non-terminals which are undistricted grammar and they are accepted by recursively innumerable. Then the automaton is Turing machine and any computable functions are the example of this. Type 1 is alpha producing beta where alpha should be less than or equal to beta. These are the contact sensitive grammar and accepted contact sensitive. Automatons are linear bounded automation. Example is a raise to bn, b raise to n, c raise to n. In type 2 alpha producing beta, here alpha is terminal symbol, contact free grammar, language accepted is contact free which is automaton of push down automata a raise to n, b raise to n. Type 3 is regular grammar and automaton is finite state automaton, a is recursively accepted here. Thank you.