id
int64
1
141k
title
stringlengths
15
150
body
stringlengths
43
35.6k
tags
stringlengths
1
118
label
int64
0
1
3,112
How to disambiguate symbolic regular expressions
<p>What I mean by a "symbolic regular expression" (if there already is a different name for this I'm not aware of it) is a regular expression that may include exponents that are symbolic arithmetic expressions. </p>&#xA;&#xA;<p>Example 1: $a^k|b^*$ means "either $k$ copies of $a$ or zero or more copies of $b$".<br>&#x...
formal languages reference request regular languages regular expressions ambiguity
0
3,115
What different lines of reasoning and traditions lead to the conclusion that Software Engineering is or isn't part of Computer Science?
<p><strong>Background:</strong> Some people consider Software Engineering as a branch of Computer Science, while others consider that they are, or should be, separate. The former stance seems to be well presented in written works. On Wikipedia, Software Engineering <a href="http://en.wikipedia.org/wiki/Computer_science...
software engineering
1
3,119
Is it decidable whether a TM reaches some position on the tape?
<p>I have these questions from an old exam I'm trying to solve. For each problem, the input is an encoding of some Turing machine $M$.</p>&#xA;&#xA;<blockquote>&#xA; <p>For an integer $c&gt;1$, and the following three problems:</p>&#xA; &#xA; <ol>&#xA; <li><p>Is it true that for every input $x$, M does not pass the...
computability turing machines undecidability
1
3,126
Why use comparisons instead of runtime for comparing two algorithms?
<p>I notice that in a few CS research papers, to compare the efficiency of two algorithms, the total number of key comparison in the algorithms is used rather than the real computing times themselves. Why can't we compare which one is better by running both programs and counting the total time needed to run the algorit...
algorithms algorithm analysis runtime analysis
0
3,132
Subset sum problem with many divisibility conditions
<p>Let $S$ be a set of natural numbers. We consider $S$ under the divisibility partial order, i.e. $s_1 \leq s_2 \iff s_1 \mid s_2$. Let </p>&#xA;&#xA;<p>$\qquad \displaystyle \alpha(S) = \max \{|V| \mid V\subseteq S, V$ an <a href="https://en.wikipedia.org/wiki/Antichain">antichain</a>$\}$.</p>&#xA;&#xA;<p>If we consi...
complexity theory number theory knapsack problems
0
3,134
Is #P closed under exponentiation? modulo?
<p>The complexity class $\newcommand{\sharpp}{\mathsf{\#P}}\sharpp$ is defined as </p>&#xA;&#xA;<p>$\qquad \displaystyle \sharpp = \{f \mid \exists \text{ polynomial-time NTM } M\ \forall x.\, f(x) = \#\operatorname{accept}_{M}(x)\}$. </p>&#xA;&#xA;<p>It is known that $\sharpp$ is closed under addition, multiplication ...
complexity theory turing machines closure properties
1
3,138
How Does Populating Pastry's Routing Table Work?
<p>I'm trying to implement the Pastry Distributed Hash Table, but some things are escaping my understanding. I was hoping someone could clarify.</p>&#xA;&#xA;<p><strong>Disclaimer</strong>: I'm not a computer science student. I've taken precisely two computer science courses in my life, and neither dealt with anything ...
algorithms data structures distributed systems hash tables
1
3,139
How to find contour lines for Appel's Hidden Line Removal Algorithm
<p>For fun I am trying to make a wire-frame viewer for the <a href="http://0x10c.com/doc/dcpu-16.txt" rel="nofollow noreferrer">DCPU-16</a>. I understand how do do everything except how to hide the lines that are hidden in the wire frame. All of the questions here on SO all assume you have access to OpenGL, unfortunate...
algorithms computational geometry graphics
1
3,140
Fast algorithm for max-convolution with concave functions?
<p>I'm interested in a discrete max-convolution problem, which is to compute&#xA;$$r(c) = \max_{x | x \ge 0, \sum_k x_k = c} \left[ \sum_{k=1} f_k(x_k) \right] $$&#xA;for all values $c=0, \ldots, C$, where $x=(x_1, \ldots, x_k)$ is a vector of non-negative integers.</p>&#xA;&#xA;<p>If we assume that $f_k$ are all conc...
algorithms optimization discrete mathematics
0
3,141
Pizza commercial claim of 34 million combinations
<p>A pizza commercial claims that you can combine their ingredients to 34 million different combinations. I didn't believe it, so I dusted off my rusty combinatorics skills and tried to figure it out. Here's what I have so far:&#xA;From the online ordering site I got the choices</p>&#xA;&#xA;<ol>&#xA;<li>crust (4 type...
combinatorics discrete mathematics
1
3,149
What is the meaning of $O(m+n)$?
<p>This is a basic question, but I'm thinking that $O(m+n)$ is the same as $O(\max(m,n))$, since the larger term should dominate as we go to infinity? Also, that would be different from $O(\min(m,n))$. Is that right? I keep seeing this notation, especially when discussing graph algorithms. For example, you routinely se...
terminology asymptotics mathematical analysis landau notation
1
3,153
Is there a simple way of calculating perceptron weights based on a classification graph?
<p>I am studying for an AI exam and I'm looking for a better way of solving the following problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>Graph shows a classification problem in the unit square $[0,1]^2$, where Class A&#xA; is denoted by the grey area in the figure (not including the points on the dotted lines),&#xA; and...
artificial intelligence neural networks
0
3,154
How to show two models of computation are equivalent?
<p>I'm seeking explanation on how one could prove that two models of computation are equivalent. I have been reading books on the subject except that equivalence proofs are omitted. I have a basic idea about what it means for two models of computation to be equivalent (the automata view: if they accept the same languag...
proof techniques computation models simulation
1
3,156
Dynamic changes to classes or context activation -- how to treat existing objects in a consistent way?
<p>I am looking for references and papers on the following topic.</p>&#xA;<ol>&#xA;<li><p>In <em>general</em>, some programming languages allow dynamic changes to classes. As an example, a new instance variable ‘weight’ can be added to the class <code>Edge</code> (the class of unweighted edges of graphs). But what shou...
reference request programming languages semantics object oriented
1
3,161
Why larger input sizes imply harder instances?
<p><em>Below, assume we're working with an infinite-tape Turing machine.</em></p>&#xA;&#xA;<p>When explaining the notion of time complexity to someone, and why it is measured relative to the input size of an instance, I stumbled across the following claim:</p>&#xA;&#xA;<blockquote>&#xA; <p>[..] For example, it's natur...
complexity theory time complexity intuition
1
3,163
Batch processing in increase-key function using binary heap
<p>Is there an algorithm to perform batch processing in the increase-key operation? Let us say, a binary heap (min-heap) is used. In the normal increase-key function, if we perform increase key on one node, then we have to traverse paths from the node towards the children to re balance the heap. If we want to increase ...
algorithms data structures parallel computing concurrency priority queues
0
3,168
What are current approaches to auto-parallelisation?
<p>I am looking for answers which provide short overview of models and current state of research for <a href="http://en.wikipedia.org/wiki/Automatic_parallelization" rel="nofollow">auto-parallelisation</a> of sequential code.</p>&#xA;
reference request compilers parallel computing code generation
0
3,170
Complexity of domino tiling with dominoes placed in a line
<p>Let's say I have a bunch of cards or dominoes with one color on the left side of the&#xA;card and another color on the right. (The two colors could be the same.)&#xA;Dominoes can't be rotated so the color on each side is fixed. There is no&#xA;limit on the number of colors and colors can be repeated on cards.</p>&#x...
complexity theory
0
3,172
What's wrong with this LL grammar? (very short)
<pre><code>S --&gt; Ta | b | Sc&#xA;T --&gt; Tc | λ&#xA;</code></pre>&#xA;&#xA;<p>This isn't an LL grammar but I need it to be so I can do a parse table. The problem is that no matter how much I try I never manage to do make it an LL grammar. Can someone please help by making it a LL grammar? It isn't that big and I'm ...
formal languages formal grammars parsing
0
3,173
LL(1) parsing table of left-recursive grammar
<p>I have been taking a compiler course of Stanford on coursera. I have a slight misunderstanding on the parsing table of the following grammar:</p>&#xA;&#xA;<p>S -> Sa | b</p>&#xA;&#xA;<p>According to the professor parsing table looks like this:</p>&#xA;&#xA;<ul>&#xA;<li><p>If the leftmost nonterminal is S and the inp...
formal languages formal grammars parsing left recursion
0
3,174
Why does Prim's algorithm keep track of a node's parent?
<p>There is an obvious similarity in workings between Prim's algorithm and Dijkstra's algorithm, however I see no reason for Prim's algorithm to keep track of a node's parent. In Dijkstra's algorithm, the parent of the node needs to be tracked in order to follow the chain back to the original node to determine the di...
algorithms graphs
0
3,176
Is Huffman Encoding always optimal?
<p>The requirement of the encoding to be <em>prefix free</em> results in large trees due to the tree having to be complete. Is there a threshold where fixed-length non-encoded storage of data would be more efficient than encoding the data?</p>&#xA;
information theory data compression
1
3,180
Decider for the family of Turing machines that move infinitly to the right on some input
<p>I need help finding an algorithm which, given a Turing machine description $\langle M \rangle$, decides whether there exists an input $w$ such that in the computation of $M(w)$, the head only moves right and $M$ never stops.</p>&#xA;
computability turing machines
0
3,182
What are the rudimentary types of information connectivity i.e. model types?
<p>I am looking at a modelling tool and are trying to determine all the types of ways that you can model (at a rudimentary level)</p>&#xA;<p>I remember seeing a list of ways in which you can connect or categorise information elements. basically the types were as follows:</p>&#xA;<ul>&#xA;<li><p>Lists - constitute a lis...
data structures information theory modelling structured data
0
3,185
Floating point rounding
<p>Can an IEEE-754 floating point number &lt; 1 (i.e. generated with a random number generator which generates a number >= 0.0 and &lt; 1.0) ever be multiplied by some integer (in floating point form) to get a number equal to or larger than that integer due to rounding?</p>&#xA;&#xA;<p>i.e.</p>&#xA;&#xA;<pre><code>doub...
numerical analysis floating point rounding
1
3,190
Pumping Lemma: is it valid to "multiply the product of powers" in this case?
<p>I need to show that </p>&#xA;&#xA;<p>$\qquad \displaystyle S = \{(10^p)^m \mid p \geq 0, m \geq 0\}$</p>&#xA;&#xA;<p>is not a regular language using pumping lemma.</p>&#xA;&#xA;<p>Can I multiply the product of the powers and express it to: $S = \{ 1^m 0^{pm} \mid \dots \}$ and apply the pumping lemma where I pump 1'...
formal languages regular languages pumping lemma
0
3,193
Is this language Context-Free?
<blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/2623/is-this-language-context-free">Is this language Context-Free?</a> </p>&#xA;</blockquote>&#xA;&#xA;&#xA;&#xA;<p>The language is defined by&#xA;$$(a+b)^*-\{(a^nb^n)^n\mid n \geq1 \}$$</p>&#xA;&#xA;<p...
formal languages automata
0
3,195
The essential difference between spiking neural networks and earlier generation ANN's
<p>I have been studying <a href="http://en.wikipedia.org/wiki/Spiking_neural_network" rel="nofollow">Spiking Neural Networks</a> online from various papers, mainly <a href="http://mathsci.kaist.ac.kr/~nipl/am621/lecturenotes/spiking_neurons_2.pdf" rel="nofollow">Maass (1997)</a>. I am not entirely sure I understand wha...
terminology artificial intelligence neural networks
0
3,200
Counting inversion pairs
<p>A classic application of divide and conquer is to solve the following problem:</p>&#xA;&#xA;<p><em>Given an array $a[1\dots n]$ of distinct, comparable elements, count the number of inversion pairs in the array: pairs $(i,j)$ such that $a[i] \gt a[j]$ and $i \lt j$.</em></p>&#xA;&#xA;<p>One approach to this is to do...
algorithms reference request arrays
0
3,201
Good text on algorithm complexity
<p>Where should I look for a good introductory text in algorithm complexity? So far, I have had an Algorithms class, and several language classes, but nothing with a theoretical backbone. I get the whole complexity, but sometimes it's hard for me to differentiate between O(1) and O(n) plus there's the whole theta notat...
complexity theory reference request algorithm analysis education books
1
3,202
Undergraduate studies: Math or CS?
<p>hope it's possible for this question to be answered in an objective manner.</p>&#xA;&#xA;<p>I'm not studying in a liberal arts college so basically I only get to study one subject. Which would be the better preparation for future research (probably grad school) into theoretical CS? The standard undergraduate math co...
education
1
3,205
When generating a PDA from a CFG do I have a receiving state?
<p>Thw <a href="http://en.wikipedia.org/wiki/Pushdown_automaton" rel="nofollow">Wikipedia article on Pushdown automata</a> doesn't explain what the receiving state is for the generated PDA it just states that there is but one state. </p>&#xA;
terminology automata pushdown automata
0
3,209
What is the difference between a scripting language and a normal programming language?
<p>What is the difference between programming language and a scripting language?&#xA;For example, consider C versus Perl.</p>&#xA;&#xA;<p>Is the only difference that scripting languages require only the interpreter and don't require compile and linking?</p>&#xA;
programming languages
1
3,214
Is every linear-time algorithm a streaming algorithm?
<p>Over at <a href="https://cs.stackexchange.com/questions/3200/counting-inversion-pairs">this question about inversion counting</a>, I <a href="https://cs.stackexchange.com/questions/3200/counting-inversion-pairs#comment8724_3200">found a paper</a> that proves a lower bound on space complexity for all (exact) <a href=...
algorithms streaming algorithm simulation lower bounds
1
3,215
Intuition for convolution in image processing
<p>I have read many documents about <a href="https://en.wikipedia.org/wiki/Convolution" rel="nofollow noreferrer"><em>convolution</em></a> in image processing, and most of them say about its formula, some additional parameters. No one explains the intuition and real meaning behind doing convolution on an image. For exa...
terminology intuition graphics computer vision
0
3,216
Can an exponential algorithm for an NPC problem be transformed into an algorithm for other NP problems in polynomial time?
<p>After looking at other questions and my textbook, I seem to get some confusion. </p>&#xA;&#xA;<p>I do get that when there is a polynomial algorithm of NPC, there is a polynomial algorithm for a NP problem. </p>&#xA;&#xA;<p>But the statement describing reduction seems obscure to me at least in the beginning of my stu...
complexity theory terminology np complete reductions
0
3,226
How are all NP Complete problems similar?
<p>I'm reading few proofs which prove a given problem is NP complete. The proof technique has following steps.</p>&#xA;&#xA;<ol>&#xA;<li>Prove that current problem is NP, i.e., given a certificate, prove&#xA;that it can be verified in polynomial time.</li>&#xA;<li>Take any known NP-complete problem (call "Easy") and re...
complexity theory np complete reductions
1
3,227
Uniform sampling from a simplex
<p>I am looking for an algorithm to generate an array of N random numbers, such that the sum of the N numbers is 1, and all numbers lie within 0 and 1. For example, N=3, the random point (x, y, z) should lie within the triangle:</p>&#xA;&#xA;<pre><code>x + y + z = 1&#xA;0 &lt; x &lt; 1&#xA;0 &lt; y &lt; 1&#xA;0 &lt; z ...
algorithms randomness random number generator sampling
1
3,231
Asymptotic growth rate of $f(n)$ and $f(n+1)$
<p>Let $f : \mathbb{R} \rightarrow \mathbb{R}$ be a continuous positive function, where $f(n)$ is integer for each integer $n$. Prove or disprove whether the following always holds:</p>&#xA;&#xA;<p>$\qquad f(n+1) = \Theta(f(n))$</p>&#xA;
asymptotics mathematical analysis landau notation
0
3,233
Can abstract syntax trees be unparsed in subexponential time?
<h3>Abstract problem description</h3>&#xA;&#xA;<p>The way I see it, unparsing means to create a token stream from an AST, which when parsed again produces an equal AST, i.e. <code>parse(unparse(AST)) = AST</code> should hold. </p>&#xA;&#xA;<p>This is the equal to finding a valid parse tree which would produce the same...
algorithms compilers parsers attribute grammars
0
3,239
Reducing TSP to HAM-CYCLE to VERTEX-COVER to CLIQUE to 3 CNF-SAT to SAT
<p>In <a href="http://rads.stackoverflow.com/amzn/click/0072970545" rel="nofollow noreferrer">Cormen's Algorithms book</a> on NP-completeness they prove various problems are NP-complete by reducing a previously proved NP-complete problem (call $K$) to current problem (call $L$). Each proof involves some clever construc...
complexity theory np complete reductions
0
3,240
Is $O$ contained in $\Theta$?
<p>So I have this question to prove a statement:</p>&#xA;&#xA;<p>$O(n)\subset\Theta(n)$...</p>&#xA;&#xA;<p>I don't need to know how to prove it, just that in my mind this makes no sense and I think it should rather be that $\Theta(n)\subset O(n)$. </p>&#xA;&#xA;<p>My understanding is that $O(n)$ is the set of all funct...
asymptotics mathematical analysis landau notation
1
3,245
$L$ APX-hard thus PTAS for $L$ implies $\mathsf{P} = \mathsf{NP}$
<p>If $L$ is an APX-hard language, doesn't the existence of a PTAS for $L$ trivially imply $\mathsf{P} = \mathsf{NP}$?</p>&#xA;&#xA;<p>Since for example metric-TSP is in APX, but it is not approximable within 220/219 of OPT [1] unless $\mathsf{P} = \mathsf{NP}$. Thus if there was a PTAS for $L$ we could reduce metric-T...
complexity theory np complete approximation
1
3,250
Proof of equivalence of parse-trees and derivations
<p>Intuitively, every derivation in a context-free grammar corresponds to a parse-tree and vise versa. </p>&#xA;&#xA;<p>Is this intuition correct? If so how can I formalize and prove such a thing?</p>&#xA;
formal grammars context free
1
3,251
How to show that a "reversed" regular language is regular
<p>I'm stuck on the following question:</p>&#xA;&#xA;<p>"Regular languages are precisely those accepted by finite automata. Given this fact, show that if the language $L$ is accepted by some finite automaton, then $L^{R}$ is also accepted by some finite; $L^{R}$ consists of all words of $L$ reversed."</p>&#xA;
formal languages regular languages automata finite automata
1
3,263
Graphs that cause DFS and BFS to process nodes in the exact same order
<p>For some graphs, DFS and BFS search algorithms process nodes in the exact same order provided that they both start at the same node. Two examples are graphs that are paths and graphs that are star-shaped (trees of depth $1$ with an arbitrary number of children). Is there some way for categorizing graphs that satisfy...
algorithms graphs graph traversal
0
3,264
Find any of the 3 largest among $n$ elements
<p>I have two questions. Both are about finding any of the 3 largest among $n$ elements.</p>&#xA;&#xA;<ol>&#xA;<li><p>How to show that $n-3$ comparisons <strong>suffice</strong> to find any of the $3$ largest among $n$ given numbers $(n \geq 4)$?</p></li>&#xA;<li><p>How to show that $n-3$ comparisons are <strong>necess...
algorithms
0
3,266
Heuristics for an Artificial Intelligence problem
<blockquote>&#xA; <p><strong>Problem</strong> : Given a (one dimensional) row containing $2N$ tiles arranged in $2N + 1$ spaces. There are $N$ black tiles (B), $N$ white tiles (W), and a single empty space. The tiles are initially in an arbitrary ordering. Our goal is to arrange the tiles such that all white tiles are...
artificial intelligence heuristics
1
3,270
How much can we reduce the number of clauses by converting from $k$-SAT to $(k+m)$-SAT?
<p>If we suppose that we start with an instance of $k$-SAT, and try converting the problem to an instance of $(k+m)$-SAT, where there are $(k+m)$ literals per clause, can we guarantee a reduction in the total amount of clauses?</p>&#xA;&#xA;<p><em>I realized after posting that we can't guarantee that the number of clau...
complexity theory logic satisfiability
0
3,271
Human computing power: Can humans decide the halting problem on Turing Machines?
<p>We know the halting problem (on Turing Machines) is undecidable for Turing Machines. Is there some research into how well the human mind can deal with this problem, possibly <em>aided</em> by Turing Machines or general purpose computers?</p>&#xA;&#xA;<p><em>Note</em>: Obviously, in the strictest sense, you can alway...
computability turing machines halting problem human computing
0
3,273
What is the complexity of this subset merge algorithm?
<p><strong>Updated Algorithm:</strong> There was a major flaw in my original presentation of the algorithm which could have impacted the results. I apologize for the same. The correction has been posted underneath.&#xA;<hr></p>&#xA;&#xA;<p>The original algorithm posted had a major flaw in its working. I tried my best b...
algorithms time complexity algorithm analysis check my algorithm
0
3,274
Free variables of (λx.xy)x and bound variables of λxy.x
<p>I was solving exercises on Lambda calculus. However, my solutions are different from the answers and I cannot see what is wrong.</p>&#xA;&#xA;<ol>&#xA;<li><p>Find free variables of $(\lambda x.xy)x$.<br>&#xA;My workings: $FV((\lambda x.xy)x)=FV(\lambda x.xy) \cup FV(x)=\{y\} \cup \{x\}=\{x,y\}$.<br>&#xA;The model an...
logic lambda calculus
1
3,276
Given a set of sets, find the smallest set(s) containing at least one element from each set
<p>Given a set $\mathbf{S}$ of sets, I’d like to find a set $M$ such that every set $S$ in $\mathbf{S}$ contains at least one element of $M$. I’d also like $M$ to contain as few elements as possible while still meeting this criterion, although there may exist more than one smallest $M$ with this property (the solution ...
algorithms optimization sets
1
3,278
What is a malformed token?
<p>I am reading Programming Language Pragmatics by Michael Scott. He says that on a first pass, a compiler will break a program into a series of tokens. He says that it will check for malformed tokens, like 123abc or $@foo (in C). </p>&#xA;&#xA;<p>What is a malformed token? A variable that does not meet the rules of va...
programming languages compilers
1
3,283
Solving $\text{key}=(\sum_{K=0}^n\frac{1}{a^K})\bmod m$ with High limits
<p>I was solving this equation:&#xA;<span class="math-container">$$\text{key}=\left(\sum_{K=0}^n\frac{1}{a^K}\right)\bmod{m}.$$</span></p>&#xA;<h3>Given</h3>&#xA;<p><span class="math-container">$$ 1,000,000,000 &lt; a, n, m \; &lt; 5,000,000,000, $$</span>&#xA;<span class="math-container">$$ a, m \text{ are coprime}. $...
algorithms discrete mathematics number theory
0
3,286
Types of reductions and associated definitions of hardness
<p>Let A be reducible to B, i.e., $A \leq B$. Hence, the Turing machine accepting $A$ has access to an oracle for $B$. Let the Turing machine accepting $A$ be $M_{A}$ and the oracle for $B$ be $O_{B}$. The types of reductions:</p>&#xA;&#xA;<ul>&#xA;<li><p>Turing reduction: $M_{A}$ can make multiple queries to $O_{B}$.<...
complexity theory np complete reductions complexity classes
1
3,287
Applying algorithms on large data
<p>Is there any book or tutorial that teaches us how to efficiently apply the common algorithms (sorting, searching, etc.) on large data (i.e. data that cannot be fully loaded into main memory) and how to efficiently apply those algorithms considering the cost of block transfer from external memory ? For example, almos...
algorithms efficiency memory management big data
0
3,291
Circuit size for "at least n inputs are true"
<p>Say you have $m$ boolean inputs, and you are given a threshold $n$. You need to construct a boolean circuit that evaluates to true if at least $n$ of the inputs true. You may use AND, OR, NOT, or XOR gates (restricted to fan-in two, with arbitrary fan-out). Asymptotically how small can you make this circuit? </p>&#...
complexity theory circuits
0
3,293
Produce decision version of the problem
<p>An optimisation problem requires minimising some function $f(x)$, where $x$ is a&#xA;vector of integers. What is the corresponding decision version of the problem?</p>&#xA;
complexity theory optimization reductions
1
3,295
Hardness of counting solutions to NP-Complete problems, assuming a type of reduction
<p>The $\text{NP-Complete}$ class of problems is defined w.r.t Karp Reductions, which are <strong>polytime many-one reductions</strong>. However, <em>they need not necessarily preserve the number of solutions</em>. A more restrictive type: <strong>polytime one-one reductions</strong> do indeed preserve the number of so...
complexity theory reductions complexity classes
0
3,296
Why does the experience propagation rule for checkers work in Tom Mitchell's book?
<p>In Tom Mitchell's book <a href="http://rads.stackoverflow.com/amzn/click/0070428077">"Machine Learning"</a>, Chap.1, a checkers game is used to illustrate how machine learning can be applied solve problems.</p>&#xA;&#xA;<p>An experience propagation rule is described for iterative learning of a hypothesis. Suppose a ...
machine learning
1
3,297
How to write a recursive function that with certain time complexity
<p>I'm now doing exam revision, and from some past year exam papers, I noticed some questions that ask to write a recursive method with signature like</p>&#xA;&#xA;<pre><code>public void run(int n)&#xA;</code></pre>&#xA;&#xA;<p>that must have a time complexity of like : $O(n^2), O(n^3), O(n^7), O(n^2!), O(2^n), O(9^n)$...
algorithms time complexity recursion
0
3,303
How to compare the output of a neural network with his target?
<p>I am coding a neural network implementation, but a I have problems in the design. I was wondering about how to compare the <em>output</em> with the <em>target</em>, my neural networks has three outputs</p>&#xA;&#xA;<p><code> groups = {'Iris-virginica':[0,0,1], 'Iris-setosa':[0,1,0], 'Iris-versicolor':[1,0,0]}</code>...
algorithms neural networks
0
3,306
Time complexity of a triple-nested loop
<p>Please consider the following triple-nested loop:</p>&#xA;&#xA;<pre><code>for (int i = 1; i &lt;= n; ++i)&#xA; for (int j = i; j &lt;= n; ++j)&#xA; for (int k = j; k &lt;= n; ++k)&#xA; // statement&#xA;</code></pre>&#xA;&#xA;<p>The statement here is executed exactly $n(n+1)(n+2)\over6$ times. Co...
algorithms time complexity algorithm analysis
0
3,310
Which Is a Better Way of Obtaining Scales, Gaussian Blur or Down Sampling?
<p>In computer vision, scales are important when we carry out a scene analysis. Choosing different scales affect the result of the analysis. For example, if a face is relatively small in the scene, then the details including nose, eyes will be omitted. On the other hand, details on larger faces become relatively more s...
machine learning computer vision image processing
1
3,312
Is the validity of some instance of an equational problem decidable?
<p>Is the following FOL-problem (equality is a logical symbol) &#xA;effectively decidable?</p>&#xA;&#xA;<p><strong>Given.</strong> A finite equation system $E$ and an equation $s = t$.</p>&#xA;&#xA;<p><strong>Question.</strong> Is there a substitution $\sigma$, such that $\sigma(E)&#xA;\models \sigma(s = t)$?</p>&#xA...
computability logic decision problem equality
1
3,313
Formally describing a new domain specific programming language
<p>I am about to implement a domain specific language for representation of social learning conventions. Part of the implementation is a formal description of a language - its 'calculus', symbols and logical expressions.</p>&#xA;&#xA;<p>My approach would be to describe the language by describing its grammar but there a...
formal languages programming languages semantics
1
3,314
Given a mechanical assembly as a graph, how to find an upper bound on number of assembly paths
<p>The rules are that you can only build from an existing part, so in the example below, B is the only option for the first move = A.</p>&#xA;&#xA;<p>A mechanical assembly might be represented as follows:</p>&#xA;&#xA;<pre><code> E&#xA; |&#xA; C&#xA; |&#xA;A-B&#xA; |&#xA; D&#xA; |&#xA; F&#xA;</code></pre>&#xA;&...
algorithms graphs
1
3,316
Is there any theoretically proven optimal compression algorithm?
<p>Is Huffman coding <strong>always</strong> optimal since it uses Shanon's ideas?&#xA;What about text, image, video, ... compression?</p>&#xA;&#xA;<p>Is this subject still active in the field? What classical or modern references should I read?</p>&#xA;
algorithms information theory data compression
1
3,318
What could you learn from studying player movement and behaviour on online FPS games?
<p>Just thinking of Counter Strike as a canonical example, if you have a coordinate representation of the map and for every player you have a complete history of everything you might need for every moment of time, say every 10 miliseconds or something and you just recorded where the players went around the map, and wha...
machine learning computer games
0
3,321
Find small superset of at least k of n given sets
<p>Say we're given $n$ sets and the size of their union is $m$. We would like to construct a small set which contains at least $k$ of the $n$ given sets. </p>&#xA;&#xA;<p>Lets assume that $m$ is less than some polynomial in $n$, i.e.: $m &lt; P(n)$. In this case is there an efficient (polynomial) algorithm for the opti...
complexity theory np complete np hard polynomial time
0
3,325
Ambiguous grammar? Could the grammar be parsed by SLR parser?
<p>I got one grammar:</p>&#xA;&#xA;<pre><code>re2: re1 $&#xA;&#xA;re1: expr == expr | expr != expr | expr &lt; expr | expr &lt;= expr | expr &gt;= expr | expr &gt; expr | expr&#xA;&#xA;expr: expr + term | expr - term | term&#xA;&#xA;term: term * factor | term / factor | factor&#xA;&#xA;factor: (expr) | num | id&#xA;&#x...
formal languages formal grammars compilers parsing
0
3,327
Complexity calculations, assumptions on basic costs
<blockquote>&#xA; <p><strong>Possible Duplicate:</strong><br>&#xA; <a href="https://cs.stackexchange.com/questions/1643/how-can-we-assume-comparison-addition-between-numbers-is-o1">How can we assume comparison, addition, &hellip; between numbers is $O(1)$</a> </p>&#xA;</blockquote>&#xA;&#xA;&#xA;&#xA;<p>When we calc...
complexity theory time complexity
1
3,330
Pumping Lemma for regular language for $a^n$ where $n$ is even fails
<p>$$L=\{a^n \mid \text{\(n\) is even}\}$$</p>&#xA;&#xA;<p>This is regular but fails in the pumping Lemma.</p>&#xA;&#xA;<p>Assuming $m=4$, $w=aaaaaa$, $|w|=6$ (even).&#xA;Let $w=xyz$,&#xA;$x=a$,&#xA;$y=aaa$.&#xA;We have $|y|&gt;0$ and $|xy| \le m$.</p>&#xA;&#xA;<p>Let $w_i=xy^iz$.&#xA;For $i=2$,&#xA;$w_2=xy^2z=aaaaaaaa...
regular languages automata finite automata pumping lemma
0
3,337
LFSR sequence computation
<p>I need to calculate the output of the sequence generated by this shift register but I cannot find anywhere how to do it. Everywhere the results are just given but there is no explanation how to do compute them. I know the the sequence will repeat every 2^3-1=7 times. Could anyone explain me how to do it. Thank you.<...
cryptography pseudo random generators shift register
1
3,339
Reference Request for Synthesis
<p>New to the world of software verification and synthesis. It was suggested to me that the book "Principles of Model Checking" is a good reference for verification, but I am clueless about synthesis. Could someone refer a good book?</p>&#xA;
reference request formal methods
1
3,340
Problem contest with matrix and DP
<p>I found this problem while I was reading an ACM problem and it is about dynamic programming. The problem says that you have a square matrix $n\times n$ filled with 1's or 0's, like this:</p>&#xA;&#xA;<h2>$$\begin{bmatrix} 1 &amp;1 &amp;1 &amp;0\\ 1 &amp;1 &amp;1 &amp;1\\ 0 &amp;0 &amp;1 &amp;0\\ 1 &amp;1 &amp;1 &a...
algorithms dynamic programming
1
3,345
Binary Search Tree Property
<p>In the book 'Introduction to Algorithms 3/e', I have found the following definition of Binary Search Tree property:</p>&#xA;&#xA;<blockquote>&#xA; <p>Let $x$ be a node in a binary search tree. If $y$ is a node in the left subtree&#xA; of $x$, then $y.key \leq x.key$. If $y$ is a node in the right subtree of $x$, t...
terminology data structures binary trees search trees
0
3,347
For a graph $G$ find the minimal $t$ such $G(t)=(V,E(t))$ is connected
<p>Given a connected and directed graph $G=(V,E)$ with positive weights on the edges. for every $t&gt;0$ we define $E(t)$ to be the group of edges with weight lower or equal than $t$. I need to find an efficient algorithm which computes the minimal $t$ such that $G(t)=(V,E(t))$ is connected. </p>&#xA;&#xA;<p>I can sort...
algorithms graphs
1
3,350
Is this language LL(1) parseable?
<p>I tried to find a simple example for a language that is not parseable with an LL(1) parser. I finally found this language.</p>&#xA;&#xA;<p><span class="math-container">$$L=\{\,a^nb^m\mid n,m\in\mathbb N,\&gt;n\ge m\,\}$$</span></p>&#xA;&#xA;<p>Is my hypothesis true or is this language parseable with an LL(1) parser?...
formal languages formal grammars context free parsers
1
3,352
Find the lightest weight of a path between $u$ to $v$ that contains no more then $k$ edges (If there's one)
<p>Given a directed and strongly connected graph $G=(V,E)$, weight function $w: E \to \mathbb{R}$ and two distinct vertices $u,v \in V$. We know that there aren't negative cycles.&#xA;I need to find algorithm, efficient as possible,such that for every value of $k$, $2 \leq k \leq |V|-1$, it will find the lightest weigh...
algorithms graphs
1
3,354
Reduction from set cover problem to vertex cover problem
<p>Although the reduction from vertex cover problem to set cover problem is quite simple, I did not find anywhere the reduction in the opposite direction. From the similarity in the type of problems, I guess this reduction should be simple too. However, despite trying for some time, I could not develop this. So, any id...
complexity theory np complete reductions
0
3,355
Error in Generating Function Solution
<p>I am currently working my way through <a href="http://aofa.cs.princeton.edu/home/" rel="nofollow">An Introduction to Analysis of Algorithms</a> to stay sharp with recurrences as well as learn generating function techniques. However my analyses and the books analyses for the first few sample problems on ordinary gene...
recurrence relation mathematical analysis check my proof
1
3,362
what is the complexity of recurrence relation?
<p>what is the complexity of below relation</p>&#xA;&#xA;<p>$ T(n) = 2*T(\sqrt n) + \log n$</p>&#xA;&#xA;<p>and $T(2) = 1$</p>&#xA;&#xA;<p>Is it $\Theta (\log n * \log \log n)$ ?</p>&#xA;
asymptotics recurrence relation mathematical analysis
1
3,367
Known facets of the Travelling Salesman Problem polytope
<p>For the branch-and-cut method, it is essential to know many facets of the polytopes generated by the problem. However, it is currently one of the hardest problems to actually calculate all facets of such polytopes as they rapidly grow in size.</p>&#xA;&#xA;<p>For an arbitrary optimization problem, the polytope used ...
algorithms optimization linear programming mathematical programming traveling salesman
0
3,368
NFA for binary words that do not end in 10
<blockquote>&#xA; <p>Construct an NFA over $\{0, 1\}$ whose language contains only words that do not end with $10$.</p>&#xA;</blockquote>&#xA;&#xA;<p>This is one of the first problems in the book, so it's supposedly easy. I just can't figure it out. It's easy using a DFA, but I'm not so sure using an NFA. Maybe I'm no...
formal languages regular languages automata finite automata
0
3,375
Show that the Minimum spanning tree Reduce Algorithm runs in O(E) on sparse graphs
<p>This is a problem from CLRS 23-2 that I'm trying to solve. The problem assumes that given graph G is very sparse connected. It wants to improve further over Prim's algorithm $O(E + V \lg V)$. The idea is to contract the graph, i.e. collapse two or more nodes into one node. So each reduction will reduce the graph by ...
algorithms graphs algorithm analysis runtime analysis
0
3,377
Does Quicksort always have quadratic runtime if you choose a maximum element as pivot?
<p>If you have a quick-sort algorithm, and you always select the smallest (or largest) element as your pivot; am I right in assuming that if you provide an already sorted data set, you will always get worst-case performance regardless of whether your 'already sorted' list is in ascending or descending order? </p>&#xA;&...
algorithms time complexity algorithm analysis runtime analysis sorting
1
3,381
NFA with exponential number of states when determinized
<p>How can I build an example of a regular language where the minimal DFA has <span class="math-container">$2^n$</span> states and the minimal NFA has <span class="math-container">$n$</span> 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 s...
automata finite automata
0
3,384
What is the purpose of k in the transitive closure method?
<p>When converting a DFA to a regular expression using the <a href="https://cs.stackexchange.com/a/2395">transitive closure method</a>, what is the significance of state $k$ and what values $k$ takes? If $k$ represents the intermediate states then what are the values for $k$? That is while applying the method, for whic...
regular languages automata finite automata
0
3,390
How does a computer work?
<p>I have been a computer nerd for many many years. I can program in quite a few languages, and I can even build them. I sat down with a buddy the other day and asked how a computer actually takes electricity and does something with it, and we just couldnt figure it out, and Google wasn't much help either.</p>&#xA;&#x...
computer architecture education reference question
0
3,399
Finding the minimum cut of an undirected graph
<p>Here's a question from a past exam I'm trying to solve:</p>&#xA;&#xA;<p>For an undirected graph $G$ with positive weights $w(e) \geq 0$, I'm trying to find the minimum cut. I don't know other ways of doing that besides using the max-flow min-cut theorem. But the graph is undirected, so how should I direct it? I tho...
algorithms graphs
1
3,400
A variation in Ford-Fulkerson algorithm
<blockquote>&#xA; <p>Suppose that we redefine the residual network to disallow edges into $s$. Argue that the procedure FORD-FULKERSON still correctly computes a maximum flow. </p>&#xA;</blockquote>&#xA;&#xA;<p>I was thinking that when we augment a path the residual capacity of reverse edge increases and can be used ...
algorithms graphs network flow correctness proof
0
3,404
Compute 'insertable' letters in a regular language
<p>Let $L$ a regular language and define the <em><a href="https://en.wikipedia.org/wiki/Subsequence" rel="nofollow">subsequence</a> closure</em> of $L$ as</p>&#xA;&#xA;<p>$\qquad \displaystyle S(L) = \{ w \mid \exists w' \in L.\ w \text{ subsequence of } w'\}$.</p>&#xA;&#xA;<p>The problem I want to solve is to find for...
algorithms regular languages finite automata
1
3,406
Proving a grammar only generates words whose alternating digit sums are multiples of three
<p>This is homework and I'm looking for a push in the right direction. Proofs were never something I was properly taught, so now they're kind of a weak point.</p>&#xA;&#xA;<p>Here's the problem:</p>&#xA;&#xA;<blockquote>&#xA; <p>The following grammar generates numbers in binary notation ($C$ is the&#xA; start symbol)...
formal languages regular languages formal grammars proof techniques
1
3,414
Data structure for partition of a set
<p>A <a href="http://en.wikipedia.org/wiki/Partition_of_a_set" rel="nofollow">partition of a set</a> S is a separation of the set into an arbitrary number of non-empty, pairwise disjoint subsets whose union is exactly S. What manner of a data structure should be used to represent a partition of a set if the following m...
data structures partitions sets
0
3,420
Removing duplicates efficiently and with a low memory overhead
<p>I want to filter efficiently a list of integers for duplicates in a way that only the resulting set needs to be stored.</p>&#xA;&#xA;<p>One way this can be seen:</p>&#xA;&#xA;<ul>&#xA;<li>we have a range of integers $S = \{1, \dots{}, N\}$ with $N$ big (say $2^{40}$)</li>&#xA;<li>we have a function $f : S \to S$ wit...
algorithms data structures sorting
0
3,421
Random algorithm with biggest sequence that never repeats
<p>I am going to attempt to write a random number generator using exisiting randomize algorithms. Can you suggest which algorithm has the biggest sequence that never repeats? I don't care if they are fast or slow.</p>&#xA;
algorithms randomness
1
3,427
Is this phrase structure grammar from my textbook correct?
<p>I just started reading "Parsing Techniques, A Practical Guide", Second Edition, by Dick Grune and Ceriel J.H. Jacobs. </p>&#xA;&#xA;<p>On page 12, the authors start describing a set of rules that can be used to generate the set of all enumerations of names of the type "tom, dick and harry": the rules allow single na...
formal languages formal grammars parsing
1
3,431
Distinct variables for different clauses
<p>In resolution theorem proving, it is normally assumed variables in different clauses are distinct. This is not something that happens automatically; it requires significant extra code and computation to implement. Given that, I'm looking for a test case for it.</p>&#xA;&#xA;<p>The problem is, in all the test cases I...
logic automated theorem proving
1