The DFA depicted below determines whether a binary string is divisible by three or not. Convert it to a corresponding context-free grammar. 0 1 0 1 start 0 1 2 1 0 Figure 1: DFA to check whether a binary number is divisible by 3.
Added by Keith N.
Close
Step 1
From the diagram, we can see that there are three states: start, state1, and state2. Next, let's identify the transitions between states. From the diagram, we can see the following transitions: - From start to state1 on input 0 - From start to start on input 1 - Show more…
Show all steps
Your feedback will help us improve your experience
Muhammad Jan and 79 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
Build a DFA for the following language: L = { w | w is a string over a , and b starts ( aa or bb ) and ends with ( aa or bb ) L = { w | w is a binary string that has even number of 1s and even number of 0s} The set of all strings whose tenth symbol from the left end is a 1. The set of strings that either begin or end (or both) with 01 Let = Σ ={0, 1} , Give DFA's accepting The set of all binary string , which are divisible by 3. Let = Σ ={0, 1} , Give DFA's accepting The set of all binary string , which are divisible by 5. Let = Σ ={0, 1} , Give DFA's accepting The set of all binary strings start with 1 , and divisible by 5.
Akash M.
For any binary string x, let #0(x) and #1(x) denote the number of 0's and the number of 1's in x, respectively. Design a DFA to accept the following language: L = {x | x ∈ {0, 1}*, the summation 3 · #0(x) + 2 · #1(x) is divisible by 5}
Construct a deterministic finite-state automaton that recognizes the set of all bit strings that do not contain three consecutive 0 $\mathrm{s}$ .
Modeling Computation
Finite-State Machines with No Output
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD