FORMAL LANGUAGE & AUTOMATA THEORY
100406Module 3: Context-Sensitive Languages
Q1c. The language: L = \{ a^m b^n c^{m+n} \mid m,n \ge 1 \} is: (i) regular (ii) context-free but not regular (iii) context-sensitive but not context-free (iv) type-0 but not context-sensitive20212m
Module 3: Context-Sensitive Languages
View this question on its own page →The language:
is:
(i) regular
(ii) context-free but not regular
(iii) context-sensitive but not context-free
(iv) type-0 but not context-sensitiveWorked SolutionAnswer
Correct Option: (ii) Context-free but not regular
Explanation
.
Not Regular
Use Pumping Lemma. Let be pumping length, . Pumping in segment breaks balance.
Context-Free
PDA construction:
- Push ’s (m times) → stack .
- Push ’s (n times) → stack (or same symbol).
- For each , pop one symbol. Accept if empty after ’s and no extra input.
Alternatively grammar:
This generates .
Not context-sensitive requirement beyond; CFL suffices, but not regular. Not Type-0/1 only.
Final Answer
Context-free but not regular → Option (ii).
Q1d. The language \{ a^n b^n c^{n+m} \mid m, n \ge 1 \} is: (i) regular (ii) context-free but not regular (iii) context-sensitive but not context-free (iv) type 0 but not context-sensitive20232m
Module 3: Context-Sensitive Languages
View this question on its own page →The language is:
(i) regular
(ii) context-free but not regular
(iii) context-sensitive but not context-free
(iv) type 0 but not context-sensitiveWorked SolutionAnswer
Correct Option: (iii) Context-sensitive but not context-free (and hence not regular)
Explanation
.
Not Context-Free
Assume is CFL, let be pumping length. Take (). By pumping lemma for CFL, with , . Pumping must stay within first 's or 's or 's. Any pumping changes counts and breaks condition (or breaks ). Formal proof shows not CFL. Equivalent to (which is not CFL) with extra tail; intersection with regular does not help but style shows non-CFL.
Context-Sensitive
It is accepted by Linear Bounded Automaton. Grammar is context-sensitive:
This is Type-1 (CSG) but not Type-2. It is decidable but not CFL.
Final Answer
CSL but not CFL → Option (iii). Also not regular; ultimately Type-1 in Chomsky hierarchy.
Q1e. Which production is not allowed in a CSG? (i) AB \rightarrow BA (ii) A \rightarrow \epsilon (iii) A \rightarrow a (iv) a B \rightarrow a b20252m
Module 3: Context-Sensitive Languages
View this question on its own page →Which production is not allowed in a CSG?
(i)
(ii)
(iii)
(iv)Worked SolutionAnswer
Correct Option: (ii)
Explanation
Context-Sensitive Grammar (CSG, Type-1): Production where and (non-contracting), except possibly with not appearing on RHS.
Check each:
- (i) : , → allowed (context-sensitive, length-preserving).
- (ii) : , → false, contracting, not allowed in CSG (unless and is start with special rule).
- (iii) : allowed.
- (iv) : allowed (context ).
Hence only violates the monotonicity condition.
Final Answer
Not allowed: → Option (ii).
Q6a. Prove that every context-free language is context-sensitive, but the converse is not true. Support your answer with a suitable language example.20257m
Module 3: Context-Sensitive Languages
View this question on its own page →Prove that every context-free language is context-sensitive, but the converse is not true. Support your answer with a suitable language example.
Q6b. Given the following context-sensitive grammar: S \rightarrow aSBC | abc CB \rightarrow BC aB \rightarrow ab bB \rightarrow bb bC \rightarrow bc cC \rightarrow cc Identify the language generated by the grammar. Derive the string aabbcc step by step.20257m
Module 3: Context-Sensitive Languages
View this question on its own page →Given the following context-sensitive grammar:
Identify the language generated by the grammar. Derive the string aabbcc step by step.
Q7a. Define a Linear Bounded Automaton (LBA). Design an LBA that accepts the language L = \{a^n b^n c^n | n \ge 1\}. Explain how tape length is restricted.20257m
Module 3: Context-Sensitive Languages
View this question on its own page →Define a Linear Bounded Automaton (LBA). Design an LBA that accepts the language . Explain how tape length is restricted.