Most Popular

1500 questions
12
votes
1 answer

What is the use of finding minimum number of straight lines to cover a set of points?

There is that popular problem [1] [2] in the computer science that is finding minimum number of straight lines that covers a given set of points in 2D. Even though I have scanned many papers, none of them has a clear motivation for the problem. What…
padawan
  • 1,455
  • 1
  • 12
  • 30
12
votes
1 answer

DNF to CNF conversion: Easy or Hard

In relation to the thread Proving that the conversion from CNF to DNF is NP-Hard (and a related Math thread): How about the other direction, from DNF to CNF? Is it easy or hard? On Page 2 of this paper, they seem to hint that both directions are…
12
votes
2 answers

What is a lay explanation for universal search?

I am reading a book on a computer science topic but lack some of the prerequisite background. Normally when I run into terms I don't understand I simply look them up, but for Universal Search I simply haven't been able to find an explanation…
quant
  • 253
  • 1
  • 7
12
votes
4 answers

Compression of Random Data is Impossible?

A few days ago this appeared on HN http://www.patrickcraig.co.uk/other/compression.htm. This refers to a challenge from 2001 - where someone was offering a prize of \$5000 for any kind of reduction to the size of randomly generated data (the…
user3467349
  • 387
  • 2
  • 12
12
votes
2 answers

What do we gain by having "dependent types"?

I thought I understood dependent typing (DT) properly, but the answer to this question: https://cstheory.stackexchange.com/questions/30651/why-was-there-a-need-for-martin-l%C3%B6f-to-create-intuitionistic-type-theory has had me thinking…
PhD
  • 347
  • 1
  • 6
12
votes
3 answers

How are hash table's values stored physically in memory?

Question: How are hash table's values stored in memory such that space if efficiently used and values don't have to be relocated often? My current understanding (could be wrong): Let's say I have 3 objects stored in a hash table. Their hash…
Pwner
  • 221
  • 1
  • 2
  • 3
12
votes
3 answers

Does the proof of undecidability of the Halting Problem cheat by reversing results?

I have trouble understanding Turing's halting problem. His proof assumes that there exists a magical machine $H$ which could determine whether a computer would halt or loop forever for a given input. Then we attach another machine that reverses the…
user27819
  • 131
  • 1
  • 4
12
votes
1 answer

Why is this argument for $P\neq NP$ wrong?

I know its silly, but i managed to confuse myself and i need help settling this Suppose $P=NP$, then clearly for every oracle $A$ we have $P^A=NP^A$ which contradicts the fact that there exists some oracle $A$ for which $P^A\neq NP^A$, hence $P\neq…
Ariel
  • 13,614
  • 1
  • 22
  • 39
12
votes
4 answers

Does immutability in functional programming really exist?

Although I work as a programmer in my daily life and use all the trendy languages (Python, Java, C, etc) I still have no clear view of what functional programming is. From what I've read, one property of functionally languages is that data…
Pithikos
  • 393
  • 3
  • 12
12
votes
0 answers

Fast algorithm for max-convolution with concave functions?

I'm interested in a discrete max-convolution problem, which is to compute $$r(c) = \max_{x | x \ge 0, \sum_k x_k = c} \left[ \sum_{k=1} f_k(x_k) \right] $$ for all values $c=0, \ldots, C$, where $x=(x_1, \ldots, x_k)$ is a vector of non-negative…
dan_x
  • 221
  • 1
  • 3
12
votes
3 answers

Why is the A* search heuristic optimal even if it underestimates costs?

A* search finds optimal solution to problems as long as the heuristic is admissible which means it never overestimates the cost of the path to the from any given node (and consistent but let us focus on being admissible at the moment). But why does…
statBeginner
  • 231
  • 1
  • 2
  • 6
12
votes
1 answer

Are all known algorithms for solving NP-complete problems constructive?

Are there any known algorithms that correctly output "yes" to an NP-complete problem without implicitly generating a certificate? I understand that it is straightforward to turn a satisfiability oracle into a satisfying-assignment finder: just…
user82928
  • 243
  • 1
  • 6
12
votes
4 answers

Union of regular languages that is not regular

I've come across that question : "Give examples of two regular languages which their union doesn't output a regular language. " This is pretty shocking to me because I believe that regular languages are closed under union. Which means to me that if…
Dave
  • 279
  • 2
  • 4
  • 10
12
votes
3 answers

How fast can we find all Four-Square combinations that sum to N?

A question was asked at Stack Overflow here: Given an integer $N$, print out all possible combinations of integer values of $A,B,C$ and $D$ which solve the equation $A^2+B^2+C^2+D^2 = N$. This question is of course related to Bachet's Conjecture…
12
votes
1 answer

baz_num_elts exercise from Software Foundations

I'm at the following exercise in Software Foundations: (** **** Exercise: 2 stars (baz_num_elts) *) (** Consider the following inductive definition: *) Inductive baz : Type := | x : baz -> baz | y : baz -> bool -> baz. (** How _many_…
Twernmilt
  • 123
  • 6