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

  • MHB
  • Thread starter mathmari
  • Start date
In summary, the DFA for the languages starts with w1=1 and ends with w0=0 and contains at least 3 1's. It does not accept 1010.
  • #1
mathmari
Gold Member
MHB
5,049
7
Hey! :eek:

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: 71
Last edited by a moderator:
Physics news on Phys.org
  • #2
Hey mathmari! (Wave)

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)
 
  • #3
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: 80
  • #4
Or have I done something wrong?? (Wondering)
 
  • #5
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)
 

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

What is a DFA?

A DFA, or deterministic finite automaton, is a theoretical model used in computer science and mathematics to recognize patterns and verify whether a given input belongs to a language or not. It consists of a finite set of states, a set of input symbols, a transition function, a start state, and one or more final states.

How do you create a DFA for a language with only two symbols?

To create a DFA for a language with two symbols, such as $\Sigma=\{0,1\}$, you first need to determine the possible states of the automaton. Then, for each state, you need to define the transitions for each possible input symbol. Finally, you need to designate a start state and one or more final states to complete the DFA.

What is the purpose of creating DFA's for $\Sigma=\{0,1\}$ languages?

The purpose of creating DFA's for $\Sigma=\{0,1\}$ languages is to have a mathematical model that can recognize and accept or reject strings that belong to a specific language. This is important in computer science and linguistics, as it allows us to verify the validity of strings and automate certain tasks.

Can a DFA recognize all languages with only two symbols?

No, a DFA can only recognize regular languages, which are a subset of all possible languages with two symbols. There are languages, such as the language of palindromes, that cannot be recognized by a DFA.

How can I test if a given string is accepted by a DFA?

To test if a given string is accepted by a DFA, you can start from the initial state and follow the transitions based on the input symbols. If the final state reached is a designated final state, then the string is accepted. Otherwise, if the final state is not a final state, the string is rejected.

Similar threads

Replies
24
Views
4K
Replies
1
Views
1K
Replies
3
Views
2K
Replies
6
Views
3K
Replies
1
Views
2K
Replies
6
Views
2K
Back
Top