id int64 1 141k | title stringlengths 15 150 | body stringlengths 43 35.6k | tags stringlengths 1 118 | label int64 0 1 |
|---|---|---|---|---|
2,817 | From in-order representation to binary tree | <p>Is there a way to reconstruct a binary tree just from its in-order representation?</p>

<p>I've searched the internet, but I could only find solutions for reconstructing a binary tree from inorder and preorder representations, but none for only inorder.</p>
 | algorithms graphs binary trees | 0 |
2,819 | Reason for global update steps in the push-relabel algorithm | <p>I know why and how the <a href="https://en.wikipedia.org/wiki/Push-relabel_algorithm" rel="nofollow">push relabel algorithm</a> works for solving the max-flow problem. But why is a global update step required? </p>
 | algorithms graphs network flow | 0 |
2,824 | Most efficient known priority queue for inserts | <p>In terms of asymptotic space and time complexity, what is the most efficient priority-queue?
Specifically I am looking for priority queues which minimize the complexity of inserts, it's ok if deletes are a little slower.</p>

<p><sub> If you're looking for a survey of priority-queues which minimises comp... | data structures time complexity priority queues | 0 |
2,826 | An edge that connects more than two nodes in a graph? | <p>Is there a way to create a single edge on a graph that connects 3 or more nodes? For example, let's say that the probability of Y occurring after X is 0.1, and the probability of Z occurring after Y is 0.001, but the probability of Z occurring after <em>both</em> X and Y occur is 0.95. If the probabilities are assig... | algorithms graphs probabilistic algorithms weighted graphs | 0 |
2,832 | Is a push-down automaton with two stacks equivalent to a turing machine? | <p>In <a href="https://stackoverflow.com/a/559969/113124">this answer</a> it is mentioned</p>

