Answered By : David Richerby Because a quantum computer can be simulated using a classical computer: it’s essentially just linear algebra. Given a probability distribution for each of the qubits, you can keep track of how each quantum gate modifies those Read More …
Author: ignougroup
Modifying Dijkstra’s algorithm for edge weights drawn from range $[1,…,K]$
Answered By : Neal Young If edge weights are integers in ${0,1,ldots,K}$, you can implement Dijkstra’s to run in $O(K|V|+|E|)$ time, following @rrenaud’s suggestion. Here is a more explicit explanation. At any time, the (finite) keys in the priority queue are Read More …
Easy reduction from 3SAT to Hamiltonian path problem
Answered By : c c The number of vertices in the well-known reduction from 3SAT to directed Hamiltonian Path(dHAMPATH) can be easily reduced to $O(n+k)$, where $n$ is the number of variables and $k$ is the number of clauses, therefore the Read More …
Number of cycles in a graph?
Answered By : Shaull Assuming you mean simple cycles (otherwise the number is infinite) – yes, of course the number can be exponential: consider the complete graph on $n$ vertices, then every sequence of distinct vertices can be completed to a Read More …
What are handles in parsing?
Answered By : Alex ten Brink Let’s consider the following grammar: 1: $S to A b$ 2: $S to B b$ 3: $A to a a$ 4: $B to a a a$ Obviously, this language is totally uninteresting: the only words Read More …
Why is linear programming in P but integer programming NP-hard?
Answered By : Benjamin Lindqvist I can’t comment since it requires 50 rep, but there are some misconceptions being spread about, especially Raphael’s comment “In general, a continous domain means there is no brute force (and no clever heuristics to speed Read More …
Learning Automated Theorem Proving
Answered By : Dave Clarke My preference is for Coq, but I imagine that others prefer Isabelle. One of the strange things I found about Isabelle is that there is a two-level syntax, where some of your definitions need to be Read More …
Complexity of Towers of Hanoi
Answered By : JeffE No, the problem you’ve described is actually quite easy. The high-level reason is that the index $i$ is roughly $n$ bits long, so we can actually afford to spend time polynomial in $n$. Consider the following related Read More …
What is the advantage of Randomized Quicksort?
Answered By : Jernej If the input array is distributed uniformly at random then (as you noted) there is no difference between always picking an element at a fixed position (for example the middle one as you suggest) or picking an Read More …
Theoretical machines which are more powerful than Turing machines
Answered By : Yuval Filmus The Church–Turing thesis (in one formulation) states that everything that can be physically computable can also be computed on a Turing machine. Assuming you believe this theses, and given that you’re interested in functions which such Read More …