Find DFA for the following languages on sigma {a,b} L={w: na(w) mod 3 < nb(w) mod 3}
Added by Marc L.
Step 1
To construct a DFA for the language \( L = \{ w \in \{a, b\}^* : n_a(w) \mod 3 < n_b(w) \mod 3 \} \), we need to keep track of the counts of 'a's and 'b's modulo 3. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 96 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
Find regular expressions for the following languages on {a, b}. L={w: |w| mod 3 ≠ 0}. b) L={w: |w| mod 3 = 0} L={w: |w| mod 5 > 0}. L={w: |w| mod 3 = 0}.
Sri K.
Akash M.
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 }
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD