Indicate whether the language below is regular, context-free but not regular, or not context-free. All strings with \Sigma = \{1,2,3\} in which the sum of the digits is divisible by 3 O regular O context-free but not regular O not context-free
Added by Kristy S.
Close
Step 1
Step 1: The language consists of all strings over the alphabet $\Sigma = \{1, 2, 3\}$ such that the sum of the digits in the string is divisible by 3. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 52 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
A number is divisible by 3 if the sum of its digits is divisible by 3. a) Construct a DFA M that accepts a base-10 number if it is divisible by 3. That is L(M) = { w ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}⁰⁺ : w mod 3 = 0 } b) Construct a DFA တ̄ that accepts numbers that are not divisible by 3. That is L(တ̄) = { w ∈ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}⁰⁺ : w mod 3 ≠ 0 }
Sri K.
Select the correct alternative from the given choices. Consider the following languages $L_{1}, L_{2}$ and $L_{3}$ : $L_{1}=\left\{a^{n} b^{m} c^{n+m} \mid n, m \geq 0\right\}$ $L_{2}=\left\{a^{n} b^{n+1} c^{n+2} \mid n \geq 0\right\}$ $L_{3}=\left\{a^{n} b^{n} c^{m} \mid n, m \geq 0\right\}$ Which of following statement is true? (A) $L_{1}, L_{2}, L_{3}$ are context free languages (B) $L_{1}, L_{2}$ are context free but not $L_{3}$ (C) $L_{1}, L_{3}$ are context free but $\operatorname{not} L_{2}$ (D) $L_{1}, L_{2}, L_{3}$ are not context free languages.
Theory of Computation
CONTEXT FREE LANGUAGES AND PUSH DOWN AUTOMATA
The language, $L$ that is generated over $\Sigma=\{0,1\}$ for regular expression $L(r)=(0+10)^{*} 1(1+10)^{*}$ (A) Any string whose number of 1 's length is greater than or equal to 3 . (B) Any string that has no substring 110 . (C) Any string that has no substring 00 after first 11 . (D) Any string that has only one occurrence of substring 010 .
Databases
File Management
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