instruction stringlengths 0 29.8k ⌀ |
|---|
I ran into the following doubts on the complexity of ToH, on which I would like your comments.
* <b>Is it in NP? </b>
Attempted answer: Suppose Peggy (prover) solves the problem & submits it to Victor (verifier). Victor can easily see that the final state of the solution is right (in linear time) but he'll hav... |
Complexity of Towers of Hanoi |
|time-complexity| |
null |
|complexity-theory|time-complexity|np-hard|approximation| |
I thought how to find a girth of sparse undirected graphs, by sparse I mean $|E|=O(|V|)$, also by optimum I mean optimum by time complexity.
I thought about some modification on [Tarjans algorithm][1] for undirected graphs, but I didn't find good results. Actually I thought if I could find a two connected components... |
What's the optimum algorithm for finding girth of sparse graph? |
|algorithms|graphs| |
I wonder how to find the girth of a sparse undirected graph. By sparse I mean $|E|=O(|V|)$. By optimum I mean the lowest time complexity.
I thought about some modification on [Tarjan's algorithm][1] for undirected graphs, but I didn't find good results. Actually I thought that if I could find a two connected compone... |
Optimum algorithm for finding the girth of a sparse graph? |
I wonder how to find the girth of a sparse undirected graph. By sparse I mean $|E|=O(|V|)$. By optimum I mean the lowest time complexity.
I thought about some modification on [Tarjan's algorithm][1] for undirected graphs, but I didn't find good results. Actually I thought that if I could find a 2-connected component... |
The Tower of Hanoi is in **PSPACE**, but it is not **PSPACE-Complete**, I believe. How can I prove that?
More generally, given a problem in some complexity class **X**, how can I show that it is _not_ **X-Complete**? For example, **X** could be **NP**, **PSPACE**, **EXPTIME**.
|
Showing that a problem in X is not X-Complete |
|complexity-theory| |
null |
|complexity-theory|time-complexity| |
|algorithms|constraint-programming| |
|algorithms|database-theory| |
I am looking for an efficient algorithm that lets me process the minimax search tree for chess with [alpha-beta pruning][1] on a distributed architecture. The algorithms I have found (PVS, YBWC, DTS see below) are all quite old (1990 being the latest). I assume there have been many substantial advancements since then. ... |
|algorithms|distributed-systems|board-games| |
Are there minimum criteria for a programming language being Turing complete? |
|computability|programming-languages|turing-machines| |
In her 1987 seminal paper Dana Angluin presents a polynomial time algorithm for learning a DFA from membership queries and theory queries (counterexamples to a proposed DFA).
She shows that if you are trying to learn a minimal DFA with $n$ states, and your largest countexample is of length $m$, then you need to make... |
I wonder how to find the [girth][1] of a sparse undirected graph. By sparse I mean $|E|=O(|V|)$. By optimum I mean the lowest time complexity.
I thought about some modification on [Tarjan's algorithm][2] for undirected graphs, but I didn't find good results. Actually I thought that if I could find a 2-connected comp... |
null |
I ran into the following doubts on the complexity of [Towers of Hanoi](http://en.wikipedia.org/wiki/Tower_of_Hanoi), on which I would like your comments.
* <b>Is it in NP? </b>
Attempted answer: Suppose Peggy (prover) solves the problem & submits it to Victor (verifier). Victor can easily see that the final st... |
I always though that [$\mu$-recursive functions](https://en.wikipedia.org/wiki/%CE%9C-recursive_function) nailed it. Here is what defines the whole set of computable functions; it is the smallest set of functions containing resp. closed against:
1. The constant $0$ function
2. The successor function
3. Selectin... |
Optimal algorithm for finding the girth of a sparse graph? |
I wonder how to find the [girth][1] of a sparse undirected graph. By sparse I mean $|E|=O(|V|)$. By optimum I mean the lowest time complexity.
I thought about some modification on [Tarjan's algorithm][2] for undirected graphs, but I didn't find good results. Actually I thought that if I could find a 2-connected comp... |
I recently read that it is possible to have arrays which need not be initialized, i.e. it is possible to use them without having to spend any time trying to set each member to the default value. i.e. you can start using the array as if it has been initialized by the default value without having to initialize it. (Sor... |
null |
An attempt on a partial answer:
*Decision problems* where already investigated for some time before *optimization problems* came into view, in the sense as they are treated from the approximation algorithms perspective.
So you have to be careful when carrying over the concepts from decision problems. It can be do... |
This reduction is the constructive proof technique to show that a subset (named safe) Tuple Relational Calculus (TRC) is less expressive than Relational Algebra (RA). The other way being true too, Safe-TRC and RA have equivalent expressive power. See [Theorem 5.3.10][Alice] for instance.
The syntactic "safety" restric... |
null |
null |
Consider two 2D-Stacks $B_{ij} $ (the buy stack) and $S_{ij}$ (the sell stack) where each $i^{th}$ element is associated with an array of floating-point values and each of the floating point value, in turn, is associated with an array of integers.
For example
B = {
0001 => {32.5 => {10, 15, 20}, 4... |
Most efficient know way to match orders |
|algorithms| |
As you said, there is no decision to make, so new complexity classes and new types of reductions are needed to arrive at a suitable definition of *NP-hardness* for *optimization-problems*.
One way of doing this is to have two new classes **NPO** and **PO** that contain *optimizations problems* and they mimic of cour... |
null |
Consider two 2D-Stacks $B_{ij} $ (the buy stack) and $S_{ij}$ (the sell stack) where each $i^{th}$ element is associated with an array of floating-point values and each of the floating point value, in turn, is associated with an array of integers.
For example
B = [
0001 => [ 32.5 => {10, 15, 20},
... |
Is it true that the set 0^(n^2) is not regular because it does not grow linearly?
"Regular sets are called regular b/c if you have a regular set then you can always pump it up (pumping lemma) in regular intervals and get other things in the set. They string out at very linear intervals. That's why anything that grow... |
Regular sets have linear growth? |
|complexity-theory| |
Consider two 2D-Stacks $B_{ij} $ (the buy stack) and $S_{ij}$ (the sell stack) where each $i^{th}$ element is associated with an array of floating-point values and each of the floating point value, in turn, is associated with an array of integers.
For example
B = [
0001 => [ 32.5 => {10, 15, 20},
... |
Consider two 2D-Array $B_{ij} $ (the buy array) and $S_{ij}$ (the sell array) where each $i^{th}$ element is associated with an array of floating-point values and each of the floating point value, in turn, is associated with an array of integers.
For example
B = [
0001 => [ 32.5 => {10, 15, 20},
... |
> Is it true that the set $0^{n^2}$ is not regular because it does not grow linearly?
Yes, that's true. That follows from the pumping lemma as explained in the paragraph you quoted.
> Therefore, $a^{n^2} b^n$ ... is not regular?
Yes, that's also true for the same reason.
> Also, I know that $a^n b^n$ is not... |
Is it true that the set $0^{n^2}$ is not regular because it does not grow linearly?
> Regular sets are called regular b/c if you have a regular set then you can always pump it up (pumping lemma) in regular intervals and get other things in the set. They string out at very linear intervals. That's why anything that g... |
null |
Is it true that the set $\{ 0^{n^2} \mid n \in\mathbb{N} \}$ is not regular because it does not grow linearly?
> Regular sets are called regular because if you have a regular set then you can always pump it up (pumping lemma) in regular intervals and get other things in the set. They string out at very linear interv... |
|formal-languages|regular-languages| |
> Is it true that the set $0^{n^2}$ is not regular because it does not grow linearly?
Yes, that's true. That follows from the pumping lemma as explained in the paragraph you quoted.
> Therefore, $a^{n^2} b^n$ ... is not regular?
Yes, that's also true for the same reason.
> Also, I know that $a^n b^n$ is not... |
null |
Maintain your buy-order book as an array of companies.
For each company, keep a priority queue of prices (max for buy and min for sell).
For each price, keep a queue of orders.
To check for matching orders, for each company, call `find-min()` and `find-max()` on the company in the sell array and buy array to find ... |
First a bit about the classifier:
The knn classifier works by majority voting. It takes an input record, finds the k nearest labeled data points, looks at the class labels on each data point and assigns the current record the most common class label. For instance, if I use a 3-NN classifier and my three neighbors are ... |
A problem in $X$ is not $X$-complete if there are any other problems in $X$ which cannot be reduced to it. One straightforward (but possibly only effective on trivial examples) method would be proving your problem is also in some other complexity class $Y$ such that $Y \subset X$.
For example, if you want to show th... |
I know this is a simple question but can someone show me how (λy.λx.λy.y λx.λy.y) simplifies to λx.λy.y. When I do the evaluate the expression I get λx.λy.λx.λy.y |
Lambda Calculus Evaluation |
|lambda-calculus| |
null |
I know this is a simple question but can someone show me how (λy.λx.λy.y) (λx.λy.y) simplifies to λx.λy.y. |
the reason that $(\lambda y. \lambda x. \lambda y.y) (\lambda x. \lambda y. y)$ reduces to $\lambda x. \lambda y. y$ and not to $\lambda x. \lambda y.\lambda x.\lambda y.y$ is that the $y$ in the body of $\lambda y.\lambda x.\lambda y.y$ refers to the argument of the third lambda, not the first.
If you rename the ar... |
|logic|lambda-calculus| |
I ran into the following doubts on the complexity of [Towers of Hanoi](http://en.wikipedia.org/wiki/Tower_of_Hanoi), on which I would like your comments.
* <b>Is it in NP? </b>
Attempted answer: Suppose Peggy (prover) solves the problem & submits it to Victor (verifier). Victor can easily see that the final ... |
First of all I want to say that my question is not a big question and it is kind of poor question but I couldn't find a good place that I am 100% sure that will answer my question like this place, so if you can help me please do that and I'll be thankful.
I have a test about branch and bound algorithm. I understand ... |
Branch and Bound explanation |
|algorithms|optimization| |
null |
I have a test about the [branch and bound](http://en.wikipedia.org/wiki/Branch_and_bound) algorithm. I understand theoretically how this algorithm works but I couldn't find examples that illustrates how this algorithm can be implemented practically.
I found some examples such as [this one][1]
but I'm still confuse... |
If we aren't doing EBNF questions here just let me know in comment, I will gladly delete this.
I am trying to figure out the simplest way to do this in EBNF.
Note: I don't know TeX.
- Three symbols a, b, c.
- The sequence length is unlimited, i.e. *.
- The symbol a must be somewhere in the sequence at le... |
EBNF, 3 symbols, unlimited length, first symbol must be in sequence at least once |
|ebnf| |
The main idea of K-Nearest-Beighbours takes into account the k-nearest point and take a vote for the classification of the data. If so, then it shouldn't have problem in higher dimensional data because methods like Local Sensitivity Hashing can achieve really high performance.
What's more, feature selection with ba... |
Non-Parametric Methods Like K-Nearest-Neighbours in High Dimensional Feature Space |
|machine-learning|artificial-intelligence| |
The simplest regular expression I can think of for this is $\left(a \mid b \mid c\right)^* a \left(a \mid b \mid c\right)^*$. This is simpler than yours by the following measures of complexity:
* It consists of slightly less symbols
* It contains less nesting (and fewer parentheses in general)
* It contains fewer ... |
I am trying to figure out the simplest way to do this in EBNF.
- Three symbols a, b, c.
- The sequence length is unlimited, i.e. *.
- The symbol a must be somewhere in the sequence at least once, but can appear more than once.
- The sequence can have only a.
The best I get is
> ( (( b | c )\*) a (( b... |
I've noticed that some data structures are used when we implement search algorithms. For example, we use queue to implement BFS, stack to implement DFS and min-heap to implement the A* algorithm. In these cases, we don't need to construct the search tree explicitly.
But I can't find a simple data structure to simula... |
How to implement AO* algorithm? |
|algorithms|artificial-intelligence| |
In [his answer](http://cstheory.stackexchange.com/a/10961/1037) on cstheory.SE, [Lev Reyzin](http://www.cc.gatech.edu/~lreyzin/) directed me to [Robert Schapire's thesis](http://dl.acm.org/citation.cfm?id=136314) that improves the bound to $O(n^2 + n\log m)$ membership queries in section 5.4.5. The number of counterex... |
null |
|formal-languages|ebnf| |
Scientific analysis of board games, playing strategies and their complexity |
null |
Programming questions |
null |
Programming questions like
* "how can I write a program in [name of a programming programming language] to do [a task]?",
* "what does this [name of a programming language] code do?"
are off-topic on Computer Science StackExchange. Please ask your programming questions on [StackOverflow](http://www.stackoverflo... |
null |
A problem in $X$ is not $X$-complete if there are any other problems in $X$ which cannot be reduced to it. One straightforward (but possibly only effective on trivial examples) method would be proving your problem is also in some other complexity class $Y$ such that $Y \subset X$.
For example, if you want to show th... |
The main idea of [k-Nearest-Neighbour](https://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm) takes into account the $k$ nearest points and decides the classification of the data by majority vote. If so, then it should not have problems in higher dimensional data because methods like [locality sensitive hashing](h... |
I have noticed that different data structures are used when we implement search algorithms. For example, we use queues to implement breadth first search, stacks to implement depth-first search and min-heaps to implement the [A* algorithm](https://en.wikipedia.org/wiki/A*_algorithm). In these cases, we do not need to co... |
|algorithms|data-structures|graphs| |
The main idea of [k-Nearest-Neighbour](https://en.wikipedia.org/wiki/K-nearest_neighbor_algorithm) takes into account the $k$ nearest points and decides the classification of the data by majority vote. If so, then it should not have problems in higher dimensional data because methods like [locality sensitive hashing](h... |
I'm trying to use pumping lemma to prove that L = {(01)^m 2^m } is not regular.
This is what I have so far: Assume L is regular and let p be the pumping length, so w = (01)^p 2^p. Consider any pumping decomposition w = xyz; |y| > p and |xy| ≤ p.
I'm not sure what to do next.
Am I on the right track? Or am I wa... |
Using Pumping Lemma to prove language is not regular |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.