Creating DFA's for $\Sigma=\{0,1\}$ Languages

  • Context:
  • Thread starter Thread starter mathmari
  • Start date Start date
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
mathmari
Gold Member
MHB
Messages
4,984
Reaction score
7
Hey! :o

I have to draw the DFA's for the following languages:
$\Sigma=\{0, 1\}$

  1. $$\{w \mid w \text{ starts with } 1 \text{ and ends with } 0 \}$$
  2. $$\{w \mid w \text{ contains at least 3 } 1\}$$
  3. $$\{w \mid w \text{ contains the substring } 0101\}$$
  4. $$\{w \mid w \text{ has length at least } 3 \text{ and the third symbol is } 0\}$$
  5. $$\{w \mid w \text{ starts with } 0 \text{ and has an odd length, or with } 1 \text{ and has an even length} \}$$
  6. $$\{w \mid w \text{ doesn't contain the substring } 110\}$$
  7. $$\{w \mid \text{ the length of } w \text{ is smaller than or equal to } 5\}$$
  8. $$\{w \mid w \text{ is any string besides } 11 \text{ and } 111\}$$
  9. $$\{w \mid \text{ in each odd position of } w \text{ there is a } 1\}$$
  10. $$\{w \mid w \text{ contains at least two } 0 \text{ and at most one } 1\}$$
  11. $$\{\epsilon , 0\}$$
  12. $$\{w \mid w \text{ contains an even number of } 0, \text{ or exactly two } 1\}$$
  13. the empty set
  14. all strings besides the empty one.
I have done the following:

View attachment 4142

Could you tell me if it is correct?? (Wondering)

Could you give me some hints how we could find the DFA of the last three languages ?? (Wondering)
 

Attachments

  • DFA's.png
    DFA's.png
    30.5 KB · Views: 130
Last edited by a moderator:
Physics news on Phys.org
I like Serena said:
I'll just pick up number 1 for now: w starts with 1 and ends with 0.
Hmm... so 1010 would be part of the language wouldn't it? (Thinking)
Does your DFA accept 1010? (Wondering)

It doesn't accept 1010... (Headbang)

Should it be maybe as followed?? (Wondering)

View attachment 4151
 

Attachments

  • DFA_1.png
    DFA_1.png
    3.1 KB · Views: 141
Or have I done something wrong?? (Wondering)
 
mathmari said:
It doesn't accept 1010... (Headbang)

Should it be maybe as followed?? (Wondering)

mathmari said:
Or have I done something wrong?? (Wondering)

No worries. That's it. (Nod)

Number 2 looks fine to me. (Happy)

So let me randomly pick up number 10.
Logically we have to build up a tree that starts as a binary tree where we either accept a 0 to the left and a 1 to the right.
That is, until we can decide what is acceptable or not. (Thinking)