What's new

Help Automata

vien3211

Eternal Poster
Established
Joined
Aug 9, 2016
Posts
829
Reaction
73
Points
313
Hello po! Baka po may makakatulong sa akin. Thank you po!

Design a DFA for the language L = {w ϵ (a,b)*: n sub b mod 3 > 1} where n sub b represents the number of b in the string.
 
Hello! I'd be happy to help you design a Deterministic Finite Automaton (DFA) for the language L = {w ϵ (a,b)*: n sub b mod 3 > 1}.

To design a DFA for this language, we need to keep track of the number of occurrences of the symbol 'b' in the input string, and determine whether the count is such that n sub b mod 3 > 1.

Let's design the DFA:

  • State 0: Initial state, where the count of 'b's mod 3 is 0.
  • State 1: Represents the count of 'b's mod 3 equal to 1.
  • State 2: Represents the count of 'b's mod 3 equal to 2.

Transitions:
- From State 0:
- Transition to State 1 on input 'b'.
- Stay in State 0 on input 'a'.
- From State 1:
- Transition to State 2 on input 'b'.
- Stay in State 1 on input 'a'.
- From State 2:
- Transition back to State 0 on input 'b' (resetting the count of 'b's mod 3).
- Stay in State 2 on input 'a'.

Final states:
- State 1 and State 2 are the final states as n sub b mod 3 > 1 when the DFA reaches these states.

This DFA will accept strings where the count of 'b's modulo 3 is greater than 1. You can visualize this DFA and test it with different input strings to see how it behaves. Let me know if you need further assistance or clarification!
 

Similar threads

Back
Top