asked 158k views
2 votes
Design DFA which accepts strings 1100 or 1010 only. Construct DFA for the language, A={w∈Σ ∗

∣w ends in "bba"), with Σ={a,b]. Construct DFA for the language L={w∣w contains the substring 0101\} Hint: w=x0101y for some x and y For ∑={a,b} construct DFA's that the set consisting of a. All the strings with exactly one ' a ' b. All the strings with at least one ' a '

1 Answer

0 votes

Final answer:

To design a DFA for specific languages, we can create a state transition diagram with initial and accepting states, based on the given conditions. For the language A={w∈Σ∗∣w ends in 'bba'}, the DFA would only accept strings that end in 'bba'. For the language L={w∣w contains the substring '0101'}, the DFA would only accept strings that contain the substring '0101'.

Step-by-step explanation:

To design a DFA that accepts strings 1100 or 1010 only, we can start with an initial state and create transitions for each input. The initial state would transition to a state 'A' on input '1', and this state 'A' would transition to state 'B' on input '1' and to state 'C' on input '0'. State 'B' would transition back to state 'A' on input '0', and state 'C' would transition to an accepting state 'D' on input '0'. Finally, state 'D' would transition to a trap state 'E' on any input other than '0' or '1'. This DFA would only accept the strings 1100 and 1010.

To construct a DFA for the language A={w∈Σ∗∣w ends in 'bba'}, we can start with an initial state and create transitions for each input. The initial state would transition to state 'A' on input 'a', and state 'A' would transition to state 'B' on input 'b'. Then, state 'B' would transition to state 'C' on input 'b', and state 'C' would transition to an accepting state 'D' on input 'a'. Finally, state 'D' would transition to a trap state 'E' on any input other than 'a' or 'b'. This DFA would only accept the strings that end in 'bba'.

To construct DFA's for the language L={w∣w contains the substring '0101'}, we can start with an initial state and create transitions for each input. The initial state would transition to state 'A' on input '0', and state 'A' would transition to state 'B' on input '1'. Then, state 'B' would transition to state 'C' on input '0', and state 'C' would transition to state 'D' on input '1'. Finally, state 'D' would transition to an accepting state 'E' on input '0'. This DFA would only accept the strings that contain the substring '0101'.

answered
User Astridx
by
8.7k points