Most Popular

1500 questions
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
2 answers

Group isomorphism to graph ismorphism

In reading some blogs about computational complexity (for example here)I assimilated the notion that deciding if two groups are isomorphic is easier than testing two graphs for isomorphism. For example, on the stated page it says that graph…
Jernej
  • 2,450
  • 14
  • 26
12
votes
3 answers

Why Term Rewriting?

I've done a bit of googleing and have come up a bit short. I am wondering what are the main reasons for computing scientists, programmers, to study term rewriting, and/or term graph rewriting. As far as I can tell, it just helps for basic reasoning…
Musa Al-hassy
  • 884
  • 1
  • 5
  • 9
12
votes
4 answers

NFA with exponential number of states when determinized

How can I build an example of a regular language where the minimal DFA has $2^n$ states and the minimal NFA has $n$ states? Obviously the DFA's state-set should contain all subsets of the the NFA's state-set, but I don't know how to start. Any…
mrk
  • 3,688
  • 22
  • 35
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…
RBarryYoung
  • 231
  • 2
  • 12
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
12
votes
2 answers

Graph isomorphism problem for labeled graphs

In the case of unlabeled graphs, the graph isomorphism problem can be tackled by a number of algorithms which perform very well in practice. That is, although the worst case running time is exponential, one usually has a polynomial running time. I…
Max
  • 121
  • 1
  • 3
12
votes
1 answer

What is $Prop$ in the calculus of constructions?

I'm looking at the Calculus of Constructions and its place in the Lambda Cube. If I understand correctly, each axis of the cube can be thought of as adding another operation involving types to the simply-typed calculus, $\lambda_\to$. The first axis…
Michael Rawson
  • 243
  • 1
  • 8
12
votes
5 answers

Is 2**x faster to compute than exp(x)?

Forgive the naïveté that will be obvious in the way I ask this question as well as the fact that I'm asking it. Mathematicians typically use $\exp$ as it's the simplest/nicest base in theory (due to calculus). But computers seem to do everything in…
isomorphismes
  • 237
  • 2
  • 5
12
votes
2 answers

The equivalence relations cover problem (in graph theory)

An equivalence relation on a finite vertex set can be represented by an undirected graph that is a disjoint union of cliques. The vertex set represents the elements and an edge represents that two elements are equivalent. If I have a graph $G$ and…
Thomas Klimpel
  • 5,380
  • 27
  • 66
12
votes
1 answer

Prove that a boolean function computable in T(n) by a RAM machine is in DTIME(T(n)^2)

The question is exercise 1.9 from Arora-Barak's book Computational Complexity — A Modern Approach: Define a RAM Turing machine to be a Turing machine that has random access memory. We formalize this as follows: The machine has an infinite array A…
c c
  • 493
  • 4
  • 14