New state in automata? - automation

While converting NFA to DFA we sometimes have to make a new state in order to achieve it. What exactly is that new state?
Like, {q0, q1, q2} is a new state. Does it mean, in that state we can achieve q0 or q1 or q2...or what?

yes,in NFA there are long way or not minimal way to execute string so, some times when you convert to DFA, some group of states ex{q0,q1,q2} are converted to one state so you can achive minimal automation.for ex. consider this NFA.
it will be converted to DFA like this.

Related

Removing or adding the empty word from a DFA

The title is my interpretation of this question. Below is what I have attempted so far:
Case 1: Ɛ ∈ L(M)
L(M1) = L(M)
L(M2) = {Q2, Σ2, q20, F2, 𝛿2}
Q={q0, ... , qi}
Q2={q20, ... , q2i+1}
Σ2 = Σ
q2i+1 ∈ F2 iff qi ∈ F
𝛿2(q2i+1, a) = 𝛿(qi, a)
Case 2: Ɛ ∉ L(M)
L(M2) = L(M)
L(M1) = {Q1, Σ1, q10, F1, 𝛿1}
...
What you have so far looks good but incomplete. Here's a description of what's left; writing it out in symbols is left as an exercise.
In the first case, if the language already contains the empty string, we're done and can use the automaton for the language directly with no modification. If it does not contain the empty string already, we can add a new initial state and have it transition like the original initial state. If we leave all other transitions alone and make this new initial state accepting, we will accept the empty string as well as anything the original automaton accepted.
In the second case, if the language does not already contain the empty string, we're done and can use the automaton for the language directly with no modification. If it does contain the empty string already, we can add a new initial state and have it transition like the original initial state. If we leave all other transitions alone and don't make this new initial state accepting, we will not accept the empty string but will continue to accept everything else.
This is the best that can be done, in general. However, specific languages might have smaller automata than these constructed after adding or removing the empty string. For instance, the language consisting of only the empty string has a DFA with two states, but a minimal DFA for that language with the empty string removed has one state. Similarly, the language of all non-empty strings has a DFA with two states, but adding the empty string to that language means there's a one-state DFA for that language. So this construction does not always give the smallest DFA possible, but it is guaranteed to work for all cases, including those where there is no smaller DFA for the language (e.g., adding the empty string to the empty language forces the addition of a new state).

What is this DFA means?

There is a DFA.
But I don't know this DFA means.
I want to know this DFA's Regular expression and description
(Description like 'this automata accept suffix is 011)
Blue state is start state and red states are accept states.
see the link below....it will tell about DFA.
http://en.wikipedia.org/wiki/Deterministic_finite_automaton

How can I construct finite automata

I have to create a deterministic finite automata accepting the set of strings with an even number of 1 and ends with 0.Should I include 0 as a string from this set? and how can I do this?
Should I include 0 as a string from this set?
Yes
And how do I do this?
To construct a finite automaton, you need to identify the states and transitions. The Myhill-Nerode theorem allows you to find the necessary (and sufficient!) states of for a finite automaton if you are able to identify the equivalence classes of "indistinguishable" strings.
Two strings x and y are indistinguishable, in this sense, if for any other string z, either both xz and yz are in the language, or neither is.
In your case, let's try to identify equivalence classes. The empty string is in some equivalence class. The string 0 is in a different equivalent class, since you can add the empty string to 0 and get a string in the language (whereas you can't add the empty string to the empty string to get a string in the language). We have found two distinct equivalence classes so far - one for the empty string, one for 0. Both of these will need different states in our FA.
What about the string 1? It's distinguishable from both 0 and the empty string, since you can add 10 to 1 to get 110, a string in the language, but you can't add it to 0 or the empty string to get a string in the language. So we have yet another state.
What about the string 00? This string is not in the language, and no other string can be added to this string to get a string in the language. This is another equivalence class. It turns out that the next strings, 01 and 10, are also in this class.
The string 11 ends up being in the same class as the empty string: you can add any string in the language to 11 and get another string in the language. If you try all strings of length 3, you will find that all of those already fall into one of the above classes, and you can stop checking at that point.
So we have four states - let's call them [-], [0], [1], and [00]. Now we figure out transitions.
If you get a 0 in [-], you need to go to [0]... and if you get a 1, you need to go to [1]. For the rest, just figure out what string you'd get by adding to the canonical one, and which class the resulting string would be in... and go to that state.
Given Question is to construct a Finite Automata with even number of 1's and ends with 0.
So the alphabet of the language is {0,1}
These are the the strings that are accepted by the language.
The Language always consists of '0' before its final state as it is the end of the string and we reach the final state when we reach the last '0' in the string.
Here in the normal procedure of conversion of it into the finite automata we get NFA
Then we need to convert the NFA to DFA by combining 2 states into single and simplifying them.
New transition diagram
Here we had drawn the new transition diagram based on the states reached by a specific state at a given input. Then the new states formed by joining 2 states [ here {q0,q2} state is formed]
This new state {q0,q1} on 0 as input goes to itself (as q0 on 0 goes to q0 and q2 on 0 goes to q2).
So let us conside this new state {q0,q2} as a new state q2'
So by using the Transition state diagram we can easily make the required DFA
Deterministic Finite Automata
The above diagram is the constructed finite automata accepting the set of strings with an even number of 1's and ending with 0.
q0 - is the Initial state
q2'- is the Final state

