## theory – DFA that accepts all the strings with exactly two a’s and more than two b’s

Thanks for contributing an answer to Computer Science Stack Exchange!

But avoid

• Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.

## Construct a dfa and nfa for a set of strings on{0,1} : the left most symbol differs from the right most one and odd length string

Construct dfa and nfa for a set of string 0,1 such that left most and right most element are different and odd length string
Can you plss draw it

Posted on

## finite automata – In general, how does a DFA know how to successfully process a string the intended way?

Suppose we have:

$$Atext{ }colon={x, y, z}$$

$$Mtext{ }colon=text{some DFA using A}$$

$$Stext{ }colon=xyzxyzxyz$$

Intuitively, one might say $$S$$ is fed to $$M$$ on a per-character basis.

This means that somehow we have an undisclosed mechanism that can tell where a symbol starts and ends.

One might say, simply use the maximum valid substring similar to how Lexers tokenise plaintext. To that I say, suppose instead that we defined $$A$$ as:
$$Atext{}colon= {x, xx, xxx}$$

Now we have 3 unique symbols, that, as it so happens, using the maximum valid substring will yield in a restriction to what our our $$M$$ can actually process, because any string longer than 2 characters will always be assumed to start with $$xxx$$ rather than perhaps, $$x$$ and $$xx$$.

One way I see around this is to actually have a character synonymous to a symbol. That is, $$x$$ and $$xxx$$ (from $$A$$) are both a single character each.

Thoughts?

EDIT

In the case my question is unclear:

The extended transition function is defined so as to extend the processable input of a DFA from simply one alphabetic character at a time, to an arbitrary amount. Usually we go about defining it as follows for a string wa:

$$hat{δ}(q,w) = δ(hat{δ}(q, x), a)$$

My issue is: What is converting the input from a string to a partition? Whatever this object may be, it has to follow some lexing rules, does it not?

Posted on

## How can I prove that the accepted language of a given DFA or NFA or REGEX is equivalent to a given language

I found this How do I verify that a DFA is equivalent to a NFA? but as it states it is not really a good question more of how can I check myself during an exam. Because as you might know to do this by hand for < 5 states is really hard to do without any mistake and I only get credit for a correct construction and not understanding that REGΣ = NEAΣ = DEAΣ

Posted on

## finite automata – Turning a regular expression into a DFA

i’m studying for an exam i’ll have soon and i don’t understand how to draw a DFA for a regular expression, i asked my professor by mail but he doesn’t asnwer…
In the courses available on my college’s website there is no step by step exemple
Here is the expression i’m trying to convert b(a∗dc)∗

Thank you for the help !

Posted on

## finite automata – Is there a set of formal languages ​​such that any DFA for him has states $Omega (c ^ k)$ and there is an NFA for him with states $O (k)$?

Given an alphabet $$Sigma: | Sigma | = c$$, can a set of languages $${L_k }$$ be created, so any DFA for $$L_k$$ at $$Omega (c ^ k)$$ States and an NFA for $$L_k$$ exists with $$O (k)$$ States?

I'm having trouble creating a $$L_k$$ so that all DFA $$Omega (c ^ k)$$ States. Is a string language with a suffix of $$s_k, | s_k | = k$$ such a language? Here is a draft proof of that.

Proof by contradiction: leave a DFA $$langle Q, Sigma, delta, q_0, F rangle$$ to have $$| Q | . Let $$a, b$$ to be chains of length $$k$$ and $$a_k = (s_k) _1 not = b_k$$

Let $$q_a$$ and $$q_b$$ denote $$delta (q_0, a)$$ and $$delta (q_0, b)$$, respectively.

There are two cases:

There is no $$a, b$$ such as $$q_a = q_b$$. Then each string corresponds to a different state, but there is $$c ^ {k-1}$$ these chains so $$| Q | geq c ^ {k-1}$$, which is not possible.

II. There is $$a, b$$ such as $$q_a = q_b$$. so $$delta (q_a, s_2s_3 ldots s_k) = delta (q_b, s_2s_3 ldots s_k) = q_c$$. $$as_2s_3 ldots s_k$$ must be accepted and $$bs_2s_3 ldots s_k$$ therefore should not $$q_c$$ is both an accepting state and not an accepting state, which is not possible.

This seems to prove that any DFA for $$L_k$$ at least $$c ^ {k-1}$$ knots, which is enough for $$Omega (c ^ k)$$. If my proof is correct, the only remaining task is to prove that an NFA containing $$O (k)$$ nodes exist for $$L_k$$.

The easiest way to do it is to create such an NFA, but I don't know how to do it. $$O (k)$$ suggests that $$i$$-th node should match the state of the "prefix of $$s$$ length $$i$$ matches the suffix of the input string ", but I don't see how such an NFA can be created.

Posted on

## Build a DFA for the next regular expression

I want to create DFA for this and another question is if we count dead state also in minimal DFA

R = (a + b)(aa + bb) (a + b)

## Usual distances on DFA (Deterministic Finite Automata)?

I looked in the literature for examples of distances defined on all of the DFAs (or on all minimal DFAs) defined on a given alphabetical sigma.

Since the languages ​​they describe (regular languages) can potentially be of infinite size, defining a distance is no small task.

Nevertheless, having a distance on these objects can be useful, in order to integrate them in metric spaces, which allows a range of things (in my case, to evaluate the performance of an algorithm).

So far, my only consistent idea is to create a distance similar to the modification distance in the labeled graphics on the reduced DFAs.

Has anyone ever heard of other distances?

Posted on

## algorithms – McNaughton-Yamada Algotihm (1960) Regular expression to DFA without going through NFA

I have a homework problem here. It asks me to use the McNaughton-Yamada algorithm to convert a regular expression to DFA first, and then minimize this using a partition argument. I can do the latter. My problem is that I cannot access any real references on the algorithm. Their original document is behind a payment wall at the IEEE which my university does not have access to.

The algorithm went something like this:
1. For each symbol in the expression, give them a left-to-right index increasing by one for each occurrence of that symbol. For example, the expression, aa * would receive a_1 a_2 ^ *.

1. We are building a diagram based on the possible word lengths.

If done correctly, it produces a DFA. I think labeling in (1) is to help label states.

Feel free to give your own example if you decide to give an answer. I will not provide any problem here as there is no guarantee that this is not really my homework exercise.

Posted on

## Design a DFA recognizing the following language

Design a DFA on the alphabet (a, b) so that for its entire string, no prefix contains two a more than b and two b more than a and the number of a is equal to b. Is it possible to design a DFA in such special cases where the number of a is equal to b, since it is not possible to create a DFA for the general case where a is equal to b. If so, why and how to recognize such cases.