Question 4 Classify the following languages using the Chomsky Hierarchy. Prove that the classification is correct. 1. L = \{0$^i$1$^j$2$^k$ | i,j,k ? 0 where i < j and k < j\} 2. L = \{0$^i$1$^j$2$^k$ | i, j, k ? 0 where i < j or k < j\}
Added by John C.
Close
Step 1
This language consists of strings that start with some number of 0's, followed by the same number of 1's, and then followed by some number of 2's. The condition i<j ensures that the number of 0's and 1's is different, and the condition k<j ensures that the number Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 71 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
In each case below, say what language (a subset of {a, b}*) is generated by the context-free grammar with the indicated productions. e. S -> TT T -> aT | Ta | b f. S -> aSa | bSb | aAb | bAa A -> aAa | bAb | a | b | Α g. S -> aT | bT | Α T -> aS | bS h. S -> aT | bT T -> aS | bS | Α
Akash M.
Let $G=(V, T, S, P)$ be the phrase-structure grammar with $V=\{0,1, A, B, S\}, T=\{0,1\},$ and set of productions $P$ consisting of $S \rightarrow 0 A, S \rightarrow 1 A, A \rightarrow 0 B, B \rightarrow 1 A,$ $B \rightarrow 1$. a) Show that 10101 belongs to the language generated by $G$ . b) Show that 10110 does not belong to the language generated by $G .$ c) What is the language generated by $G ?$
Modeling Computation
Languages and Grammars
Let $G=(V, T, S, P)$ be the phrase-structure grammar with $V=\{0,1, A, S\}, T=\{0,1\},$ and set of productions $P$ consisting of $S \rightarrow 1 S, \quad S \rightarrow 00 A, \quad A \rightarrow 0 A$ and $A \rightarrow 0$ a) Show that 111000 belongs to the language generated by $G .$ b) Show that 11001 does not belong to the language generated by $G .$ c) What is the language generated by $G ?$
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD