instruction
stringlengths
0
29.8k
⌀
What is the difference between Quantum TM and Non Determistic TM?
|computability|turing-machines|quantum-computing|nondeterminism|
null
$\mathsf{NP}^{\mathsf{NP}}$ is known as the second level of [polynomial hierarchy][1]. It is suspected that all levels of polynomial hierarchy are different. A machine with NP oracle can query it and negate the answer, therefore $\mathsf{NP}^{\mathsf{NP}} \supseteq \mathsf{coNP}$, while $\mathsf{NP} \supseteq \maths...
Transformations such as left factoring or removing left recursion do not have precedence rules. Obviously, the resulting grammars may be different but they will recognize the same language. The question's example grammar is more difficult than the typical undergrad homework problem. So showing our work will be usefu...
As a general preamble, QTMs, TMs and NTMs are all different things (taking huge liberties with a bunch of unspoken assumptions). I'll assume you know what a Turing Machine is. <ol> <li> A NTM is a TM where, at any state, with any symbol, the transition function is allowed to have a number of choices of action th...
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily equal to the input length. It seems like most networks I've read descriptions of require the output length to be equal to the input length. But...
How would a neural network deal with an arbitrary length output?
|neural-networks|
if I have a grammar having a production that contains both left recursion and left factoring like `F --> FBa | cDS | c` which one has priority, left recursion or left factoring? Thanks
Left recursion and left factoring.. Which one goes first?
null
|formal-languages|formal-grammars|parsers|regular-expressions|
To reformulate my comments as an answer, and to expand a bit: We don't know whether **NP<sup>NP</sup>**&nbsp;=&nbsp;**NP** &mdash; it's a notoriously open problem in complexity theory, though as with **P** versus **NP** we suspect that they are not equal. One of the reasons why we don't know how to simulate an **NP*...
First off, putting $k$ in the regular expression is not allowed by typical regular expression syntax, unless I'm mistaken. Even adding constant powers is a shorthand notation, not a part of the regular expression formalism. Even if it were possible, using that notation, you could mix $a$s with $b$s, so that not all $a$...
null
I'm working on an expression typing system and looking for insights on what algorithms may be available which solve my problem -- or a proof that its complexity is too high to be reasonable to implement. The problem is defined below. I have a set of types which form a directed graph $T = (V,E)$ (assume no cycles). T...
null
You just add more neurons. You're right that it's often not useful (if you only get 5 bits of information in, it's hard to put 10 bits of information out), but if you want to (e.g. because your output format is less dense), go ahead. As a trivial example, if you wanted to create an ANN to convert characters to graph...
## Context If you have to pay an amount of money at a store and have a limited collection of payment items (i.e. coins and banknotes) -- let's for simplicity assume there are only coins -- a trivial algorithm is to always greedily pick the biggest coin that is smaller or equal to the remaining value you have to pay. I...
How to formalise efficient payment with a collection of coins in a wallet?
|combinatorics|
I'm going to post this as a sort of a counterpoint to Luke's previous answer, because I'm afraid that I disagree with some of his remarks. There are two different meanings of 'nondeterminism' at issue here. One of this is just being 'not deterministic', which is a quite reasonable way to interpret the word, usually:...
I'm going to post this as a sort of a counterpoint to Luke's previous answer, because I'm afraid that I disagree with some of his remarks. There are two different meanings of 'nondeterminism' at issue here. One of this is just being 'not [deterministic](http://en.wikipedia.org/wiki/Determinism)', which is a quite re...
I'm going to post this as a sort of a counterpoint to Luke's previous answer, because I'm afraid that I disagree with some of his remarks. There are two different meanings of 'nondeterminism' at issue here. One of this is just being 'not [deterministic](http://en.wikipedia.org/wiki/Determinism)', which is a quite re...
I'm going to post this as a sort of a counterpoint to Luke's previous answer, because I'm afraid that I disagree with some of his remarks. There are two different meanings of 'nondeterminism' at issue here. One of this is just being 'not [deterministic](http://en.wikipedia.org/wiki/Determinism)', which is a quite re...
I have a bivariate function like $ f(x,y) = \frac{1}{x^3 \sqrt{\pi}}. e^{\frac{2-x}{x^2}} . y^3 . e^{3.y \over 3-y} $ and I want to find its global maximum over a range of $ x \in [0, 200] \text{, and } y \in [300,50000] $ What kind of algorithms I can use to find the global maximum. I want to have keywo...
Function Maximization in Java
|optimization|mathematical-analysis|mathematical-software|
A Turing machine that returns to a previously encountered state with its read/write head on the same cell of the exact same tape will be caught in a loop. Such a machine doesn't halt. Can someone give an example of a never halting machine that doesn't loop?
Does a never halting machine always loop?
|turing-machines|
A Turing machine which computes all of the decimal places of &pi; (or any other non-terminating fraction, in any base) never halts, and writes on each cell only once. Of course, the fact that there is no transition to a halting state would be a dead giveaway, but it is at least a natural example. A more interesting ...
Consider the TM that always moves the tape head to the right and prints a special non-blank tape symbol at each step. This means that the TM never halts, since it always moves to the right, and never repeats a state, since after k steps the tape head is over the kth cell of the machine. Consequently, each configurati...
There is the >Flanagan's Java Scientific Library which can be found here: [LINK][1] [1]: http://www.ee.ucl.ac.uk/~mflanaga/java/Maximisation.html
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. It seems like most networks I've read descriptions of require the output length to be equal to the input length. But how would you do so...
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. It seems like most networks I've read descriptions of require the output length to be equal to the input length or at least a fixed size...
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. It seems like most networks I've read descriptions of require the output length to be equal to the input length or at least a fixed size...
I've been looking into Recurrent Neural Networks, but I don't understand what the architecture of a neural network would look like when the output length is not necessarily fixed. It seems like most networks I've read descriptions of require the output length to be equal to the input length or at least a fixed size...
There is the >Flanagan's Java Scientific Library which can be found here: [LINK][1] [1]: http://www.ee.ucl.ac.uk/~mflanaga/java/Maximisation.html Basically you have to extend `MaximizationFunction` and implement the function public double function(double[] param) which contains your function a...
There is the >Flanagan's Java Scientific Library which can be found here: [LINK][1] [1]: http://www.ee.ucl.ac.uk/~mflanaga/java/Maximisation.html Basically you have to extend `MaximizationFunction` and implement the function public double function(double[] param) which contains your function a...
Consider the TM that always moves the tape head to the right and prints a special non-blank tape symbol at each step. This means that the TM never halts, since it always moves to the right, and never repeats a state, since after k steps the tape head is over the kth cell of the machine. Consequently, each configurati...
You just add more neurons. You're right that it's often not useful (if you only get 5 bits of information in, it's hard to put 10 bits of information out), but if you want to (e.g. because your output format is less dense), go ahead. As a trivial example, if you wanted to create an ANN to convert characters to graph...
You're trying to compute something called the **arrangement** of the line segments. The arrangement is a [planar straight-line graph](http://en.wikipedia.org/wiki/Pslg) whose vertices are either endpoints or intersection points of line segments. The vertices partition the lines segments into smaller segments, which a...
Consider any non-halting Turing machine that never moves the read/write head to the left.
Mark lives in a tiny country populated by people who tend to over-think things. One day, the king of the country decides to redesign the country's currency to make giving change more efficient. The king wants to minimize the expected number of coins it takes to exactly pay any amount up to (but not including) the amoun...
Algorithm to find optimal currency denominations
|algorithms|optimization|
I'm trying to convert a context free grammar to a pushdown automata; I'm not sure how I'm gonna get an answer or show you my progress as it's a diagram... Anyway this is the last problem I have on a homework that's due later today, so I'd appreciate some kind of help, even if it's just an explanation of the correct ans...
Context Free Grammar to Pushdown Automata
|formal-grammars|context-free|pushdown-automata|
This is basically the language of all palindromes over $\{a, b\}$ which can contain an arbitrary number of $b$'s in the middle. First, you could build a PDA for palindromes. This is a fairly standard language, so you should be able to find plenty to get you started. Then, you need to add a way to read an arbitrary numb...
I'm trying to convert a context free grammar to a pushdown automata; I'm not sure how I'm gonna get an answer or show you my progress as it's a diagram... Anyway this is the last problem I have on a homework that's due later today, so I'd appreciate some kind of help, even if it's just an explanation of the correct ans...
A Turing machine which computes all of the decimal places of &pi; (or any other non-terminating fraction, in any base) never halts, and can be made to write on each cell only a finite number of times. Of course, the fact that there is no transition to a halting state would be a dead giveaway, but it is at least a natur...
A Turing machine that returns to a previously encountered state with its read/write head on the same cell of the exact same tape will be caught in a loop. Such a machine doesn't halt. Can someone give an example of a never-halting machine that doesn't loop?
Does a never-halting machine always loop?
null
If I have a Type 3 Grammar, it can be represented on a pushdown automaton (without doing any operation on the stack) so I can represent regexp by using context free languages. But can I know if a type 3 grammar is $LR(1)$, $LL(1)$, $SLR(1)$, etc. without constructing any parse tables?
Are regular expressions $LR(k)$?
null
## Context If you have to pay an amount of money at a store and have a limited collection of payment items (i.e. coins and banknotes) -- let's for simplicity assume there are only coins -- a trivial algorithm is to always greedily pick the biggest coin that is smaller or equal to the remaining value you have to pay. A...
null
Given a TSP instance $T$, decide whether changing the city coordinates by adding a vector of coordinates $v$ will change the optimal TSP objective by $x$. The problem is in PSPACE but even the verification problem seems to be NP-hard. Is that true? If the verification problem is NP-hard, what exact complexity cla...
What complexity class does this problem belong too?
|complexity-theory|reductions|np-hard|decision-problem|
I guessed (wrongly, but bear with me) that the series $\{b^i |\ b = \lceil n^{1/m} \rceil, 0 \leq i < m\}$ of coins would be the optimal, as the coins would be exponentially spaced, thus reducing the remaining value as much as possible per added coin. For your example, this would be $\{1,3,9,27,81\}$. This is a notc...
Given a TSP instance $T$, decide whether changing the city coordinates by adding a vector of coordinates $v$ will change the optimal TSP objective by atleast $x$. The problem is in PSPACE but even the verification problem seems to be NP-hard. Is that true? If the verification problem is NP-hard, what exact comple...
What complexity class does this problem belong to?
You may find the algorithm in [Diekert and Gastin's paper][1], Section 12. It works for both NBW and DBW (provided that you have the $\omega$-expression), and this can be decided in polynomial time. [1]: http://www.lsv.ens-cachan.fr/Publis/PAPERS/PDF/DG-WT08.pdf
LTL and DBA are incomparable: DBA cannot express *FGa*, and LTL cannot express *"at least each odd letter is 'a'"*. But sometimes it is interesting to know whether a language of DBA can be expressed in LTL. I need an algorithm that decides whether a language of a given DBA is describable in LTL. Do you know algorith...
Any algorithms to describe a language of det.Buchi Automaton in LTL(if possible)?
|logic|automata|
I'd like to learn something about this optimization problem: For given non-negative whole numbers *a<sub>i,j,k</sub>*, find a function *f* minimizing the expression > *max<sub>k</sub> sum<sub>i</sub> a<sub>i,f(i),k</sub>* An example using a different formulation might make it clearer: You're given a set of sets...
Is this optimization problem well-known?
|optimization|linear-programming|
The hardest problems in NP, i.e. of those that can be solved in polynomial time by nondeterministic Turing machines. NP-complete problems have two properties: 1. They are in the [NP complexity class](https://en.wikipedia.org/wiki/NP_%28complexity%29) (can be solved by nondeterministic Turing-machine) 2. They ...
null
I'd like to learn something about this optimization problem: For given non-negative whole numbers $a_{i,j,k}$, find a function $f$ minimizing the expression $$\max_k \sum_i a_{i,f(i),k}$$ An example using a different formulation might make it clearer: You're given a set of sets of vectors like { {(3, 0, ...
null
[Linear temporal logic](http://en.wikipedia.org/wiki/Linear_temporal_logic) and deterministic [Büchi automata](http://en.wikipedia.org/wiki/B%C3%BCchi_automaton) are incomparable: DBA cannot express $FGa$, and LTL cannot express *"at least each odd letter is 'a'"*. But sometimes it is interesting to know whether the la...
Algorithm to translate a deterministic Büchi automaton to LTL (when possible)
|logic|automata|linear-temporal-logic|buchi-automata|
|logic|automata|formal-methods|linear-temporal-logic|buchi-automata|
Minimize the maximum component of a sum of vectors
null
null
null
I'm assuming that you're thinking of the _Euclidean_ traveling salesman problem, where $c$ and $v$ are vectors in $\mathbb{Z}^{2n}$, with two coordinates for each city. Let $minTSP(c)$ denote the length of the minimum traveling salesman tour for the cities with coordinates $c$. Then your problem asks whether $$ min...
What complexity class does this variation of traveling salesman problem belong to?
null
i have thisFSP with corresponding LTS: ![enter image description here][1] [1]: https://i.stack.imgur.com/mxLLU.png FSP is this: MAKER = (kochen -> fertig -> MAKER). USER = (fertig -> essen -> USER). ||MAKER_USER = (USER||MAKER). why after second ``kochen`` is ``essen`` possible? ``...
LTS of this simple FSP
|finite-automata|
I know it's possible to build a Finite State Transducer for converting numbers from base 2 to base 4 or 8 or other powers of 2 (translating from base N to base N^M is easy). However I've never seen a FST that can convert numbers from base 1 to base 2 or viceversa. Can a FST even do this? If so, can you please give some...
Building a finite state transducer
|finite-automata|
null