Most Popular
1500 questions
11
votes
1 answer
How can I show that the Cook-Levin theorem does not relativize?
The following is an exercise which I am stuck at ( source: Sanjeev Arora and Boaz Barak; its not homework ) :
Show that there is an oracle $A$ and a language $L \in NP^A$ such that $L$ is not polynomial-time reducible to 3SAT even when the machine…

advocateofnone
- 2,962
- 1
- 26
- 43
11
votes
5 answers
Is there a known method for constructing a grammar given a finite set of finite strings?
From my reading it seems that most grammars are concerned with generating an infinite number of strings. What if you worked the other way around?
If given n strings of m length, it should be possible to make a grammar that will generate those…

Gustav Bertram
- 270
- 3
- 12
11
votes
2 answers
Is it decidable whether a given context free grammar generates an infinite number of strings?
Is the decision problem "Does a given context free grammar generate an infinite number of strings" decidable? In order to test whether a context free grammar generates an infinite number of strings or not, we can write a program that would test this…

kauray
- 519
- 1
- 6
- 16
11
votes
2 answers
Universal/existential quantification?
I'm struggling to understand the purpose of universal and existential quantification of types. I'm playing around with writing a toy language based on the calculus of constructions. I've been reading about Morte and Henk to help me get a better…

oconnor0
- 393
- 1
- 8
11
votes
1 answer
Finding the longest repeating subsequence
Given a string $s$, I would like to find the longest repeating (at least twice) subsequence. That is, I would like to find a string $w$ which is a subsequence (doesn't have to be a contiguous) of $s$ such that $w=w' \cdot w' $. That is, $w$ is a…

Dan D-man
- 514
- 3
- 9
11
votes
2 answers
Why do we need to run the bellman-ford algorithm for n-1 times?
I'm a little confused about the concept of the Bellman-Ford(BF) algorithm to compute the shortest path in a general graph with negative weights knowing that there are no negative cycles present. I understand why Dikjstra doesn't work for a graph…

Amir Hossein F
- 233
- 1
- 2
- 6
11
votes
3 answers
What is the difference between bounding and pruning in branch-and-bound algorithms?
Could anybody please explain what the difference between "bounding" and "pruning" in branch and bound algorithms is?
I'd also appreciate references (preferably books), where this distinction is made clear.

Martin Thoma
- 2,360
- 1
- 22
- 41
11
votes
3 answers
Is there any proof that quantum computers are more efficient than classical computers?
Shor's algorithm is often used as the argument. It can solve the factorization problem faster than any known algorithm for classical computers. Yet, we have no proof classical computers can't also factor integers efficiently.
Is there any actual…

MaiaVictor
- 4,127
- 1
- 17
- 33
11
votes
2 answers
Given computable function, what are conditions for computability of inverse function?
If $f:\mathbb{N}\rightarrow\mathbb{N}$ is computable and has an inverse, under what conditions is $f^{-1}$ also computable? I couldn't find that in a textbook, and googling gets some vague suggestions about bijective, but I couldn't find a clearly…

John Forkosh
- 305
- 2
- 12
11
votes
2 answers
Decidability of checking an antiderivative?
Let's suppose I have two functions $F$ and $G$ and I'm interested in determining whether
$$F(x) = \int G(x)dx.$$
Let's suppose that my functions are composed of elementary functions (polynomials, exponentials, logs, and trigonometric functions), but…

templatetypedef
- 9,102
- 1
- 30
- 60
11
votes
2 answers
Dynamic programming with large number of subproblems
Dynamic programming with large number of subproblems. So I'm trying to solve this problem from Interview Street:
Grid Walking (Score 50 points)
You are situated in an $N$-dimensional grid at position $(x_1,x_2,\dots,x_N)$. The dimensions of the…

Alexandre
- 349
- 2
- 10
11
votes
0 answers
Alternative to Bloom filter for extreme parameters
A Bloom filter is a space-efficient probabilistic data structure to perform membership-tests on a set (see Wikipedia's page for a definition; I use the same notations below).
I am interested in a special application where the number of bits per…

doc
- 391
- 1
- 8
11
votes
2 answers
Least Common Non-Divisor
Basically, the problem is: For a set $S$ of positive numbers, find a minimal number $d$ that is not a divisor of any element of $S$, i.e. $\forall x \in S,\ d \nmid x$.
Denote $n = |S|$ and $C = \max(S) $.
Consider the function $F(x) = $ the least…

SkyterX
- 163
- 5
11
votes
2 answers
Fast k mismatch string matching algorithm
I am looking for a fast k-mismatch string matching algorithm. Given a pattern string P of length m, and a text string T of length n, I need a fast (linear time) algorithm to find all positions where P matches a substring of T with at most k…

Paresh
- 3,338
- 1
- 20
- 32
11
votes
3 answers
Can a regular expression be infinite?
I know that languages which can be defined using regular expressions and those recognisable by DFA/NFA ( finite automata ) are equivalent. Also no DFA exists for the language $\{0^n1^n|n \ge 0\}$. But still it can be written using regular…

advocateofnone
- 2,962
- 1
- 26
- 43