Most Popular

1500 questions
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…
12
votes
3 answers

Efficiently finding the maximum pairwise GCD of a set of natural numbers

Consider the following problem: Let $S = \{ s_1, s_2, ... s_n \} $ be a finite subset of the natural numbers. Let $G = \{$ $\gcd(s_i, s_j) \mid s_i, s_j \in S,$ $ s_i \neq s_j \}$ where $\gcd(x,y)$ is the greatest common divisor of $x$ and $y$ Find…
Tommy
  • 121
  • 1
  • 5
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…
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,440
  • 29
  • 69
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
  • 513
  • 4
  • 14
12
votes
3 answers

Understanding an algorithm for the gas station problem

In the gas station problem we are given $n$ cities $\{ 0, \ldots, n-1 \}$ and roads between them. Each road has length and each city defines price of the fuel. One unit of road costs one unit of fuel. Our goal is to go from a source to a destination…
Wojciech Kulik
  • 223
  • 3
  • 10
12
votes
2 answers

Intersection and union of a regular and a non-regular language

Let $L_1$ be regular, $L_1 \cap L_2$ regular, $L_2$ not regular. Show that $L_1 \cup L_2$ is not regular or give a counterexample. I tried this: Look at $L_1 \setminus (L_2 \cap L_1)$. This one is regular. I can construct a finite automaton for…
Kevin
  • 129
  • 1
  • 2
  • 4
12
votes
1 answer

How do I construct a doubly connected edge list given a set of line segments?

For a given planar graph $G(V,E)$ embedded in the plane, defined by a set of line segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for…
12
votes
2 answers

Is computational power of Neural networks related to the activation function

It is proven that neural networks with rational weights has the computational power of the Universal Turing Machine Turing computability with Neural Nets. From what I get, it seems that using real-valued weights yields even more computational power,…
K.Steff
  • 221
  • 1
  • 5
12
votes
4 answers

Why store self and parent links (. and ..) in a directory entry?

Consider an filesystem targeted at some embedded devices that does little more than store files in a hierarchical directory structure. This filesystem lacks many of the operations you may be used to in systems such as unix and Windows (for example,…
Gilles 'SO- stop being evil'
  • 44,159
  • 8
  • 120
  • 184
12
votes
3 answers

Huffman tree and maximum depth

Knowing the frequencies of each symbol, is it possible to determine the maximum height of the tree without applying the Huffman algorithm? Is there a formula that gives this tree height?
user7060
  • 475
  • 5
  • 12
12
votes
1 answer

Is an infinite union of context-free languages always context-free?

Let $L_1$, $L_2$, $L_3$, $\dots$ be an infinite sequence of context-free languages, each of which is defined over a common alphabet $Σ$. Let $L$ be the infinite union of $L_1$, $L_2$, $L_3$, $\dots $; i.e., $L = L_1 \cup L_2 \cup L_3 \cup \dots $. Is…
Gigili
  • 2,213
  • 3
  • 22
  • 31
12
votes
4 answers

Evaluating the average time complexity of a given bubblesort algorithm.

Considering this pseudo-code of a bubblesort: FOR i := 0 TO arraylength(list) STEP 1 switched := false FOR j := 0 TO arraylength(list)-(i+1) STEP 1 IF list[j] > list[j + 1] THEN switch(list,j,j+1) switched…
Sim
  • 591
  • 1
  • 5
  • 14
12
votes
5 answers

Converting a digraph to an undirected graph in a reversible way

I am looking for an algorithm to convert a digraph (directed graph) to an undirected graph in a reversible way, ie the digraph should be reconstructable if we are given the undirected graph. I understand that this will come in expense of the…
Heterotic
  • 391
  • 1
  • 2
  • 12
12
votes
2 answers

Smallest DFA that accepts given strings and rejects other given strings

Given two sets $A,B$ of strings over alphabet $\Sigma$, can we compute the smallest deterministic finite-state automaton (DFA) $M$ such that $A \subseteq L(M)$ and $L(M) \subseteq \Sigma^*\setminus B$? In other words, $A$ represents a set of…
D.W.
  • 167,959
  • 22
  • 232
  • 500