id int64 1 141k | title stringlengths 15 150 | body stringlengths 43 35.6k | tags stringlengths 1 118 | label int64 0 1 |
|---|---|---|---|---|
6,842 | What are the effects of the alphabet size on construct algorithms for suffix trees? | <p>For what size alphabet does it take longer to construct <a href="http://en.wikipedia.org/wiki/Suffix_tree" rel="nofollow">a suffix tree</a> - for a really small alphabet size (because it has to go deep into the tree) or for a large alphabet size? Or is it dependent on the algorithm you use? If it is dependent, how d... | algorithm analysis data structures strings efficiency suffix trees | 0 |
6,843 | How can repeated addition/multiplication be done in polynomial time? | <p>I can see how adding 2 unsigned $n$-bit values is $O(n)$. We just go from the rightmost digits to the leftmost digits and add the digits up sequentially. We can also perform multiplication in polynomial time ($O(n^2)$) via the algorithm we all learned in grade school.</p>

<p>However, how can we add up or mu... | time complexity arithmetic integers | 1 |
6,846 | is there an example of an algorithm that has O(1/n)? | <blockquote>
 <p><strong>Possible Duplicate:</strong><br>
 <a href="https://cs.stackexchange.com/questions/3495/complexity-inversely-propotional-to-n">Complexity inversely propotional to $n$</a> </p>
</blockquote>



<p>I'm curious if anyone's come up with a problem or method as n => infi... | time complexity | 1 |
6,847 | Is the k-clique problem NP-complete? | <p>In this Wikipedia article about the <a href="http://en.wikipedia.org/wiki/Clique_%28graph_theory%29">Clique problem in graph theory</a> it states in the beginning that the problem of finding a clique of size K, in a graph G is NP-complete:</p>

<blockquote>
 <p>Cliques have also been studied in computer... | complexity theory graphs np complete complexity classes | 1 |
6,855 | Solving the big-Oh notation for $T(n) = 2 T(n/2) + O(n)$ | <blockquote>
 <p><strong>Possible Duplicate:</strong><br>
 <a href="https://cs.stackexchange.com/questions/2789/solving-or-approximating-recurrence-relations-for-sequences-of-numbers">Solving or approximating recurrence relations for sequences of numbers</a> </p>
</blockquote>



<p>I kno... | asymptotics landau notation | 0 |
6,858 | Are monoids useful in optimization? | <p>Many common operations are <a href="http://en.wikipedia.org/wiki/Monoid">monoids</a>. Haskell has leveraged this observation to make many higher-order functions more generic (<code>Foldable</code> being one example).</p>

<p>There is one obvious way in which using monoids can be used to improve performance: ... | optimization compilers category theory | 1 |
6,859 | Increasing entropy of random walk | <p>Let $P$ be a transition matrix of a random walk in an undirected <strong>(may not regular)</strong> graph $G$. Let $\pi$ be a distribution on $V(G)$. The Shannon entropy of $\pi$ is defined by </p>

<p>$$H(\pi)=-\sum_{v \in V(G)}\pi_v\cdot\log(\pi_v).$$</p>

<p>How do we prove that $H(P\pi)\ge H(\pi)... | entropy random walks | 1 |
6,865 | Advantages of amortized analysis | <p>I understood what amortized analysis does, but can anyone tell me what is the main purpose of this kind of analysis?</p>

<p>What I understood:</p>

<p>Let say we have 3 three operations a,b,c used 1,2 and 3 times to achieve d. Based on aggregate analysis a,b and c are used 2 times each. Is this corr... | algorithm analysis proof techniques amortized analysis | 1 |
6,867 | Processes and Segmentation | <p>The following problem was on my final and in <code>Gate 2006</code>, but I don't understand how to solve it:</p>

<p>Different methods of memory management have different overheads:</p>

<ul>
<li>The paging method for memory management uses two-level paging, and its storage overhead is $P$. </li>... | operating systems memory management storage paging | 0 |
6,870 | Notations around the polynomial hierarchy | <p>I am new to "Computational Complexity" and therefore I have enough problems with some exercises like the following one:</p>

<blockquote>
 <p>Remember: $\text{PH} := \bigcup_{i} \Sigma_i$</p>
 
 <p>Show:</p>
 
 <p>$\bullet \bigcup_{i}(\Sigma_i \cup \Pi_i \cup \Delta_i) = \bigcup_{i}\... | complexity theory terminology time complexity | 0 |
6,871 | how does the parallel radix sort work? | <p>I'm currently learning computer science, and there is a slide of notes brief described the parallel radix sort under data parallelism.</p>