nondeterministic finite automation question

Im doing some studying and im a bit confused on this little nondeterministic algorithm when it processes a 1. I understand that it will split into a brand with q1 since a 0 or 1 will redirect back, and that theres an exit arrow to q2 is there is a 1, but why would it split into q3? I feel like im misreading the (0,empty string), any clarification would be great.
The empty string means that you can take it at any time. In this case, a 1 will take it to q2 and because q2 has an empty string arrow to q3. It will also immediately take that without having to get the next bit of the input.

Give state diagrams of DFAs recognizing the following languages. In all parts the alphabet is {0,1 }

Im trying to get the hang of drawing DFAs. I have the following problem to do with my following attempt, was wondering if anyone could tell me if im correct, or if incorrect what im doing wrong. Thanks! Also, if anyone has a good resource to learn more about how to do these, it would be greatly appreciated.
Give state diagrams of DFAs recognizing the following languages. In all parts the alphabet is {0,1 }
{w | the length of w is at most 5}
Here are some clues.
"At most 5": this implies you must do some counting. In state machines, counting is accomplished by the context of each node. In other words, you will require a number of nodes, each with a special meaning, and that meaning will be your "counter value."
"At most 5": This means you must accept words of length 0, 1, 2, 3, 4, and 5. (All of which have unique values, hint hint.)
Your alphabet is {0,1}, but there are no requirements of the language of the frequency, ordering, or anything related to 0 and 1. This means every time there is a transition for 0, the same transition must be available to 1, and vice versa. (Or some equivalent relation that reduces to this rule - but this is in parentheses because it's not something you need to think about.)
Here are your errors:
You have no marked start state.
The strings "0", "" (the empty string), "1" are rejected, but are within the prescribed language. In other words, you are accepting only words that are exactly length 5, not all words that are length 5 and less.
Since the alphabet is {0, 1}, you must specify at EACH state what happens when either a 0 or a 1 is encountered. If you encounter an input character whose edge is NOT specified, by convention you are going to the dead state, a state that always returns to itself and is never accepted, but is left undrawn. This is why your right-most state is unnecessary, but your left states are incomplete.
Final, big hint: You can have more than one "Accept" or "Final" state.
I think the DFA shown above is wrong. It will accept strings up to length 5 so you should make all the first six states to be final states. You are accepting only '1's but it should also accept '0's......so attach 0 with all 1's.