-1

L = { w belongs {0,1}* | w contain '110' and doesn't contain '010'}

I need to construct DFA that receives L.

How can I draw a DFA that will do the both of conditions?

hints will be a great help.

AndrewM
  • 55
  • 7
  • Please take the [tour] to learn how Stack Overflow works and read [ask] on how to improve the quality of your question. Then check the [help/on-topic] to see which questions are on-topic on this site. You might want to delete this question and ask it on https://cs.stackexchange.com/ instead, but check the help pages there first. – Progman Dec 16 '22 at 21:28

1 Answers1

2

A finite state machine (or automaton) consists of:

  • A finite set of symbols, called the "alphabet".
  • A finite set of states. There is no information in a state other than its label.
  • A transition table, which maps each pair <state, symbol> to a new state.
  • The starting state: the name of the state which the machine is in before it reads the first symbol.
  • The accepting state set: A subset of the set of states which define a successful match.

The machine starts in the starting state, and then reads each symbol in turn. When it reads a symbol, it uses the transition table to decide which is the next state. When it reaches the end, it announces success if the current state is in the accepting set; otherwise, it announces failure.

In a deterministic finite-state automaton (DFA), the transition table is single-valued and complete; that is, every entry is filled in with exactly one state. (Constructing a DFA usually involves adding a "sink state", which is non-accepting and has a self-transition on every symbol. This state is used to handle inputs which cannot be at the beginning of an accepted input.)

If you have a DFA which recognises a language L, you can construct a DFA for the complement of L by simply replacing the set of accepting states with the set of non-accepting states. So if you have a DFA which recognises any input containing 010, you can construct a DFA which recognises any input which does not contain 010 by using just changing the accepting state list.

If you have two DFAs which recognise the languages L1 and L2, you can construct a new DFA which recognises only those strings in both L1 and L2 -- that is, the intersection L1 ∩ L2 -- using the Cartesian product of the two DFAs. In the new machine:

  • the alphabet is the intersection of the original alphabets. (Usually, all the alphabets are the same in this operation. I just note this for completeness.)
  • the states of the new machine are the Cartesian product of the states of the original machines. In other words, the new states are all the pairs <qi, rj> where qi is a state of the first machine and rj is a state of the second machine.
  • The transition table is constructed using both original transition tables. If there is a transition in the first machine on symbol α from qi to qi' and a transition in the second machine on the same symbol α from rj to rj', then in the combined machine there is a transition on α from <qi, rj> to <qi', rj'>.
  • The starting state of the combined machine is the pair of starting states of the original machines.
  • The accepting states of the combined machine are all pairs <qi, rj> where qi is an accepting state of the first machine and rj is an accepting state of the second machine.

So if you can construct DFAs for:

  • The language of strings which contain 110
  • The language of strings which contain 010 then you can use the above procedures to construct a DFA for the contain 110 and don't contain 010 by using the above two procedures.
rici
  • 234,347
  • 28
  • 237
  • 341