<pre><code>number 101 110 011 001 111 (1st bit)
order 2 1 3 4 5 (new order)
number 110 101 011 001 111 (2nd bit)
order 3 1 4 2 5 (new o... | algorithms sorting parallel computing radix sort | 0 |
6,874 | Show that a language belongs to the polynomial hierarchy | <p>I think the following exercise is to "warm up", but nevertheless it's quite difficult for me:</p>

<blockquote>
 <p>Let $k \in \mathbb{N}$ and let $L \in \Sigma_k$. Show that also $L^{*} \in \Sigma_k$.</p>
</blockquote>

<p>The following details from my lecture notes seem to be useful:</p>&#... | complexity theory time complexity | 1 |
6,877 | reducing subset-sum to partition | <blockquote>
<p><strong>Subset-sum:</strong> Given a list of numbers, find if a non-empty sublist has sum 0 (there's a variation where we want sum=k instead of 0, but 0 is easier for analysis)</p>
<p><strong>Partition:</strong> Given a list, can it be partitioned into two non-empty sublists with equal sum?</p>&... | complexity theory np complete reductions partitions | 1 |
6,879 | Showing the function=? is impossible | <p>Here's a lab from a first-year computer science course, taught in Scheme: <a href="https://www.student.cs.uwaterloo.ca/~cs135/assns/a07/a07.pdf">https://www.student.cs.uwaterloo.ca/~cs135/assns/a07/a07.pdf</a></p>

<p>At the end of the lab, it basically presents the halting problem, and shows that it is impo... | undecidability lambda calculus halting problem | 1 |
6,883 | Gödelization in Turing Machine | <p>I was looking at Gödelization in Theory of Computation course. I could understand the Gödel numbering concepts, but couldn't understand its importance in Theory of Computation. Could anyone please point to some good materials or point out its importance.</p>
 | formal languages turing machines | 1 |
6,885 | Strict polynomial hierarchy and reduction | <p>The following exercise gives me headaches:</p>

<blockquote>
 <p>Show: If the polynomial hierarchy is strict (i.e. $\forall k \in \mathbb{N}. \Sigma_k \neq \Sigma_{k+1}$), then there is no $\text{PH}$-complete problem for polynomial-time reductions (i.e. there is no problem $\text{P} \in \text{PH}$ such... | complexity theory time complexity | 1 |
6,891 | #P complexity reduction | <p>We know that counting the number of Hamiltonian paths is in $\#\mathsf{P}$.</p>

<p>So, what complexity (counting version) class would the counting the number of Hamiltonian paths that have two or three particular vertexes in a graph be in?</p>

<p>Also, what would be like if counting the number of h... | complexity theory | 0 |
6,893 | Is this intersection of DFAs correct? | <p>I'm constructing a <a href="http://en.wikipedia.org/wiki/Deterministic_finite_automaton" rel="nofollow noreferrer">deterministic finite automata</a> (DFA) for a language of all strings defined over $\{0,1\}$ whose length is even and number of $1$s is odd. I constructed each DFA separately and then combined:</p>
... | automata regular languages finite automata | 1 |
6,894 | Bellman-Ford algorithm - Why can edges be updated out of order? | <p>The <a href="http://en.wikipedia.org/wiki/Bellman%E2%80%93Ford_algorithm">Bellman-Ford algorithm</a> determines the shortest path from a source $s$ to all other vertices. Initially the distance between $s$ and all other vertices is set to $\infty$. Then the shortest path from $s$ to each vertex is computed; this goe... | algorithms shortest path | 1 |
6,895 | Scala as a language for Generic Programming | <p>I posted <a href="https://softwareengineering.stackexchange.com/q/177037/6638">the same Q at programmers.SE</a>, but nobody really helps.</p>

<p>In the paper “<a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.110.122&rep=rep1&type=pdf" rel="nofollow noreferrer">An Extended Comparativ... | programming languages typing | 1 |
6,897 | Optimization-factoring $\le_p$ Decision-factoring | <p>Optimization factoring:<br>
Input: $N\in \mathbb{N}$<br>
Output: All prime factors of $N$</p>

<p>Decision factoring:<br>
Input: $N, k\in \mathbb{N}$<br>
Output: True iff $N$ has a prime factor of at most $k$</p>

<p>How can I solve the optimization problem in polynomial time if the d... | optimization reductions factoring | 1 |
6,898 | Finding number of smaller elements for each element in an array efficiently | <p>I am stuck on this problem:</p>

<blockquote>
 <p>Given an array $A$ of the first $n$ natural numbers randomly permuted, an array $B$ is 
 constructed, such that
 $B(k)$ is the number of elements from $A(1)$ to $A(k-1)$ which are smaller than $A(k)$. </p>
 
 <p>i) Given $A$ can you ... | algorithms arrays permutations | 0 |
6,901 | What is the time complexity of the following program? | <p>Please help me calculate the time complexity of the following program.</p>

<pre><code>int fun (int n) {
 if (n <= 2)
 return 1;
 else
 return fun(sqrt(n)) + n;
}
</code></pre>

<p>Please explain.</p>

<p>There were four choices given.</p>

<ol>
<l... | algorithm analysis runtime analysis landau notation | 1 |
6,907 | Seeking Alternate Proof Regarding Closure Of Recursively Enumerable Languages | <p>So I would like to show that the class of Recursively Enumerable languages are closed under the shrink operation. In other words, $\text{shrink}_a(L) = \{\text{shrink}_a(w)\mid w\in L\}$ and where $\text{shrink}_a(w)$ is the string formed from $w$ by replacing every maximal substring of two or more $a$'s by a single... | formal languages computability proof techniques closure properties | 1 |
6,910 | NP-Hard problems which are not NP-Complete | <ol>
<li><p>Is it always true that a problem which is ${\sf NP}$-hard but not ${\sf NP}$-complete is an optimization problem such as <strong>Minimum-Vertex-Cover</strong> and many others.</p></li>
<li><p>Is it always true that a ${\sf NP}$-complete problem is always a decision problem such as vertex cover of si... | complexity theory terminology np complete np hard decision problem | 0 |
6,912 | NP-complete reductions | <p>I've read that "Every problem in NP can be reduced to every NP-complete problem". </p>

<p>My question is on the choice of the word "reduce". If I were to "reduce" a polynomial problem in NP to an exponential problem in NP, I just plain feel weird about using the word "reduce" because I feel like I've increa... | complexity theory terminology np complete reductions | 1 |
6,913 | Calculation of effective average instruction execution time in a 2-level paging system | <blockquote>
 <ul>
 <li>System has a two level paging scheme</li>
 <li>Average CPU time for a instruction = 100ns</li>
 <li>Average number of memory accesses per instruction = 2</li>
 <li>Regular memory access = 150 ns</li>
 <li>Page fault service time = 8ms</li>
 <li>TLB hit ratio = ... | operating systems virtual memory paging | 0 |
6,917 | Decidability of languages | <blockquote>
 <p>$L_1$ is a recursively enumerable language over some alphabet
 $\Sigma$. An algorithm effectively enumerates its words as $w_1, w_2, ...$. <br> $L_2$ is another language over $\Sigma \cup \{\#\}$ as
 $\{w_i\#w_j : w_i, w_j \in L_1, i < j\}$<br> Consider the following
 assertions.... | formal languages computability | 1 |
6,919 | Getting negative cycle using Bellman Ford | <p>I have to find a negative cycle in a directed weighted graph. I know how the Bellman Ford algorithm works, and that it tells me if there is a reachable negative cycle. But it does not explicitly name it.</p>
<p>How can I get the actual path <span class="math-container">$v1, v2, \ldots vk, v1$</span> of the cycle... | algorithms graphs shortest path | 1 |
6,929 | Two functions $g(n)$, $G(n)$ such that $g(n) = o(G(n))$ but $g(n+1) \neq o(G(n))$ | <p>The title of the question expresses what I'm looking for - this is to help me better understand the prerequisites for the <a href="http://en.wikipedia.org/wiki/Time_hierarchy_theorem#Non-deterministic_time_hierarchy_theorem">Non-Deterministic Time Hierarchy Theorem</a></p>

<p>For instance, the Arora-Barak b... | complexity theory time complexity asymptotics landau notation | 1 |
6,933 | Showing that Independent set of size $k$ can be decided using logarithmic space | <p>An independent set $I$ is a subset of the nodes of a graph $G$ where: no 2 nodes in $I$ are adjacent in $G$. For natural number $k$, the problem $k-\text{IND}$ asks if there is an independent set of size $k$.</p>

<p>I'd really love your help with showing that $k-\text{IND} \in {\sf L}$, i.e., can be decided... | complexity theory graphs space complexity | 1 |
6,934 | Finite state automata, multiple completion states? | <p>I'm currently studying for an exam for a course where some of the material covered included finite state automata, I've completed a question and I'm not sure about my answer.</p>

<p><strong>Exercise</strong></p>

<p>Explain what is meant by a Finite State Automaton (FSA) by drawing an FSA to recogni... | automata finite automata | 1 |
6,940 | Why use joint trees in Graphical Models? | <p>I am wondering why some methods transform the underlying graphical model (Bayesian Network for example) to a junction tree¹? What are the advantages? Also what are the limitations? </p>

<p>I believe it's for computational purposes. If that's the case under what circumstances it is not recommended to trans... | machine learning | 0 |
6,941 | Randomized Rounding of Solutions to Linear Programs | <p><a href="http://en.wikipedia.org/wiki/Linear_programming#Integral_linear_programs" rel="nofollow">Integer linear programming</a> (ILP) is an incredibly powerful tool in combinatorial optimization. If we can formulate some problem as an instance of an ILP then solvers are guaranteed to find the global optimum. Howeve... | optimization randomized algorithms linear programming approximation | 1 |
6,942 | Cliques in an alternate graph representation | <p>EDITS: corrected $r$ to add edges just like $f$ does in paragraph 8 per the first comment below. Also specified the Clique problem of interest in paragraph 2.</p>

<p>Having received no response to this question on math.SE, I'm asking it here. Thanks for your help.</p>

<p>In <a href="http://en.wikip... | complexity theory graphs | 1 |
6,943 | Why does a suffix tree have a linear number of nodes (relative to input string size)? | <p>Aren't there $n^2$ unique substrings of a string (irrespective of the alphabet size)? Perhaps the number of unique <em>suffix substrings</em> is less than the number of unique <em>substrings</em> of a string.</p>
 | data structures trees strings suffix trees | 1 |
6,951 | Recursion problem involving head, tail and xor | <p>Consider a set of functions:</p>

<ul>
<li><p><code>head(l)</code> returns first bit from list <code>l</code>, e.g.</p>

<pre><code>head([0,1,0]) = 0, 
head([1]) = 1
</code></pre></li>
<li><p><code>tail(l)</code> returns a list by removing first element from <code>l</code>, e.g. </p>&... | recursion functional programming | 0 |
6,952 | How to guess the value of $j$ at the end of the loop? | <pre><code>for ( i = n , j = 0 ; i > 0 ; i = i / 2 , j = j + i ) ;
</code></pre>

<p>All variables are integers.(i.e. if decimal values occur, consider their floor value)</p>

<p>Let $\text{val}(j)$ denote the value of $j$, after the termination of the loop. Which of the following is true?</p>&#x... | algorithm analysis asymptotics integers | 1 |
6,960 | Is the complement of $ww^R$ context-free? | <p>Identify the language given by $L = \{ x \in (0,1)^* : x \neq ww^R, w \in (0,1)^*\}$. Note: $w^R$ is the reverse of the string $w$.</p>

<p>Closure property can/should be applied only in the cases when the actual language is not specified. Otherwise, you may arrive at wrong conclusions. The language in quest... | formal languages context free | 0 |
6,961 | Algorithm exercise | <p>making exercises to prepare a test I'm having problems to understand 2 questions, the questions are:</p>

<pre><code> how many are the leafs of a decisional tree associated to any algorithm for 
 the search problem in a ordered set?
</code></pre>

<p>for this question I have 2 set of answer... | algorithms | 1 |
6,964 | Question about a semi-decidable property of languages | <p>Consider the following property of recursively enumberable (RE) languages </p>

<p>$$ L = \{ J \in \text{RE} \mid J \cap L_{uni} \ne \emptyset \}$$</p>

<p>where $L_{uni}$ is the language of the Universal Turing machine.</p>

<p>I am wondering if $L$ is semi-decidable. That is (by definition)... | computability turing machines | 0 |
6,965 | Recursive and regular languages | <p>I'm trying to study for an exam and having difficulty with the following practice questions. Any help would be appreciated.</p>

<ol>
<li>Give a language $L$ such that $L$ is not recursive but $\text{prefix}(L)$ is regular.</li>
<li>Give two languages $L_1$ and $L_2$, such that $L_1$ and $L_2$ are no... | formal languages regular languages context free | 0 |
6,968 | Find vectors with elements of finite fields that sum up to given value | <p>Given a universe $U$ consisting of k sets of vectors with each vector $\vec{v} \in {\mathbb{F}_{p^m}}^n $. Given also another vector $\vec{c} \in {\mathbb{F}_{p^m}}^n$.
Now decide if there is a set $X$ with $|X| = |U|$ and $X_i \in U_i, i = 1,2,...,k$ such that $\sum\limits_i X_i = \vec{c}$. If there is, output ... | algorithms combinatorics discrete mathematics | 1 |
6,969 | I need to present a regular expression for the following languages: | <p>1.
L2 = E{0,1)</p>

<p>All the words in L2 with equal number of 0's and 1's and every prex of w has at most two more of either
0's or 1's.</p>

<p>2.
All words that does not contain “bbb” as substring.</p>

<p>i think this is :( e + b + bb)(a + ab + abb)*</p>

<p>Thanks in... | regular expressions | 0 |
6,972 | Machine Learning: how to correctly calculate gradient descent for simple linear problem | <p>So, I was trying to learn machine learning, and, after watching a couple of Andrew Ng's lectures decided to try and write a simple piece of code to determine what someone's salary would be based on the number of years they worked at a company by this simple linear function:</p>

<p>salary = w1 * numberOfYear... | machine learning linear algebra | 0 |
6,973 | What do these arrows in design pattern diagrams mean? | <p>I am learning about software design patterns by reading Wikipedia pages about them. A lot of the patterns such as the bridge pattern have diagrams with boxes and different kinds of arrows:</p>

<p><a href="https://i.stack.imgur.com/ZPF7S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZPF7... | terminology software engineering | 1 |
6,977 | Routing Algorithms and Hosts | <p>I'm reading a book about computer network theory, and one topic is discusses is routing algorithms. It only mentions (probably not intentionally) how routers participate in forming the understood network topology stored in each routers memory - the routing tables. </p>

<p>So this brings me to my question, ... | computer networks | 1 |
6,980 | Generalized data structure | <p>Data structures are seen as important, equal to algorithms. This view is especially encouraged in situations, where appropriate data structure is the main factor that allows an algorithm to exist and to perform at satisfying complexity.</p>

<p>However, despite the additional features of data structures (e.g... | algorithms data structures information theory | 0 |
6,981 | Condition in Shamir Secret Sharing Scheme | <p>For Shamir's secret sharing scheme (<a href="http://dx.doi.org/10.1145/359168.359176" rel="nofollow">doi 10.1145/359168.359176</a>), one obtains a random polynomial $q$ of degree at most $n-1$ (over $\mathbb{Z}_p[x]$). The constant coefficient of this polynomial is defined to be the key. Then the scheme sends to p... | probability theory cryptography | 0 |
6,990 | Deletion in min/max heaps | <p>I think I'm confused about deletion in heaps, and since I have an exam today, I'm looking for your help to correct me.</p>

<p>I will post photos since it will makes it a bit more clear.</p>

<p>Note(forget about deleting the root)</p>

<p><img src="https://i.stack.imgur.com/USyPs.png" alt="e... | data structures heaps | 1 |
6,992 | Context-free Languages closed under Reversal | <p>In class this week we've been learning about the CFLs and their closure properties. I've seen proofs for union, intersection and compliment but for reversal my lecturer just said its closed. I wanted to see the proof so I've been searching for the past few days but all I've found is most people just say that to reve... | context free closure properties | 1 |
6,993 | Question related to Hilbert's 10th problem | <p>Given $n \in \mathbb{N}$ and $p,q \in \mathbb{N}[x_1,\ldots,x_n]$ one can define the following formula in the language of formal arithmetics</p>

<p>$$\varphi(n,p,q) = \forall x_1 \cdots \forall x_n : \neg (p(x_1,\ldots,x_n) = q(x_1,\ldots,x_n))$$</p>

<p>I would like to show that there are infinit... | computability logic undecidability | 0 |
6,995 | Height of AVL after entries | <blockquote>
 <p><strong>Problem:</strong> Suppose $V$ is an <a href="http://en.wikipedia.org/wiki/AVL_tree" rel="nofollow">AVL tree</a> (a self-balancing binary search tree) of $n$
 elements. After the insertion of $n^2$ elements, what would be its
 height?</p>
</blockquote>

<p><strong>My i... | algorithms asymptotics binary trees search trees | 1 |
6,997 | What is OUTER UNION and why is it partially compatible | <p>I am trying to understand how a <code>OUTER UNION</code> $∪^✳$ works, and why it is only partially compatible. </p>

<p>I am aware this operation was created to take union of tuples from two relations if the relation are not type compatible (which I understand).</p>

<p>Examples of this operation wil... | terminology database theory relational algebra | 1 |
7,001 | Distributed algorithms - $\alpha, \beta$ synchronizers | <p>I experience a difficulty in solving exercises in distributed algorithm. Below is the the exercise I try to solve, it looks like I miss basic idea. </p>

<p><strong>Exercise.</strong> Consider a 15-processor asynchronous network with processors 0,…,14. The processors constantly run a synchronizer. Let $v$ an... | algorithms distributed systems synchronization | 1 |
7,003 | How can one simulate a PDA with a FIFO queue PDA? | <p>I'm trying to figure out how a pushdown automata (PDA), which we know uses a stack (LIFO) can be simulated by a queue (FIFO). I understand that in a regular PDA, we only have access to the top most element which can be popped. When we push something, it goes to the top of the stack. </p>

<p>In a queue, as I... | automata pushdown automata machine models | 1 |
7,005 | What is an instance of NP complete problem? | <p>I don't understand this definition of an "instance" of a problem. Quoting from the CLRS book on page 1054 on abstract problems (Chapter 34.1):</p>

<blockquote>
 <p>We define an abstract problem $Q$ to be a binary relation on a set $I$ of problem <strong>instances</strong> and set $S$ of problem <stron... | complexity theory terminology np complete | 1 |
7,008 | A puzzle related to nested loops | <p>For a given input $N$, how many times does the enclosed statement executes?</p>

<blockquote>
 <p>for $i$ in $1\ldots N$ loop <br>
 $\quad$for $j$ in $1\ldots i$ loop <br>
 $\quad$$\quad$for $k$ in $i\ldots j$ loop <br>
 $\quad$$\quad$$\quad$$sum = sum + i$ ; <br>
 $\quad$$\quad$end ... | algorithm analysis loops | 1 |
7,013 | Graph 3-colorability is self-reducible | <p>I am interested in self-reducibility of Graph 3-Coloralibity problem.</p>

<p><strong>Definition of Graph 3-Coloralibity problem.</strong></p>

<p>Given an undirected graph $G$ does there exists a way to color the nodes red, green, and blue so that no adjacent nodes have the same color?</p>

... | complexity theory reductions | 1 |
7,014 | Proof for P-complete is not closed under intersection | <p>Unfortunately I have no idea how to show this:</p>

<blockquote>
 <p>Show that the set of ${\sf P}$-complete languages is not closed under intersection.</p>
</blockquote>

<p>As far as I understand my lecture notes, ${\sf P}$-completeness is defined as follows:</p>

<ul>
<li>$A \... | complexity theory time complexity reductions | 0 |
7,019 | Grammar for a language: odd length, middle character not repeated | <p>Consider the following language over the alphabet $\mathcal{A} = \{a,b,c\}$:
$$L = \left\{w \in \mathcal{A}^* \mid \text{\(|w|\) is odd and the middle character in \(w\) occurs nowhere else in \(w\)} \right\}$$</p>

<p>I am trying to come up with a grammar for $L$, but I'm getting nowhere. I came up with... | formal languages formal grammars | 0 |
7,022 | Show that the multiplication lies in FL | <p>I don't know exactly how to solve the exercise below.</p>

<blockquote>
 <p>Show that the multiplication lies in $\text{FL}$.</p>
 
 <p>Hint: A useful approach to a solution is to split the exercise into two parts and to explain that each function lies in $\text{FL}$. The standard multiplicati... | complexity theory space complexity | 0 |
7,025 | Conflicting definitions of language accepted by Turing Machine? | <p>I am reading Papadimitriou, Computational Complexity, page 24, where it is says </p>

<blockquote>
 <p>We say that $M$ accepts $L$ whenever for any string $x \in (\Sigma - \{\sqcup\})^*$, if $x \in L$, then $M(x) =$ ``yes''; however, if $x\notin L$, then $M(x) = \nearrow$. </p>
</blockquote>
&#x... | reference request turing machines | 1 |
7,029 | Inapproximability result implies apx-hardness? | <p>If an optimization problem is known to be inapproximable up to some precision, does this automatically imply that the problem is apx-hard?</p>
 | complexity theory approximation | 1 |
7,031 | Grammatical characterization of deterministic context-free languages | <p>Deterministic context-free languages are commonly defined using an <em>automaton</em> concept, the (restricted, deterministic) pushdown automaton. To some that is confusing, as the name <em>context-free</em> refers to a grammar type.</p>

<p>I seem to remember there exists a characterization of the DCF langu... | reference request formal grammars context free | 1 |
7,032 | Simple proof that circuit satisfiability problem is NP-Hard | <p><span class="math-container">$\newcommand{\np}{\mathsf{NP}}\newcommand{\cc}{\textrm{Circuit-SAT}}$</span>I am having difficulty understanding the <span class="math-container">$\np$</span>-hardness proof for <span class="math-container">$\cc$</span> in <a href="http://en.wikipedia.org/wiki/Introduction_to_Algorithms"... | complexity theory np hard satisfiability circuits | 1 |
7,033 | Inferences about Branching in TSP algorithm | <p>I am building a program that uses branching-and-bounding to find an optimal path in a complete graph (the heuristic, faster algorithm is the second part). I have to begin and end at node 0. I was given a large hint that eliminating "hopeless" branches early in the algorithm will lead to an overall much faster runtim... | optimization graph traversal | 0 |
7,037 | How does sorting come into play with convex hull? | <p>I am investigating a convex hull algorithm that involves sorting. In fact, its running time is limited by sorting, so it is $O(n \log n)$, where $n$ is the number of points on the plane.</p>

<p>That algorithm first sorts the points by x-coordinates. It then includes the first and last points in the convex h... | algorithms computational geometry | 0 |
7,038 | What is the origin of the client server model? | <p>I was wondering if someone knew the origin of the client server model. Where does the term come from (paper, software application, book)?</p>
 | terminology reference request distributed systems history | 1 |
7,039 | Show that k-clique lies in L | <p>The following exercise is difficult for me:</p>

<blockquote>
 <p>Show that for each $k \in \mathbb{N}$ the question of existence of a $k$-clique within a graph lies in $\text{L}$.</p>
 
 <p>Hint: A $k$-clique denotes $k$ verteces within a graph that are all connected with each other.</p>
... | complexity theory space complexity | 0 |
7,040 | Fuzzy string matching algorithm with allowed events? | <p>I want to be able to locate a substring in a string allowing for a specified number of mismatches, insertions and deletions - and at the same time know how many mismatches, insertions and deletions were used for any match.</p>

<p>Using brute force backtrack I can find the matches, but I cannot guarantee tha... | algorithms dynamic programming strings substrings | 0 |
7,041 | Deterministic context-free languages are closed under regular right-product | <p>I am looking for a proof for the following problem:</p>

<blockquote>
 <p>For languages $L$ and $R$, if $L$ is <a href="http://en.wikipedia.org/wiki/Deterministic_context-free_language" rel="nofollow">deterministic context-free</a>
 and $R$ is regular, then $LR$ is a deterministic context-free
... | formal languages context free closure properties pushdown automata | 0 |
7,042 | How does an automaton actually "compute"? | <p>In my studies in computability I have come across the notion of the "machine", an abstract representation of a device that essentially computes. I have read about Turing Machines and Wolfram's binary cellular automata and I understand them.ie. the rules, states, colours, etc. and how they work. They begin in some st... | computability automata cellular automata | 0 |
7,046 | Hamiltonian path in dynamic graph | <p>Given an undirected Graph. I want to find a hamiltonian path with no restriction to starting or ending vertices. I know there are some smart algorithms for solving that.<br>
Now let's make things interesting: sometimes, when I arrive at a vertex, the edges connected to that vertex change. I.e. some will be remov... | algorithms graphs reductions | 0 |
7,048 | A Recursive Formula For Generalized Josephus problem | <p>The <a href="http://en.wikipedia.org/wiki/Josephus_problem" rel="nofollow">Josephus Problem</a> asks where to start taking out every kth person in the circle consisted of n people, such that you are the last "survivor".</p>

<p>The following recursive formula is given:
$$\begin{align}
f(1,k)&=1, ... | combinatorics recursion | 1 |
7,050 | What are the differences between computer vision and image processing? | <p>What are the differences between computer vision and image processing? For example, in object recognition, what are the roles of computer vision and image processing?</p>
 | terminology computer vision image processing education | 1 |
7,051 | Radix sort exercise | <p>I'm trying to understand a proof regarding radix-sort but to no avail.</p>

<p>I'll first write down a brief summary of the proof and then assign some questions which I hope will be clarified enough.</p>

<blockquote>
 <p>Suppose you have an array of integer numbers in the range $\{0,1,2,\ldots ... | algorithms algorithm analysis sorting | 1 |
7,052 | Using Clique decision to solve Clique optimization | <p>How can you perform the clique decision algorithm fewer than $ O(n) $ times to solve clique optimization?</p>

<p>I'm not sure if my approach is right but this is my thought process: you would pick vertices in a graph and see if they form a clique, then keep picking more vertices until you have the max possi... | algorithms graphs optimization | 1 |
7,054 | What is the difference between control flow graph & interprocedural control flow graph? | <p>I am doing research on control flow analysis on aspect oriented programs and I found in some papers an interprocedural approach for doing control flow analysis on others call graph or control flow graph. Is there a real difference between control flow graphs and interprocedural control flow graphs?</p>
 | terminology algorithm analysis programming languages | 1 |
7,055 | How does this algorithm for verifying if a string is $0^n1^n$ work? | <p>I have found an efficient algorithm for verifying if a string $\omega$ is of the form $0^n1^n$, where $n \in \mathbb{N}$.</p>

<ol>
<li>Scan across $\omega$. If a 1 appears before a 0, then reject.</li>
<li><p>Repeat so long as some 0s and some 1s remain on the tape.</p>

<ol>
<li>Scan ac... | algorithms formal languages | 1 |
7,056 | Why is it that every k-tape Turing machine has a 1-tape TM that runs in $O(t^2(n))$? | <p>Apparently, for every k-tape Turing machine that runs in time $O(t(n))$, there exists a 1-tape Turing machine that runs in $O(t^2(n))$.</p>

<p>I can see how any multi-tape machine $M$ can be simulated by a 1-tape machine $S$. Just have the tape of $S$ contain all of $M$'s tapes separated by some symbol such... | turing machines | 1 |
7,061 | Show the Language is Recursive | <p>I have devised the following TM for the language EQUAL. </p>

<p>EQUAL accepts all strings with the same number of a's and b's. It is context free but non regular. </p>

<p>Using the TM I devised, how can I show that EQUAL is recursive? How can I show that it crashes when the input is not in EQUAL.</... | formal languages computability turing machines | 1 |
7,062 | Why is the unary representation of a number exponentially larger than a base k representation of it? | <p>According to a book I am reading, the unary representation of a number exponentially larger than a base k representation of it. I, however, feel that the unary representation should scale linearly with the input.</p>

<p>After all, 1 is 1, 2 is 11, 3 is 111, and so on, right? Wouldn't that be linear?</p>
... | algorithm analysis | 1 |
7,064 | Using coloring optimization or coloring decision to solve coloring search | <p>How can you show that <strong>coloring search</strong> can be solved by making a polynomial number of calls to the solution for <strong>coloring optimization</strong> or <strong>coloring decision</strong>? (<strong>Coloring search</strong> is the algorithm to color the vertices of a graph such that adjacent vertices... | graphs np | 1 |
7,065 | How does this non-deterministic algorithm to find if a Hamiltonian path exists work? | <p>I have read of an algorithm that a <a href="http://en.wikipedia.org/wiki/Non-deterministic_Turing_machine" rel="nofollow">non-deterministic Turing machine</a> $N$ can run to determine whether a given graph $G$ has a <a href="http://en.wikipedia.org/wiki/Hamiltonian_path" rel="nofollow">Hamiltonian path</a> from the ... | turing machines nondeterminism | 1 |
7,068 | How to determine the polynomial runtime of an NP reduction? | <p>To show that a NP problem is NP-complete, we also have to show that $L \leq_{p} L'$ , where $L$ is proven NP-complete and you have to prove $L'$ also is. The thing I am confused is how in all NP-complete problems in CLRS they just state the reduction algorithm for $L$ to convert to $L'$ is polynomial. How can one p... | complexity theory np complete reductions proof techniques | 1 |
7,071 | Doubt regarding cache hit ratios and access time | <p><strong>Question 1:</strong> What is the average access time for a 3-level memory system with access time $T_1$, $2T_1$ and $3T_1$? (Hit ratio $h_1$ = $h_2$ = 0.9)</p>

<p>The solution given is: $0.9[T_1] + 0.1(0.9[2*T_1] + 0.1[3*T_1]) = 1.11[T_1]$ <strong>(Method 1)</strong></p>

<p>Here, they have... | computer architecture cpu cache | 1 |
7,072 | Non-self-reducible NP problem | <p>I am interesting in proving that there is no search problem that is polynomial bounded and self-reducible, as long as ${\sf P} \neq {\sf NP} \cap {\sf coNP}$.</p>

<p>The problem is I don't know how to approach the proof, below I wrote few ideas with open questions.</p>

<p>We can start by denoting... | complexity theory reductions | 0 |
7,073 | Finding nested intervals efficiently | <p>The intervals are represented as two numbers, e.g. $(4.3, 5.6)$. The intervals are unique. </p>

<p>If for $(x,y)$ and $(u,v)$, $x≤u$ and $v≤y$, $(u,v)$ is nested in $(x,y)$</p>

<p>How do I find out which intervals are nested in others efficiently?</p>

<p>The hint is to use two induction hy... | algorithms induction | 1 |
7,074 | How does the computer determine whether a number is smaller or greater than another? | <p>It might sound like a stupid question but I'm really curious to know how a computer knows that $1<2$? Also, how does a computer know that the order of integer is $1,2,3,4,5,\ldots$ and alphabet is A,B,C,D,...? Is it somewhere stored in the hardware or does the operating system provide this kind of information?</p... | computer architecture reference question | 1 |
7,076 | How to show composition of one way function is not such? | <p>I was wondering how should I proceed in order to show that the composition of (say) two one-way functions (either weak or strong or both together) is not a one-way function?</p>

<p>Specifically: Say $f$ and $g$ are one-way functions (either weak or strong).
How do I prove that their composition $g(f(x))... | proof techniques cryptography one way functions | 1 |
7,078 | Myers' Fast bit-vector algorithm in plain English? | <p>Inspired by this <a href="https://stackoverflow.com/questions/9452701/ukkonens-suffix-tree-algorithm-in-plain-english">question on Suffix Trees</a>, and the fabulous winning answer, I would hereby ask for a similar explanation of Myers' <a href="http://www.gersteinlab.org/courses/452/09-spring/pdf/Myers.pdf" rel="no... | algorithms strings | 0 |
7,079 | A puzzle in Permutation | <p>There are two stacks A and B. </p>

<pre><code>A : a,b,c,d ('a' is on top and 'd' is at the bottom of the stack)
B : (empty)
</code></pre>

<p>There are two rules.</p>

<pre><code>If an element of A is popped, it must be printed immediately or pushed into B.
If an element of B... | stacks permutations | 1 |
7,091 | Why is $3^n = 2^{O(n)}$ true? | <p>$3^n = 2^{O(n)}$ is apparently true. I thought that it was false though because $3^n$ grows faster than any exponential function with a base of 2.</p>

<p>How is $3^n = 2^{O(n)}$ true?</p>
 | asymptotics landau notation | 1 |
7,096 | Transitive reduction of DAG | <p>I am looking for O(V+E) algorithm for finding the <a href="http://en.wikipedia.org/wiki/Transitive_reduction">transitive reduction</a> given a DAG. </p>

<p>That is remove as many edges as possible so that if you could reach v from u, for arbitrary v and u, you can still reach after removal of edges.</p>
... | algorithms graphs dag | 0 |
7,097 | NAE SAT reduction to weighted MAX CUT | <p>I am trying to reduce NOT-ALL-EQUAL SAT to MAX-CUT with weighted edges. </p>

<p>I know that if there are weights to the edges, then I can reduce NOT-ALL-EQUAL SAT to MAX CUT by have a $G$ with $2n$ nodes ($x_i$ and $\bar{x}_i$) and edges between the nodes based on each clause. And, adding edges between $x_i... | complexity theory reductions | 0 |
7,098 | Is 1-in-k SAT NP-complete for k > 3 | <p>It is well-known that 1-in-k SAT is NP-complete for k=3. What about for k > 3?</p>
 | complexity theory reference request np complete | 0 |
7,101 | Reducing recursive languages | <p>I need a clarification related to the following situation.</p>

<p>Consider a Turing machine $T_1$ that halts for every input. In other words $J_1 = L(T_1) \subseteq \Sigma^*$ is recursive. Suppose we are given a function $f:\Sigma^* \mapsto \Sigma^*$ and a language $J_2 \in \Sigma^*$ such that $$ x \in J_2 ... | computability turing machines | 1 |
7,105 | Time complexity for count-change procedure in SICP | <p>In famous Structure and Interretation of Computer Programs, there is an exercise (<a href="http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-11.html#%_thm_1.14" rel="noreferrer">1.14</a>), that asks for the time complexity of the following algorithm - in Scheme - for counting change (the problem statement suggest... | algorithms time complexity space complexity | 1 |
7,109 | String similarity problem | <blockquote>
 <p>We are given two strings $x=x_1,x_2,x_3,\ldots,x_m$ and $y=y_1,y_2,y_3,\ldots,y_n$ over some finite alphabet.
 We consider the problem of converting $x$ to $y$. Using the following operations:</p>
 
 <p>1.Substitution: replace one symbol by another one.</p>
 
 <p>2.Inserti... | algorithms reference request dynamic programming strings | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.