<blockquote>
 <p>A regular language can be recognized by a finite automaton. A context-free language requires a stack, and <strong>a context sensitive language requires two stacks (which is equivalent to saying i... | computability turing machines automata pushdown automata | 1 |
2,834 | How can I verify a solution to Travelling Salesman Problem in polynomial time? | <p>So, <a href="http://en.wikipedia.org/wiki/Travelling_salesman_problem#Computational_complexity">TSP (Travelling salesman problem) decision problem is <strong>NP complete</strong></a>.</p>

<p>But I do not understand how I can verify that a given solution to TSP is in fact optimal in polynomial time, given th... | complexity theory np complete traveling salesman | 1 |
2,837 | Is it intuitive to see that finding a Hamiltonian path is not in P while finding Euler path is? | <p>I am not sure I see it. From what I understand, edges and vertices are complements for each other and it is quite surprising that this difference exists.</p>

<p>Is there a good / quick / easy way to see that in fact finding a Hamiltonian path should be much harder than finding a Euler path?</p>
 | complexity theory graphs np complete intuition | 1 |
2,840 | Greedy choice and matroids (greedoids) | <p>As I was going through the material about the greedy approach, I came to know that a knowledge on matroids (greedoids) will help me approaching the problem properly. After reading about matroids I have roughly understood what matroids are. But how do you use the concept of a matroid for solving a given optimisation ... | algorithms graphs greedy algorithms matroids | 1 |
2,843 | Showing $A-B$ is a CFL where $A$ is a CFL and $B$ is finite | <blockquote>
 <p>Show that if $A$ is a context-free language and $B$ is finite, then $A - B$ is a context-free language.</p>
</blockquote>

<p>I'm just not sure how to use their properties to formally show this. Thanks for all the help in advance.</p>
 | formal languages context free proof techniques | 0 |
2,845 | Standard or Top Text on Applied Graph Theory | <p>I am looking for a reference text on applied graph theory and graph algorithms. Is there a standard text used in most computer science programs? If not, what are the most respected texts in the field? I have Cormen et al.</p>
 | algorithms graphs reference request education books | 1 |
2,847 | What is a good binary encoding for $\phi$-based balanced ternary arithmetic algorithms? | <p>I've been looking for a way to represent the <a href="http://en.wikipedia.org/wiki/Golden_ratio_base" rel="nofollow">golden ratio ($\phi$) base</a> more efficiently in binary. The standard binary golden ratio notation works but is horribly space inefficient. The Balanced Ternary Tau System (BTTS) is the best I've... | algorithms data structures efficiency coding theory | 1 |
2,851 | Does this regular expression equal this automata? | <p>I just came across an exercise which is to find a regular expression for the following automata, such that the regular expression and the automata generate the same language.</p>

<p><img src="https://i.stack.imgur.com/4Zk9t.png" alt="NFA"></p>

<p>One solution presents the following expression:</p>&... | regular languages automata finite automata regular expressions | 0 |
2,854 | Which method for ODE instead of Euler's? | <p>I need a super-fast method for ordinary differential equations. Should I use the <a href="http://en.wikipedia.org/wiki/Midpoint_method" rel="nofollow">midpoint method</a>? I need this for a <a href="http://en.wikipedia.org/wiki/Reaction%E2%80%93diffusion_system" rel="nofollow">reaction-diffusion system</a> (Gray-Sco... | algorithms numerical analysis | 0 |
2,855 | Choosing an element from a set satisfying a predicate uniformly at random in $O(1)$ space | <p>We are given a set of objects, say integers, $S$. In addition, we are given a predicate $P$, for example $P(i): \Leftrightarrow i \geq 0$. We don't know in advance how many elements of $S$ satisfy the predicate $P$, but we would like to sample or choose an element uniformly at random from $S' = \{ i \mid i \in S \we... | algorithms randomized algorithms streaming algorithm in place | 1 |
2,857 | Can top SAT-solvers factor easy numbers? | <p>Modern SAT-solvers are very good at solving many real-world examples of SAT instances. However, we know how to generate hard ones: for instance use a <a href="https://cstheory.stackexchange.com/q/6755/1037">reduction from factoring to SAT</a> and give the RSA numbers as input.</p>

<p>This raises the questio... | complexity theory satisfiability sat solvers factoring | 0 |
2,861 | Are regular languages closed under sort (Parikh image)? | <p>Assume $L$ is a regular language over an ordered alphabet. Is the language built by taking every word in $L$ and sorting it always a regular language?</p>
 | formal languages regular languages | 1 |
2,863 | Determining the particular number in $O(n)$ time and space (worst case) | <p>$\newcommand\ldotd{\mathinner{..}}$Given that $A[1\ldotd n]$ are integers such that $0\le A[k]\le m$ for all $1\le k\le n$, and the occurrence of each number except a particular number in $A[1\ldotd n]$ is an odd number. Try to find the number whose occurrence is an even number.</p>

<p>There is an $\Theta(n... | algorithms search algorithms | 1 |
2,868 | How to call something that can be either a terminal or a nonterminal? | <p>I had written a <a href="https://github.com/shabbyX/shCompiler" rel="nofollow">compiler compiler</a> a few years ago and I'm now cleaning it up, improving it, and turning it into C.</p>

<p>I came across a terminology problem however that I remember in the past I couldn't solve it either.</p>

<p>Ima... | terminology formal grammars compilers | 1 |
2,869 | What are staged functions (conceptually)? | <p>In a recent CACM article [1], the authors present an implementation for <em>staged functions</em>. They use the term as if it was well-known, and none of the references looks like an obvious introduction.</p>

<p>They give a short explanation (emphasis mine and reference number changed; it's 22 in the origin... | terminology programming languages meta programming | 1 |
2,872 | Origins of the term "distributed hash table" | <p>I am currently researching for my diploma thesis in computer science with a topic in the area of distributed hash tables. Naturally, I came to the question were the term <em>distributed hash table</em> came from. (I know it is not rocket science to just derive it from <em>distributing a hash table</em>, but somebody... | data structures terminology distributed systems hash tables history | 1 |
2,875 | Determining Probability from a Graph | <p>Lets say I have node A that connects to 10 other nodes. 6 of those nodes have Property 1 and the other 4 have Property 2. How can I easily determining the probability of landing on a node with property 1 randomly while traversing the graph?</p>

<h1>Abstract Example</h1>

<p>To clarify this problem, ... | graphs probability theory | 0 |
2,878 | Universal simulation of Turing machines | <p>Let <span class="math-container">$f$</span> be a fixed time-constructable function.</p>
<p>The classical universal simulation result for TMs (Hennie and Stearns, 1966) states that there is a two-tape TM <span class="math-container">$U$</span> such that given</p>
<ul>
<li>the description of a TM <span cla... | complexity theory reference request turing machines machine models simulation | 1 |
2,880 | distinction between $\textbf{P}^{\# \textbf{P}}$ and $\# \textbf{P}$-Complete | <p>We know that $\# \textbf{P}$ is closed under polynomial sums, i.e., sum of polynomially many $\# \textbf{P}$ functions is still in $\# \textbf{P}$.</p>

<p>Functions in $\textbf{P}^{\# \textbf{P}}$ are those which make polynomially many (non-parallel) queries to an oracle for a $\# \textbf{P}$-Complete probl... | complexity theory time complexity | 0 |
2,881 | Counting certificates for a language | <p>Let $M_{1}$ and $M_{2}$ be two (non-deterministic) turing machines accepting the language $L \subseteq \Sigma^{\ast}$.</p>

<p>Is is right to claim that:</p>

<p>$\#M_{1} \in \textbf{#C}$ <em>if and only if</em> $\#M_{2} \in \textbf{#C}$ ?</p>

<p>where $\textbf{#C}$ is a counting complexity ... | complexity theory | 0 |
2,886 | Notation for operational semantics that can be used in code comments | <p>I'm defining an intermediate language for a multi-backend code generator that I'm writing. I want to document the operational semantics for this intermediate language in a way that is readable both from within the source code and generated documentation (ocamldoc). The notation introduced used in "Types and Progra... | programming languages semantics operational semantics | 1 |
2,887 | Why does NTIME consider the length of the longest computation? | <p>In Sipser's textbook "Introduction to the Theory of Computation, Second Edition," he defines nondeterministic time complexity as follows:</p>

<blockquote>
 <p>Let $N$ be a nondeterministic Turing machine that is a decider. The <strong>running time</strong> of $N$ is the function $f : \mathbb{N} \right... | complexity theory time complexity terminology turing machines nondeterminism | 1 |
2,889 | Determining whether a CFG is $LL(k)$ for any $k$? | <p>In <a href="http://classes.engr.oregonstate.edu/eecs/winter2012/cs480/assignments/Knuth-1965-TranslationofLanguages.pdf" rel="nofollow">Knuth's original paper on $LR(k)$ grammars</a>, he proved that the decision problem "Given a CFG $G$, is there a $k$ such that $G$ is an $LR(k)$ grammar?" is undecidable.</p>
&#... | formal languages computability formal grammars context free parsing | 1 |
2,893 | Bound on space for selection algorithm? | <p>There is a well known worst case $O(n)$ <a href="http://en.wikipedia.org/wiki/Selection_algorithm">selection algorithm</a> to find the $k$'th largest element in an array of integers. It uses a <a href="http://en.wikipedia.org/wiki/Selection_algorithm#Properties_of_pivot">median-of-medians</a> approach to find a goo... | algorithms algorithm analysis space complexity lower bounds | 1 |
2,902 | Source entropy and other questions related to information theory | <p><a href="http://www.scholarpedia.org/article/Kolmogorov-Sinai_entropy" rel="nofollow">Kolmogorov-Sinai entropy</a> (KS) explains the mathematical concept behind KS entropy. </p>

<p>$$h ( T ) =\sup\limits_{\xi} \, h ( T , \xi )$$</p>

<p>defines the formula for KS where the left-hand side is nothing ... | reference request information theory entropy | 0 |
2,903 | Order preserving encoding of strings to numbers | <p>I want to encode strings as real numbers while preserving order. The order of the strings is the lexicographic order (as used in phone books); the order of the numbers is the standard order.</p>

<p>Is there an general (i.e. no additional conditions such as e.g. known max string size) encoding with this prop... | order theory | 0 |
2,907 | What exactly is the difference between supervised and unsupervised learning? | <p>I am trying to understand clustering methods.</p>

<p>What I I think I understood:</p>

<ol>
<li><p>In supervised learning, the categories/labels data is assigned to are known before computation. So, the labels, classes or categories are being used in order to "learn" the parameters that are real... | machine learning data mining clustering | 1 |
2,919 | Inferring refinement types | <p>At work I’ve been tasked with inferring some type information about a dynamic language. I rewrite sequences of statements into nested <code>let</code> expressions, like so:</p>

<pre><code>return x; Z => x
var x; Z => let x = undefined in Z
x = y; Z =>... | programming languages logic type theory type inference | 1 |
2,922 | Semantic clustering | <p>I have a very specific question about semantic clustering.</p>

<p>I have a list of words/phrases. I want to run an intelligent semantic clustering algorithm on this list. Please let me know what the available options are. Definitely I am looking for NLP based algorithms.</p>

<p>Simple, open-source,... | algorithms strings string metrics natural language processing ontologies | 0 |
2,923 | Looking for a book that derives and constructs a model checking application | <p>I am teaching myself program verification and am currently learning <a href="http://en.wikipedia.org/wiki/Proof_assistant" rel="nofollow">proof assistants</a>. I have the book <a href="http://www.cambridge.org/gb/knowledge/isbn/item2327697/?site_locale=en_GB" rel="nofollow">Handbook of Practical Logic and Automated ... | reference request formal methods proof assistants model checking | 1 |
2,933 | Complexity of computing $n^{n^2}$ | <p>What is the complexity of computing $n^{n^2},\;n \in \mathbb{N}$?</p>
 | complexity theory integers number theory | 0 |
2,936 | Analysis of a linear-time algorithm for longest palindromic substring | <h3>Background</h3>

<p>$\newcommand\ldotd{\mathinner{..}}$Last month, I heard about a new linear-time algorithm to determine the <a href="https://en.wikipedia.org/wiki/Longest_palindromic_substring" rel="nofollow">longest palindromic substring</a> called Jeuring's algorithm. It seemed interesting, therefore I ... | algorithms algorithm analysis runtime analysis | 0 |
2,938 | Can bottom-up architectures be effectively programmed in top-down paradigms? | <p>The <a href="http://en.wikipedia.org/wiki/Subsumption_architecture" rel="nofollow">subsumption architecture</a>, proposed by Rodney Brooks in 1986, is a "bottom-up" approach, in which robots are designed using simple hierarchical models. These models build upon and subsume the lower modules to form a final product.... | programming languages artificial intelligence algorithm design object oriented | 1 |
2,939 | Do non-computable functions grow asymptotically larger? | <p>I read about busy beaver numbers and how they grow asymptotically larger than any computable function. Why is this so? Is it because of the busy beaver function's non-computability? If so, then do all non-computable functions grow asymptotically larger than computable ones?</p>

<p><strong>Edit:</strong></p>... | computability asymptotics | 1 |
2,942 | Am I right about the differences between Floyd-Warshall, Dijkstra and Bellman-Ford algorithms? | <p>I've been studying the three and I'm stating my inferences from them below. Could someone tell me if I have understood them accurately enough or not? Thank you.</p>

<ol>
<li><p><a href="https://en.wikipedia.org/wiki/Dijkstra_algorithm" rel="noreferrer">Dijkstra algorithm</a> is used only when you have a... | algorithms graphs | 0 |
2,948 | Counting with constant space bounded TMs | <p>The problem, coming from an interview question, is:</p>

<blockquote>
 <p>You have a stream of incoming numbers in range 0 to 60000 and you have
 a function which will take a number from that range and return the
 count of occurrence of that number till that moment. Give a suitable
 Data ... | regular languages turing machines finite automata space complexity streaming algorithm | 1 |
2,950 | How to calculate the depth of sorting networks? | <p>I have trouble understanding how to calculate the depth of a sorting network on $n$ inputs.</p>

<p>For example, in case of selection sort, we have:</p>

<p>$\qquad \displaystyle D(n)=D(n-1)+2\\\qquad D(2)=1$</p>

<p>which leads to</p>

<p>$\qquad \displaystyle D(n)=2n-3=\Theta(n)$</p... | algorithms algorithm analysis recurrence relation sorting | 0 |
2,952 | Generating inputs for random-testing graph algorithms? | <p>When testing algorithms, a common approach is random testing: generate a significant number of inputs according to some distribution (usually uniform), run the algorithm on them and verify correctness. Modern testing frameworks can generate inputs automatically given the algorithms signature, with some restrictions.... | algorithms graphs randomness software testing | 1 |
2,955 | Semantic similarity in text | <p>Is there a relatively simple way of telling if two pieces of text are semantically similar?</p>

<p>Some assumptions that are valid:</p>

<ul>
<li>It is all english</li>
<li>I have a list of all the <em>important</em> nouns</li>
</ul>

<p>Are there any strategies that I should pur... | algorithms natural language processing ontologies | 0 |
2,956 | Is MAX-SAT NP-hard? | <p>Is the <a href="http://en.wikipedia.org/wiki/Maximum_satisfiability_problem" rel="nofollow">MAX-SAT problem</a> NP-hard? From the Wikipedia page:</p>

<blockquote>
 <p>The MAX-SAT problem is NP-hard, since its solution easily leads to the solution of the boolean satisfiability problem, which is NP-compl... | complexity theory reductions | 0 |
2,957 | Finding a sequence of numbers where every product of two mod k is unique | <p>I want to make a sequence of numbers, where I pick the numbers $a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n+1$.</p>

<p>Now I want the product of any pair of two numbers in the sequence modulo $k$ to be guaranteed to be unique and $k$ has to be as small as it can be in such a way that the result... | algorithms number theory | 0 |
2,961 | Example using Penetrance & Branching Factor in State-space Heuristic Search | <p>I need an example for how to calculate penetrance and branching factor of the search tree in in state-space heuristic search. The definitions are as following. <em>Penetrance</em> $P$ is defined by</p>

<p>$\qquad \displaystyle P = \frac{L}{T}$</p>

<p>and <em>branching factor</em> $B$ is defined by<... | artificial intelligence search algorithms | 1 |
2,962 | Period in postulate; what does it mean? | <p>While I am learning a lot from others here at the Computer Science site, I must admit that I don't get as much out of some questions and answers since I typically don't understand the theorems to the level necessary. I am currently reading <a href="http://rads.stackoverflow.com/amzn/click/0910319375" rel="nofollow n... | terminology logic | 1 |
2,965 | Looking for books on creating and understanding theorems targeted at Computer Science | <p>In studying logic to understand verifying programs I have found that there are books on logic targeted at Computer Science e.g.</p>

<ul>
<li><a href="http://rads.stackoverflow.com/amzn/click/052154310X" rel="nofollow">Logic in Computer Science: Modelling and Reasoning about Systems </a></li>
<li><a ... | logic proof techniques books | 1 |
2,971 | Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$ | <p>Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.<br>
The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing </p>

<p>$\qquad \begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) + n \\ &\leq cn +n \\ &=O(n) \qua... | proof techniques asymptotics recurrence relation landau notation induction | 1 |
2,973 | Generalised 3SUM (k-SUM) problem? | <p>The <a href="http://en.wikipedia.org/wiki/3SUM">3SUM</a> problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$.</p>

<p>It is conjectured that there is not better solution than quadratic, i.e. $\mathcal{o}(n^2)$. Or to put it differently: $\mathcal{o}(n \log(n) + n... | complexity theory combinatorics complexity classes | 1 |
2,976 | How to implement simulation on two LTSs? | <p>Does any one know how to implement the simulation relation on two <a href="https://en.wikipedia.org/wiki/State_transition_system" rel="nofollow">labelled transition systems</a> (LTS)? </p>

<p>I know how to do it for branching bi-simulation. The signature refinement theorem is used for that purpose which has... | automata formal methods process algebras | 0 |
2,981 | Showing that the set of TMs which visit the starting state twice on the empty input is undecidable | <p>I'm trying to prove that </p>

<p>$L_1=\{\langle M\rangle \mid M \text{ is a Turing machine and visits } q_0 \text{ at least twice on } \varepsilon\} \notin R$.</p>

<p>I'm not sure whether to reduce the halting problem to it or not. I tried to construct a new machine $M'$ for $(\langle M \rangle,w)$... | turing machines reductions undecidability halting problem | 1 |
2,982 | Examples of undecidable problems whose intersection is decidable | <p>I know that given two problems are undecidable it does not follow that their intersection must be undecidable. For example, take a property of languages $P$ such that it is undecidable whether the language accepted by a given pushdown automaton $M$ has that property. Clearly $P$ and $\lnot P$ are undecidable (for a ... | reference request undecidability decision problem | 1 |
2,983 | Optimization problem vs decision problem - reduction | <p>Assume we have an optimization problem with function $f$ to maximize.</p>

<p>Then, the corresponding decision problem 'Does there exist a solution with $f\ge k$ for a given $k$?' can easily be reduced to the optimization problem: calculate the optimal solution and check if it is $\ge k$.</p>

<p>Now... | complexity theory optimization reductions decision problem | 0 |
2,985 | Micro-optimisation for edit distance computation: is it valid? | <p>On <a href="https://en.wikipedia.org/wiki/Levenshtein_distance#Computing_Levenshtein_distance">Wikipedia</a>, an implementation for the bottom-up dynamic programming scheme for the edit distance is given. It does not follow the definition completely; inner cells are computed thus:</p>

<pre><code>if s[i] = t... | algorithms dynamic programming string metrics correctness proof program optimization | 1 |
2,987 | Automated geometric theorem-proving using synthetic methods | <p>This question is about geometric theorem proving and is inspired by this <a href="https://math.stackexchange.com/questions/31192/is-it-possible-to-solve-any-euclidean-geometry-problem-using-a-computer"> Math.SE </a> post. Currently, Euclidean-geometric theorem provers, as referred to in the post, use coordinate geo... | artificial intelligence automated theorem proving | 1 |
2,988 | How fast can we find all Four-Square combinations that sum to N? | <p>A question was asked at Stack Overflow (<a href="https://stackoverflow.com/questions/11732555/how-to-find-all-possible-values-of-four-variables-when-squared-sum-to-n#comment15599644_11732555">here</a>):</p>

<blockquote>
 <p>Given an integer $N$, print out all possible
 combinations of integer valu... | complexity theory time complexity number theory enumeration | 1 |
2,989 | Factor a grammar | <p>Consider the context free grammar:</p>

<p>$\qquad \begin{align}
 \mathrm{bill} &\to \mathrm{items}\ \mathrm{total}\ \mathrm{vat} \\
 \mathrm{items} &\to \mathrm{item} \mid \mathrm{item}\ \mathrm{items} \\
 \mathrm{item} &\to name\ \mathrm{price} \mid name\ \mathrm{quantity}\... | formal languages formal grammars context free | 0 |
2,994 | Time complexity formula of nested loops | <p>I've just begun this stage 2 Compsci paper on algorithms, and stuff like this is not my strong point. I've come across this in my lecture slides.</p>

<pre><code>int length = input.length();
for (int i = 0; i < length - 1; i++) {
 for (int j = i + 1; j < length; j++) {
 System.out... | algorithms algorithm analysis runtime analysis loops | 1 |
2,999 | Problem with the definition of P | <p>In <em>"Introduction to Algorithms: 3rd Edition"</em> there is Theorem 34.2, which states</p>

<blockquote>
 <p>$P = \{ L \mid L \text{ is accepted by a polynomial-time algorithm} \}$</p>
</blockquote>

<p><em>"Accepted in polynomial-time"</em> is defined by:</p>

<blockquote>
 ... | complexity theory terminology time complexity polynomial time | 1 |
3,001 | Why can L3 caches hold only shared blocks? | <p>In a recent CACM article [1], the authors present a way to improve scalability of shared and coherent caches. The core ingredient is assuming the caches are <em>inclusive</em>, that is higher-level caches (e.g. L3, one global cache) contain all blocks which are stored in their descendant lower-level caches (e.g. L1... | terminology computer architecture cpu cache shared memory | 1 |
3,005 | Smoothing in Naive Bayes model | <p>A Naive Bayes predictor makes its predictions using this formula:</p>

<p>$$P(Y=y|X=x) = \alpha P(Y=y)\prod_i P(X_i=x_i|Y=y)$$</p>

<p>where $\alpha$ is a normalizing factor. This requires estimating the parameters $P(X_i=x_i|Y=y)$ from the data. If we do this with $k$-smoothing, then we get the esti... | machine learning probability theory statistics | 0 |
3,007 | Find a permutation that maximize the minimum of $\frac{a_n}{a_{n-1}} + \frac{a_n}{a_{n+1}}$ | <p>Consider a sequence of $n$ positive real numbers $a_0,\ldots,a_{n-1}$. Let $S_n$ be the set of permutations on $\{0,\ldots,n-1\}$. </p>

<p>We are interested to find</p>

<p>$$
\max_{\pi\in S_n}\left( \min_{i=0}^{n-1}\left( \frac{a_{\pi(i)}}{a_{\pi(i-1)}} + \frac{a_{\pi(i)}}{a_{\pi(i+1)}}\right)\... | complexity theory reductions np hard | 0 |
3,010 | Does Subset Sum allow multisets? | <p>In the Subset Sum problem can some of the given numbers $a_1,a_2,a_3,\dots,a_n$ be the same? For example, we might have $[1,1,1,2,3,4]$ and the target is $5$? Can I assume that I have a specific solution with numbers $2$ and $3$ and $1,1,1$ and $2$ is not?</p>
 | complexity theory terminology | 0 |
3,012 | What if the electricity goes off while a file is being renamed? | <p>Suppose I'm renaming a file and the electricity goes off right in the middle. Naively, it looks like the file could be in some “half-renamed” state. Maybe the name would have half the old name and half the new name. Or maybe the file could disappear altogether because it no longer exists under the old name but it do... | operating systems filesystems fault tolerance | 1 |
3,013 | Seeking "gold standard" to evaluate accuracy of network clustering algorithm | <p>I'm currently looking at network clustering algorithms (we're currently looking at both directed and undirected, unweighted networks). The algorithms we've tried produce visually nice clusters. However, we would like to evaluate them against some "gold standard" -- a collection of networks in which the clusters ha... | algorithms data sets network topology | 0 |
3,014 | Running time of CDCL compared to DPLL | <p>What's the complexity of Conflict-Driven Clause Learning SAT solvers, compared to DPLL solvers? Was it proven that CDCL is faster in general? Are there instances of SAT that are hard for CDCL but easy for DPLL?</p>
 | complexity theory time complexity efficiency satisfiability sat solvers | 1 |
3,019 | What is the novelty in MapReduce? | <p>A few years ago, <a href="https://en.wikipedia.org/wiki/Mapreduce">MapReduce</a> was hailed as revolution of distributed programming. There have also been <a href="http://craig-henderson.blogspot.de/2009/11/dewitt-and-stonebrakers-mapreduce-major.html">critics</a> but by and large there was an enthusiastic hype. It ... | algorithms distributed systems parallel computing algorithm design | 1 |
3,021 | 3CF 3-conjunctive form satisfiability | <p>I am self studying discrete math and I am going through MIT Mathematics for CS lecture notes but they do not have solutions available. I got stuck at <a href="http://www.scribd.com/doc/101941032/3cf" rel="nofollow">Problem 3.14</a> (pages 64-65 of <a href="http://courses.csail.mit.edu/6.042/spring12/part1.pdf" rel="... | logic satisfiability 3 sat normal forms | 0 |
3,022 | Maximum Independent Subset of 2D Grid Subgraph | <p>In the general case finding a Maximum Independent Subset of a Graph is NP-Hard.</p>

<p>However consider the following subset of graphs:</p>

<ul>
<li>Create an $N \times N$ grid of unit square cells.</li>
<li>Build a graph $G$ by creating a vertex corresponding to every cell. Notice that th... | algorithms graphs | 1 |
3,027 | Maximum Independent Set of a Bipartite Graph | <p>I'm trying to find the Maximum Independent Set of a Biparite Graph.</p>

<p>I found the following in some notes <strong>"May 13, 1998 - University of Washington - CSE 521 - Applications of network flow"</strong>:</p>

<blockquote>
 <p><strong>Problem:</strong></p>
 
 <p>Given a biparti... | algorithms graphs network flow | 1 |
3,028 | Is Category Theory useful for learning functional programming? | <p>I'm learning Haskell and I'm fascinated by the language. However I have no serious math or CS background. But I am an experienced software programmer.</p>

<p>I want to learn category theory so I can become better at Haskell. </p>

<p>Which topics in category theory should I learn to provide a good b... | programming languages functional programming category theory | 0 |
3,029 | Measuring entropy for a table (e.g., SQL results) | <p>We're running some benchmarks for an approximative query-answering system. It's sufficient to just think of it as running some SQL queries with joins. We are counting the results returned as part of the benchmark. However, the results often contain a lot of redundancy, so just counting results seems coarse.</p>
... | reference request information theory data compression database theory entropy | 0 |
3,031 | What is known about coRL and RL? | <p>Wondering about any known relations between <a href="http://qwiki.stanford.edu/index.php/Complexity_Zoo%3aR#rl" rel="nofollow">$\mathsf{RL}$</a> complexity class (one sided error with logarithmic space) and its complementary class, $\mathsf{coRL}$.</p>

<p>Are they the same class?</p>

<p>What are $\... | complexity theory complexity classes probabilistic algorithms | 1 |
3,034 | Validity of predicate logic formulas | <p>The following predicate logic formula is invalid (<em>i.e.</em> not a tautology):</p>

<p>$\Bigl[\forall x \,\exists y {\,.\,} P(x,y)\Bigr] \implies \Bigl[\exists y \, \forall x {\,.\,} P(x,y)\Bigr]$</p>

<p>Which of the following are counter-models (<em>i.e.</em> counterexamples) for it?</p>
&#x... | logic logical validity | 0 |
3,038 | For the time hierarchy theorem, how is the input translated efficiently? | <p>I'm trying to understand the proof of the time hierarchy theorem appearing in sipser's book. The proof requires a TM M to simulate an arbitrary TM N without too much slowdown. In particular, it is assumed that the encoding of N's tape alphabet using M's alphabet causes only a constant factor slowdown. This seems pl... | complexity theory turing machines simulation | 0 |
3,039 | Run time of product of polynomially bounded numbers | <p>Let $M$ denote a set of $n$ positive integers, each less than $n^c$.</p>

<p>What is the runtime of computing $\prod_{m \in M} m$ with a deterministic Turing machine?</p>
 | algorithms time complexity integers | 1 |
3,040 | name matching algorithms from partial input | <p>There are a lot of algorithms out there that solve this particular problem. My main problem is in trying to understand how they work; where to start. Most of the algorithms are academic in nature.</p>

<p>There is a master list of product names. We feed in an input file into the program with product names, b... | algorithms | 0 |
3,044 | Is the set of minimal DFA decidable? | <p>Let $\mathrm{MIN}_{\mathrm{DFA}}$ collection of all the codings of DFAs such that they are minimal regarding their states number. I mean if $\langle A \rangle \in \mathrm{MIN}_{\mathrm{DFA}}$ then for every other DFA $B$ with less states than $A$, $L(A)\ne L(B)$ holds. I'm trying to figure out how come that $\mathrm... | formal languages computability automata finite automata | 1 |
3,050 | Analyzing Twitter Relationships | <p>I'm not even sure if this is the right StackExchange to post this, but it seems like sentiment analysis would go here.</p>

<p>What would be the best approach to determine if two people on Twitter are actually friends?</p>

<p>I think that the first criteria would be that they are following each othe... | algorithms machine learning computer networks social networks | 0 |
3,052 | Problem similar to set packing | <p>Call a family of sets $\mathcal{F} = \{S_1, \dotsc, S_k\}$ "diverse" if each set $S_i \in \mathcal{F}$ has at least one unique element. What are possible approaches for finding the largest diverse set $S$ in a family of sets $\mathcal{F}$?</p>

<p>One approach is to solve a modified set packing problem. Su... | algorithms combinatorics heuristics | 0 |
3,053 | Arithmetic expressions grammar transformation | <p>In the article <a href="http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm" rel="nofollow">Parsing Expressions by Recursive Descent by Theodore Norvell (1999)</a> the author starts with the following grammar for arithmetic expressions:</p>

<pre><code>E --> E "+" E | E "-" E | "-" E | E "*" E | E "/" E | E... | formal languages context free formal grammars left recursion | 0 |
3,056 | Compression of domain names | <p>I am curious as to how one might <em>very compactly</em> compress the domain of an arbitrary <a href="http://en.wikipedia.org/wiki/Internationalized_domain_name" rel="noreferrer">IDN</a> hostname (as defined by <a href="http://tools.ietf.org/html/rfc5890" rel="noreferrer">RFC5890</a>) and suspect this could become a... | algorithms strings natural language processing data compression | 0 |
3,061 | A hash function with predicted collisions | <p>As far as I know, the more collision-resistant a hash function is, the better. But is there any way to define a hash function with <em>predicted</em> collisions? In other words, a hash function that collides for some known set of possible inputs and avoids collisions for other input values. To state the problem simp... | cryptography hash | 1 |
3,064 | Worst-case sparse graphs for Hopcroft-Karp Algorithm | <p>Of large sparse biparite graphs (say degree 4) with N verticies, roughly speaking, which of them cause the worst case running time of the <a href="https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm">Hopcroft-Karp algorithm</a>? What is their general structure and architecture, and why does it cause a prob... | algorithms graphs algorithm analysis runtime analysis | 0 |
3,067 | Why classes implicitly derive from only the Object Class? | <p>I do not have any argument opposing why we need only a single universal class. However why not we have two universal classes, say an Object and an AntiObject Class. In nature and in science we find the concept of duality - like Energy & Dark Energy; Male & Female; Plus & Minus; Multiply & Divide; Ele... | programming languages type theory object oriented | 1 |
3,071 | Cost in time of constructing and running an NFA vs DFA for a given regex | <p>Repost from Stack Overflow:</p>

<p>I'm going through past exams and keep coming across questions that I can't find an answer for in textbooks or on google, so any help would be much appreciated.</p>

<p>The question I'm having problems with at the moment is as follows: </p>

<blockquote>&#x... | regular languages automata finite automata compilers | 1 |
3,072 | How much math does one need to know to understand discrete math/structures for computer science? | <p>Normally universities teach discrete math / discrete structure. My question is, how much math does one need to know to understand this area? Is calculus required or will precalculus do just fine? Does one need to have done proofs before to be able to understand this area?</p>

<p>Thank you all for your answe... | discrete mathematics | 0 |
3,073 | How is amorphous computing different from spatial computing? | <p>Surely <a href="http://www.spatial-computing.org/" rel="nofollow">spatial computing</a> and <a href="http://en.wikipedia.org/wiki/Amorphous_computing" rel="nofollow">amorphous computing</a> share similarities and overlap. Is spatial computing a subset of amorphous computing? How are the two different? </p>
 | distributed systems parallel computing agent based computing | 0 |
3,075 | Proof that $a^{n^2}$ is not regular | <blockquote>
<p>Show that <span class="math-container">$L=\{a^{n^2} | n \geq 0\}$</span> is not regular</p>
</blockquote>
<p>Hey guys. I'm taking a CS class and this stuff is really new to me so bear with me.
I tried to look if I get some contradiction by using the pumping lemma for regular languages an... | regular languages pumping lemma | 0 |
3,078 | Algorithm that finds the number of simple paths from $s$ to $t$ in $G$ | <p>Can anyone suggest me a linear time algorithm that takes as input a directed acyclic graph $G=(V,E)$ and two vertices $s$ and $t$ and returns the number of simple paths from $s$ to $t$ in $G$.<br>
I have an algorithm in which I will run a DFS(Depth First Search) but if DFS finds $t$ then it will not change the c... | algorithms graphs | 1 |
3,079 | Is it possible to find the nth term of a Fibonacci sequence using a definitive for loop? | <p>I'm using the book Introduction to Computer Science by John Zelle and at the end of Chapter 3 (Computing with numbers), I'm asked to find the nth term of a Fibonacci sequence presumably using a definitive for loop, as no other decision structure has been introduced yet. </p>

<p>Is this possible? I've tried ... | algorithms imperative programming | 0 |
3,086 | Is there a repository for the hierarchy of proofs? | <p>I am self-learning <a href="http://en.wikipedia.org/wiki/Proof_assistant">proof assistants</a> and decided to start on some basic proofs and work my way up. Since proofs are based on other proofs and so form a hierarchy, is there a repository of the hierarchy of proofs?</p>

<p>I know I can pick a particular... | reference request logic proof assistants | 1 |
3,090 | For a Turing Machine $M_1$, how is the set of machines $M_2$ which are "shorter" than $M_1$ and which accept the same language decidable? | <p>I wonder how come that the following language is in $\mathrm R$.</p>

<p>$L_{M_1}=\Bigl\{\langle M_2\rangle \;\Big|\;\; M_2 \text{ is a TM, and } L(M_1)=L(M_2), \text{ and } |\langle M_1\rangle| > | \langle M_2 \rangle| \Bigr\} $</p>

<p>(I know that it's in $\mathrm R$ since there's an answer for... | computability undecidability | 1 |
3,095 | Dataflow framework for global analysis: Why meet, then apply? | <p>In Chapter 9 of the Dragon Book, the authors describe the dataflow framework for global analysis (described also in <a href="http://dragonbook.stanford.edu/lecture-notes/Stanford-CS243/l3-handout.pdf">these slides</a>). In this framework, an analysis is defined by a set of transfer functions, along with a <a href="... | compilers program optimization | 1 |
3,098 | How to show a set is $\Pi_2$ complete | <p>How can I prove that a set is complete for $\Pi_2$ complete? Can you give me an example proof? Say for $All_{TM}$ = Turing machines whose accepted language is all strings?</p>
 | computability | 0 |
3,101 | Is the set of Turing machines which stops in at most 50 steps on all inputs, decidable? | <p>Let $F = \{⟨M⟩:\text{M is a TM which stops for every input in at most 50 steps}\}$. I need to decide whether <em>F</em> is decidable or recursively enumerable. I think it's decidable, but I don't know how to prove it.</p>

<p><strong>My thoughts</strong></p>

<p>This "50 steps" part immediate turns t... | computability undecidability | 1 |
3,103 | How to show that the set of machines which accept languages in $\mathrm{NP}\smallsetminus\mathrm P$, is decidable only if $\mathrm P=\mathrm{NP}$? | <p>I'd like your help with proving that the language
$$L=\{\langle M \rangle \mathrel| L(M) \in \mathrm{NP}\smallsetminus \mathrm{P} \}$$
is decidable iff $\mathrm{P}=\mathrm{NP}$.</p>

<p>If $\mathrm{P}=\mathrm{NP}$, I get that it's the language of empty Turing machines. So $L$ is a $\text{co-RE}$ prob... | computability undecidability p vs np | 0 |
3,109 | How to compute linear recurrence using matrix with fraction coefficients? | <p>What I'm trying to do is generate <a href="http://en.wikipedia.org/wiki/Motzkin_number" rel="nofollow">Motzkin numbers</a> mod a large number $10^{14} + 7$ (not prime), and it needs to compute the $n$th Motzkin number as fast as possible. From Wikipedia, the formula for the $n$th Motzkin number is defined as followi... | algorithms recurrence relation efficiency integers | 1 |
3,110 | Introduction into first order logic verification | <p>I am trying to teach myself different approaches to software verification. I have read some articles. As far as I learned, propositional logic with temporal generally uses model checking with SAT solvers (in ongoing - reactive systems), but what about first order Logic with temporal? Does it use theorem provers? Or ... | reference request logic formal methods sat solvers software verification | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.