Drawing a DFA for L= { a^n b^n , n>0} - finite-automata

Could someone explain how to do this?
This is homework and I'm fairly new when it comes to programming.

This is not a regular language and therefore there is no DFA which accepts it. You can prove this using the pumping lemma or the Myhill-Nerode theorem.

Related

How can I represent probabilistic grammars in BNF?

I've found a grammar online which I want to rewrite to BNF so I can use it in a grammatical evolution experiment. From what I've read online BNF is given by this form:
<symbol> := <expression> | <term>
...but I don't see where probabilities factor into it.
In a probabilistic context-free grammar (PCFG), every production also is assigned a probability. How you choose to write this probability is up to you; I don't know of a standard notation.
Generally, the probabilities are learned rather than assigned, so the representation issue doesn't come up; the system is given a normal CFG as well as a large corpus with corresponding parse trees, and it derives probabilities by analysing the parse trees.
Note that PCFGs are usually ambiguous. Probabilities are not used to decide whether a sentence is in the language but rather which parse is correct, so with an unambiguous grammar, the probabilities would be of little use.

Understanding fitness function

I am working with use of genetic algorithm to break transposition cipher. So in this work I have come across to a paper named Breaking Transposition Cipher with Genetic Algorithm by R. Toemeh & S. Arumugam.
In this paper they have used a fitness function. But i can not understand it completely. I can not understand the function of β and γ in the equation.
Can anyone please explain the fitness function please? Here is the picture of the fitness function:
The weights β and γ can be varied to allow more or less
emphasis on particular statistics (they're determined "experimentally").
Kb(i, j) and Kt(i, j, k) are the known language bigram and trigram statistics. E.g. for English language you have (bigrams):
(further details in The frequency of bigrams in an English corpus)
Db(i, j) and Dt(i, j ,k) are the bigram and trigram statistics of
the message decrypted with key k.
In A Generic Genetic Algorithm to Automate an Attack on Classical Ciphers by Anukriti Dureha and Arashdeep Kaur there are some reference values of β and γ (and α since they use an extended form of the above equation) and three types of ciphers.
Some further details about β and γ.
They're weights that remain constant during the evolution. They should be tuned experimentally ("optimal" values depends on the target languages and the cipher algorithms).
Offline parameter tuning is the way to go, i.e.:
simple parameter sweep (try everything)
meta-GA
racing strategy

Algorithm which decides whether L(M) = {a} or L(M) =/= {a}

I started learning about NFA's and DFA's and stumbled across this question online in one of the Berkley PDF's on DFA's, but the question did not have a solution attached.
How would I be able to Show that there is an algorithm which receives as input a DFA M over the alphabet {a, b} and decides whether L(M) = {a} or L(M) =/= {a}?
Any guidance would be highly appreciated.
Given two DFAs D1 and D2, it's possible to decide whether L(D1) = L(D2) by minimizing each DFA and checking whether the resulting DFAs are identical (this works because for each language, there's a unique minimum-state DFA for that language).
Now, you're trying to check whether L(D1) = {a}. As a hint, can you construct a DFA whose language is exactly {a}? If so, could you then use the above algorithm to solve this problem?
Hope this helps!

CPLEX quadratic simplex?

Does anybody know which simplex-like algorithm CPLEX uses to solve quadratic programs. what is the so called Quadratic Simplex it is using?
Thank you in advance,
Mehdi
I'm not sure what CPLEX uses but the Simplex Method has been modified by Philip Wolfe to solve quadratic programming. In a nut shell, this is what it does:
Given a quadratic programming problem: QPP. p'x + 1/2x'Cx with constrains Ax = b
C has to be symmetric positive definite (positive semi-definite might work as well)
generate linear constraints using the Karush-Kuhn-Tucker conditions
modify the Simplex method in a way such that complementary slackness holds when choosing the pivot columns.
proceed with the other usual Simplex method steps
For more detailed information, please take a look at this paper:
http://pages.cs.wisc.edu/~brecht/cs838docs/wolfe-qp.pdf
Hope this helps.

If a language (L) is recognized by an n-state NFA, can it also be recognized by a DFA with no more than 2^n states?

I'm thinking so, because the upper bound would be the 2^n, and given that these are both finite machines, the intersection for both the n-state NFA and the DFA with 2^n or less states will be valid.
Am I wrong here?
You're right. 2^n is an upper limit, so the generated DFA can't have more states than that limit. But it's the worst-case scenario. In most common scenarios there's less states than that in the resulting DFA. Sometimes it could be even less than in the original NFA.
But as far as I know, the algorithm to predict how many states the resulting DFA will actually have, doesn't exist yet. So if you'll find it, please let me know ;)
That is correct. As you probably already know, both DFAs and NFAs only accept regular languages. That means that they are equal in the languages they can accept. Also, the most primitive way of transforming a NFA to a DFA is with subset construction (also called powerset construction), where you simply create a state in the DFA for every combination of states in the NFA. This is called the powerset of states, which could at most be 2^n.
But, as mentioned by #SasQ that is the worst case scenario. Typically you will not end up with that many states if you use Hopcroft's algorithm or Brozowski's algorithm.