1. Deterministic Finite Automata
2.1. DFA practice
- Double-circle = final state
- Hanging arrow entering state = initial state
- Sink state = a state that is not final; once reached, there is no transition that leaves it, thus the DFA will reject; there is a transition that loops in this state for each possible character
Write DFAs for the following languages:
2.1.1. $ L=\{w \in \{0,1\}^* \text{ | w contains an odd number of ones} \} $
2.1.2. The language of binary words which contain exactly two ones
2.1.3. The language of binary words which encode odd numbers (the last digit is least significative)
2.1.4. (hard) The language of words which encode numbers divisible by 3
2.1.5. The language of words that encode a calendar date (DD/MM/YYYY) (do not overthink about the actual number of days in a month)
2.1.6. (HARD) $ L=\{w \in \{0,1,2,3\}^* \text{ | w follows the rule that every zero is immediately followed by a sequence of at least 2 consecutive threes and every one is immediately followed by a sequence of at most 2 consecutive twos} \} $
2.1.7. The set of all binary strings having the substring 00101