instruction stringlengths 0 29.8k ⌀ |
|---|
Knapsack problem -- NP-complete despite dynamic programming solution? |
|complexity-theory|np-complete|dynamic-programming| |
The set of problems in NP which are the most difficult to solve. Any other problem in NP could be efficiently solved if an NP-complete problem had an efficient solution. |
null |
One generalization of a tree in a directed graph is an [arborescence](https://en.wikipedia.org/wiki/Arborescence_%28graph_theory%29). It is a directed tree with all edges directed from parent to child. |
|complexity-theory| |
Validity of higher order formulae is in general not decidable and search spaces are *huge*, so all you can hope to do is to *try* to find a proof -- assuming it exists -- by cleverly enumerating the proof space (think [sledgehammer](http://www.cl.cam.ac.uk/research/hvg/Isabelle/sledgehammer.html), aptly named) but that... |
<sup>*I am learning [Automated Theorem Proving](http://en.wikipedia.org/wiki/Automated_theorem_proving) / [SMT solvers](http://en.wikipedia.org/wiki/Satisfiability_Modulo_Theories) / [Proof Assistants](http://en.wikipedia.org/wiki/Proof_assistant) by myself and post a series of questions about the process, starting her... |
Let $S \subseteq \mathbb{N}^3$ with $|S| < \infty$ and $P_1(S)$ where
$\quad \displaystyle P_1(S)\ \ :\Longleftrightarrow\ \ \forall (i,j,k)\in S. i,j,k \text{ mutually coprime }.$
$P_1$ is clearly non-trivial as requested. We say furthermore
$\quad \displaystyle P_2(S)\ \ :\Longleftrightarrow\ \ \forall (i,j,... |
The hardest problems in NP, i.e. of those that can be solved in polynomial time by nondeterministic Turing machines. |
null |
[Here][1] are some nice video Coq tutorials by Andrej Bauer. It's in no way complete, but I think it's a good introduction.
[1]: http://math.andrej.com/2011/02/22/video-tutorials-for-the-coq-proof-assistant/ |
See [this wiki book](http://en.wikipedia.org/wiki/Book:Graph_Algorithms) (edited by David Eppstein) for an introduction to graphs and algorithms on them. |
null |
This question goes into **Algorithm Analysis** category. In addition to solving **Recurrences** via Master Theorem, Substitution and Iteration methods, I have an issue with **Characteristic Equations**.
Let's say I have concluded that a characteristic equation having **imaginary** roots, such as 1+j and 1-j (which c... |
Algorithm Analysis - Recurrences via Characteristic Equations with Imaginary Roots |
|algorithm-analysis| |
A good introductory book for Computer Science is [Brookshear - Computer Science: An Overview](http://books.google.co.uk/books?id=LbtoewAACAAJ&dq=brookshear&hl=en&sa=X&ei=FNl2T5SpD5LA8QO1m8WgDQ&redir_esc=y).
David Harel's [Algorithmics](http://books.google.co.uk/books?id=txxLovFWkCUC&printsec=frontcover&dq=david+hare... |
Validity of higher order formulae is in general not decidable and search spaces are *huge*, so all you can hope to do is to *try* to find a proof -- assuming it exists -- by cleverly enumerating the proof space (think [sledgehammer](http://www.cl.cam.ac.uk/research/hvg/Isabelle/sledgehammer.html), aptly named) but that... |
In algorithm analysis you often have to solve recurrences. In addition to Master Theorem, substitution and iteration methods, there is one using *characteristic equations*.
Say I have concluded that a characteristic equation has *imaginary* roots, such as $x_1 = 1+j$ and $x_2 =1-j$ (which corresponds to $x^2 - 2x - ... |
In general, this is a very relevant and interesting research question.
One way that has been pursued is the identification of various structural properties of instances that lead to efficient algorithms. These properties are indeed prefered to be "easilily" identifiable. An example is the topology of the underlying ... |
|algorithm-analysis|recurrence-relation| |
In general, this is a very relevant and interesting research question.
One way that has been pursued is the identification of various structural properties of instances that lead to efficient algorithms. These properties are indeed prefered to be "easily" identifiable. An example is the topology of the underlying co... |
Yes, the solution is in fact $T(n) = \alpha(1+i)^n + \beta(1-i)^n$ for some constants $\alpha$ and $\beta$ determined by the base cases. If the bases cases are real, then (by induction) all the complex terms in $T(n)$ will cancel, for all integer $n$.
For example, consider the recurrence $T(n) = 2T(n-1) - 2T(n-2)$,... |
null |
Solver programs for the Satisfiability Modulo Theories (SMT). The SMT problem is a decision problem for logical formulas with combinations of background theories expressed in classical first-order logic with equality. |
null |
The spanning tree of a connected undirected graph G is a tree having all the vertices and some number of edges of G. |
null |
In general, this is a very relevant and interesting research question. "One way is to run existing solvers..." and what would this even tell us exactly? We could see empirically that an instance seems hard for a specific solver or a specific algorithm/heuristic, but what does it really tell about the hardness of the in... |
null |
Yes, the solution is in fact $T(n) = \alpha(1+i)^n + \beta(1-i)^n$ for some constants $\alpha$ and $\beta$ determined by the base cases. If the bases cases are real, then (by induction) all the complex terms in $T(n)$ will cancel, for all integer $n$.
For example, consider the recurrence $T(n) = 2T(n-1) - 2T(n-2)$,... |
null |
I was explaining the famous deterministic [linear-time selection algorithm][1] (median of medians algorithm) to a friend.
The recursion in this algorithm (while being very simple) is quite sophisticated. There are two recursive calls, each with different parameters.
I was trying to find other examples of such int... |
Examples of sophisticated recursions |
|recursion| |
I was explaining the famous deterministic [linear-time selection algorithm][1] (median of medians algorithm) to a friend.
The recursion in this algorithm (while being very simple) is quite sophisticated. There are two recursive calls, each with different parameters.
I was trying to find other examples of such int... |
Examples of sophisticated recursion |
The Pattern On The Stone: The Simple Ideas That Make Computers, by Daniel Hillis is a very good introduction, starting from the logic building blocks up to programming, algorithms and computer architecture. |
There is a variation on the median finding recurrence that comes from range searching with halfplanes. The recurrence itself is of the form
\\[ T(n) = T(n/2) + T(n/4) + cn \\]
which is similar to the median-finding recurrence. For more on this, look at [Jeff Erickson's lecture notes][1] and in particular Section 4... |
null |
Examples of sophisticated recursive algorithms |
|algorithms|recursion| |
|algorithms|algorithm-analysis|recurrence-relation| |
[Combinatorics][1] deals with discrete mathematical structures. The structures can be either finite or countable.
For problems about algorithms and complexity of computations on discrete structures, consider using the [tag:ds.algorithms] and [tag:cc.complexity-theory] tags.
[1]: http://en.wikipedia.org/wiki/... |
null |
Questions related to combinatorics and discrete mathematical structures |
null |
[Computer architecture][1] is a branch of computer science that deals with hardware of computers including organization, structure, design, and implementation of hardware components and their combinations used in computers with the goal of meeting functional, performance and cost goals and the formal modeling of those ... |
null |
Questions related to computer architecture |
null |
Questions related to logic and its use in computer science |
null |
Use this tag for questions about [programming language][1] design and implementation and about theoretical concepts underlying existing programming languages.
Questions about concrete features of existing programming languages belongs on [Stack Overflow](http://stackoverflow.com/).
For questions related to [lamb... |
null |
Questions related to design, implementation, and analysis of programming languages |
null |
This tag is used for [Logic in Computer Science](http://en.wikipedia.org/wiki/Logic_in_computer_science) and [Mathematical Logic](http://en.wikipedia.org/wiki/Mathematical_logic) questions. |
null |
[Cryptography](http://en.wikipedia.org/wiki/Cryptography) studies techniques for secure computation and communication, i.e. secure storage and manipulation of information, both theoretical and practical.
The purposes of cryptography include [confidentiality](http://en.wikipedia.org/wiki/Confidentiality) (leading to ... |
null |
Construction and analysis of protocols and algorithms for secure computation and communication (including authentication, integrity, and privacy aspects). |
null |
The recursion that I used in [my paper](http://www.springerlink.com/content/7722150064q64865/) "A linear-time algorithm for computing the voronoi diagram of a convex polygon" by Aggarwal *et al* is also quite complicated.
Here is a description of the algorithm from our paper. Steps (a), (c), and (f) are all linear ... |
The recursion that I used in [my paper](http://www.springerlink.com/content/7722150064q64865/) "A linear-time algorithm for computing the voronoi diagram of a convex polygon" by Aggarwal *et al* is also quite complicated.
Here is a description of the algorithm from our paper. In case it's not clear from the descrip... |
The recursion that I used in [my paper](http://www.springerlink.com/content/7722150064q64865/) "A linear-time algorithm for computing the Voronoi diagram of a convex polygon" by Aggarwal *et al* is also quite complicated.
Here is a description of the algorithm from our paper. In case it's not clear from the descrip... |
null |
IIRC, there was a similar problem in [Moshe Vardi][1]'s talk at the [Fields Institute][2] (it wasn't about $\mu$-calculus though).
You may want to check [the slides][3] or check Vardi's papers. There is definitely an algorithm but IIRC the negations cause a [huge increase in the time][4] required to perform the tran... |
|data-structures|time-complexity|strings|stacks| |
What would be the fastest way of doing this (from an algorithmic perspective, as well as a practical matter)?
I was thinking something along the following lines.
I could add to the end of an array and then use bubblesort as it has a best case (totally sorted array at start) that is close to this, and has linear r... |
Adding to a sorted array |
|algorithms|sorting| |
We count the number of array element reads and writes. To do bubble sort, you need $1 + 4n$ accesses (the initial write to the end, then, in the worst case, two reads and two writes to do $n$ swaps). To do the binary search, we need $2\log n + 2n + 1$ ($2\log n$ for binary search, then, in the worst case, $2n$ to shift... |
We count the number of array element reads and writes. To do bubble sort, you need $1 + 4n$ accesses (the initial write to the end, then, in the worst case, two reads and two writes to do $n$ swaps). To do the binary search, we need $2\log n + 2n + 1$ ($2\log n$ for binary search, then, in the worst case, $2n$ to shift... |
We count the number of array element reads and writes. To do bubble sort, you need $1 + 4n$ accesses (the initial write to the end, then, in the worst case, two reads and two writes to do $n$ swaps). To do the binary search, we need $2\log n + 2n + 1$ ($2\log n$ for binary search, then, in the worst case, $2n$ to shift... |
Because you are using an array, it costs O(n) to insert an item - when you add something to the middle of an array, for example, you have to shift all of the elements after it by one so that the array remains sorted.
The fastest way to find out where to put the item is like you mentioned, a binary search, which is O... |
We count the number of array element reads and writes. To do bubble sort, you need $1 + 4n$ accesses (the initial write to the end, then, in the worst case, two reads and two writes to do $n$ swaps). To do the binary search, we need $2\log n + 2n + 1$ ($2\log n$ for binary search, then, in the worst case, $2n$ to shift... |
I have asked a series of questions concerning capabilities of a certain class of exotic automata which I have called *min-heap automata*; the original question, and links to others, can be found [here][1].
This question concerns the computational power of type-2 min-heap automata, which were suggested by Raphael as ... |
Computational power of nondeterministic type-2 min-heap automata |
|formal-languages|automata| |
I have asked a series of questions concerning capabilities of a certain class of exotic automata which I have called *min-heap automata*; the original question, and links to others, can be found [here][1].
This question concerns the power of type-1 min-heap automata, which represent my initial idea for how these mac... |
Computational power of nondeterministic type-1 min-heap automata with multiple heaps |
|formal-languages|automata| |
*See the end of this post for some clarification on the definition(s) of min-heap automata.*
One can imagine using a variety of data structures for storing information for use by state machines. For instance, push-down automata store information in a stack, and Turing machines use a tape. State machines using queues... |
If you have any reason to not using heap, consider using [Insertion Sort][1] instead of Bubble Sort. It's better when you have a few unsorted elements.
[1]: http://en.wikipedia.org/wiki/Insertion_sort |
If you have any reason for not using heap, consider using [Insertion Sort][1] instead of Bubble Sort. It's better when you have a few unsorted elements.
[1]: http://en.wikipedia.org/wiki/Insertion_sort |
|algorithms|efficiency|arrays|sorting| |
Adding elements to a sorted array |
In algorithm analysis you often have to solve recurrences. In addition to Master Theorem, substitution and iteration methods, there is one using *characteristic polynomials*.
Say I have concluded that a characteristic polynomial $x^2 - 2x + 2$ has *imaginary* roots, namely $x_1 = 1+i$ and $x_2 =1-i$. Then I cannot u... |
Solving Recurrences via Characteristic Polynomial with Imaginary Roots |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.