id int64 1 141k | title stringlengths 15 150 | body stringlengths 45 28.5k | tags stringlengths 1 102 | label int64 1 1 | text stringlengths 128 28.6k | source stringclasses 1
value |
|---|---|---|---|---|---|---|
1,143 | Finding a 5-Pointed Star in polynomial time | <p><strong>I want to establish that this is part of my homework for a course I am currently taking. I am looking for some assistance in proceeding, NOT AN ANSWER.</strong></p>

<p>This is the question in question:</p>

<blockquote>
 <p>A 5-pointed-star in an undirected graph is a 5-clique. Show th... | complexity theory time complexity | 1 | Finding a 5-Pointed Star in polynomial time -- (complexity theory time complexity)
<p><strong>I want to establish that this is part of my homework for a course I am currently taking. I am looking for some assistance in proceeding, NOT AN ANSWER.</strong></p>

<p>This is the question in question:</p>

<... | habedi/stack-exchange-dataset |
1,154 | How can I measure the usability of a catalogue? | <p>This question might seems vague but heres the context:</p>

<p>When we are focusing on HCI we would most likely be interested on knowing first how the user usually deals with a certain object. We then try to see how our system could take away one of the tasks he would do himself and try to do it itself. </p>... | empirical research modelling hci | 1 | How can I measure the usability of a catalogue? -- (empirical research modelling hci)
<p>This question might seems vague but heres the context:</p>

<p>When we are focusing on HCI we would most likely be interested on knowing first how the user usually deals with a certain object. We then try to see how our sys... | habedi/stack-exchange-dataset |
1,176 | HALF CLIQUE - NP Complete Problem | <p>Let me start off by noting <strong>this is a homework problem, please provide only advice and related observations, NO DIRECT ANSWERS please</strong>. With that said, here is the problem I am looking at:</p>

<blockquote>
 <p>Let HALF-CLIQUE = { $\langle G \rangle$ | $G$ is an undirected graph having a... | complexity theory np complete reductions | 1 | HALF CLIQUE - NP Complete Problem -- (complexity theory np complete reductions)
<p>Let me start off by noting <strong>this is a homework problem, please provide only advice and related observations, NO DIRECT ANSWERS please</strong>. With that said, here is the problem I am looking at:</p>

<blockquote>
 ... | habedi/stack-exchange-dataset |
1,200 | How to deal with arrays during Hoare-style correctness proofs | <p>In the discussion around <a href="https://cs.stackexchange.com/q/1157/98">this question</a>, Gilles mentions correctly that any correctness proof of an algorithm that uses arrays has to prove that there are no out-of-bounds array accesses; depending on the runtime model, this would cause a runtime error or access to... | proof techniques semantics arrays hoare logic software verification | 1 | How to deal with arrays during Hoare-style correctness proofs -- (proof techniques semantics arrays hoare logic software verification)
<p>In the discussion around <a href="https://cs.stackexchange.com/q/1157/98">this question</a>, Gilles mentions correctly that any correctness proof of an algorithm that uses arrays has... | habedi/stack-exchange-dataset |
1,218 | Lower bounds of calculating a function of a set | <p>Having a set $A$ of $n$ elements, let's say I want to calculate a function $f(A)$ that is sensitive to all parts of the input, i.e. depends on very member of $A$ (i.e. it is possible to change any member of $A$ to something else to obtain a new input $A'$ s.t. value of $f$ on $A$ and $A'$ are different).</p>... | complexity theory | 1 | Lower bounds of calculating a function of a set -- (complexity theory)
<p>Having a set $A$ of $n$ elements, let's say I want to calculate a function $f(A)$ that is sensitive to all parts of the input, i.e. depends on very member of $A$ (i.e. it is possible to change any member of $A$ to something else to obtain a new i... | habedi/stack-exchange-dataset |
1,223 | The space complexity of recognising Watson-Crick palindromes | <p>I have the following algorithmic problem:</p>

<blockquote>
 <p>Determine the space Turing complexity of recognizing DNA strings that are Watson-Crick palindromes. </p>
</blockquote>

<p>Watson-Crick palindromes are strings whose reversed complement is the original string. The <em>complement... | algorithms algorithm analysis turing machines space complexity | 1 | The space complexity of recognising Watson-Crick palindromes -- (algorithms algorithm analysis turing machines space complexity)
<p>I have the following algorithmic problem:</p>

<blockquote>
 <p>Determine the space Turing complexity of recognizing DNA strings that are Watson-Crick palindromes. </p>
</... | habedi/stack-exchange-dataset |
1,225 | Attack on hash functions that do not satisfy the one-way property | <p>I am revising for a computer security course and I am stuck on one of the past questions. Here is it:</p>

<blockquote>
 <p>Alice ($A$) wants to send a short message $M$ to Bob ($B$) using a shared secret $S_{ab}$ to authenticate that the message has come from her. She proposes to send a single message ... | cryptography hash one way functions | 1 | Attack on hash functions that do not satisfy the one-way property -- (cryptography hash one way functions)
<p>I am revising for a computer security course and I am stuck on one of the past questions. Here is it:</p>

<blockquote>
 <p>Alice ($A$) wants to send a short message $M$ to Bob ($B$) using a shared... | habedi/stack-exchange-dataset |
1,229 | Why does the splay tree rotation algorithm take into account both the parent and grandparent node? | <p>I don't quite understand why the rotation in the splay tree data structure is taking into account not only the parent of the rating node, but also the grandparent (zig-zag and zig-zig operation). Why would the following not work:</p>

<p>As we insert, for instance, a new node to the tree, we check whether we... | algorithms data structures binary trees search trees | 1 | Why does the splay tree rotation algorithm take into account both the parent and grandparent node? -- (algorithms data structures binary trees search trees)
<p>I don't quite understand why the rotation in the splay tree data structure is taking into account not only the parent of the rating node, but also the grandpare... | habedi/stack-exchange-dataset |
1,231 | Efficiently selecting the median and elements to its left and right | <p>Suppose we have a set $S = \{ a_1,a_2,a_3,\ldots , a_N \}$ of $N$ coders.</p>

<p>Each Coders has rating $R_i$ and the number of gold medals $E_i$, they had won so far.</p>

<p>A Software Company wants to hire exactly three coders to develop an application.</p>

<p>For hiring three coders, t... | algorithms algorithm design | 1 | Efficiently selecting the median and elements to its left and right -- (algorithms algorithm design)
<p>Suppose we have a set $S = \{ a_1,a_2,a_3,\ldots , a_N \}$ of $N$ coders.</p>

<p>Each Coders has rating $R_i$ and the number of gold medals $E_i$, they had won so far.</p>

<p>A Software Company want... | habedi/stack-exchange-dataset |
1,234 | Classification of intractable/tractable satisfiability problem variants | <p>Recently I found in a paper [1] a special symmetric version of SAT called the <strong>2/2/4-SAT</strong>. But there are many $\text{NP}$-complete variants out there, for example: <strong>MONOTONE NAE-3SAT</strong>, <strong>MONOTONE 1-IN-3-SAT</strong>, ...</p>

<p>Some other variants are tractable: $2$-$\tex... | complexity theory reference request satisfiability | 1 | Classification of intractable/tractable satisfiability problem variants -- (complexity theory reference request satisfiability)
<p>Recently I found in a paper [1] a special symmetric version of SAT called the <strong>2/2/4-SAT</strong>. But there are many $\text{NP}$-complete variants out there, for example: <strong>MO... | habedi/stack-exchange-dataset |
1,236 | How does variance in task completion time affect makespan? | <p>Let's say that we have a large collection of tasks $\tau_1, \tau_2, ..., \tau_n$ and a collection of identical (in terms of performance) processors $\rho_1, \rho_2, ..., \rho_m$ which operate completely in parallel. For scenarios of interest, we may assume $m \leq n$. Each $\tau_i$ takes some amount of time/cycles t... | probability theory scheduling parallel computing | 1 | How does variance in task completion time affect makespan? -- (probability theory scheduling parallel computing)
<p>Let's say that we have a large collection of tasks $\tau_1, \tau_2, ..., \tau_n$ and a collection of identical (in terms of performance) processors $\rho_1, \rho_2, ..., \rho_m$ which operate completely i... | habedi/stack-exchange-dataset |
1,243 | What is meant by "solvable by non deterministic algorithm in polynomial time" | <p>In many textbooks NP problems are defined as:</p>

<blockquote>
 <p>Set of all decision problems solvable by non deterministic algorithms in polynomial time</p>
</blockquote>

<p>I couldn't understand the part "solvable by non deterministic algorithms". Could anyone please explain that?</p>&... | complexity theory terminology nondeterminism | 1 | What is meant by "solvable by non deterministic algorithm in polynomial time" -- (complexity theory terminology nondeterminism)
<p>In many textbooks NP problems are defined as:</p>

<blockquote>
 <p>Set of all decision problems solvable by non deterministic algorithms in polynomial time</p>
</blockquot... | habedi/stack-exchange-dataset |
1,246 | Where can I find good study material on Role Mining? | <p>I need to cover these topics in Role Mining. If anyone knows good site which well summarizes the topics and concepts are well explained please help out.</p>

<p>Basic role mining problem<br>
• Delta-approx RMP<br>
• Min-noise RMP<br>
• Nature of the RMP problems<br>
• Mapping RMP to database ... | education reference request security access control | 1 | Where can I find good study material on Role Mining? -- (education reference request security access control)
<p>I need to cover these topics in Role Mining. If anyone knows good site which well summarizes the topics and concepts are well explained please help out.</p>

<p>Basic role mining problem<br>
• De... | habedi/stack-exchange-dataset |
1,255 | Ordering elements so that some elements don't come between others | <p>Given an integer $n$ and set of triplets of distinct integers
$$S \subseteq \{(i, j, k) \mid 1\le i,j,k \le n, i \neq j, j \neq k, i \neq k\},$$
find an algorithm which either finds a permutation $\pi$ of the set $\{1, 2, \dots, n\}$ such that
$$(i,j,k) \in S \implies (\pi(j)<\pi(i)<\pi(k)) ~\lor~ ... | algorithms optimization scheduling | 1 | Ordering elements so that some elements don't come between others -- (algorithms optimization scheduling)
<p>Given an integer $n$ and set of triplets of distinct integers
$$S \subseteq \{(i, j, k) \mid 1\le i,j,k \le n, i \neq j, j \neq k, i \neq k\},$$
find an algorithm which either finds a permutation $\pi$ o... | habedi/stack-exchange-dataset |
1,259 | A lambda calculus evaluation involving Church numerals | <p>I understand that a <a href="http://en.wikipedia.org/wiki/Church_encoding">Church numeral</a> $c_n$ looks like $\lambda s. \lambda z. s$ (... n times ...) $s\;z$. This means nothing more than "the function $s$ applied $n$ times to the function $z$".</p>

<p>A possible definition of the $\mathtt{times}$ funct... | lambda calculus church numerals | 1 | A lambda calculus evaluation involving Church numerals -- (lambda calculus church numerals)
<p>I understand that a <a href="http://en.wikipedia.org/wiki/Church_encoding">Church numeral</a> $c_n$ looks like $\lambda s. \lambda z. s$ (... n times ...) $s\;z$. This means nothing more than "the function $s$ applied $n$ tim... | habedi/stack-exchange-dataset |
1,270 | What is the average turnaround time? | <p>For the following jobs: </p>

<p><img src="https://i.stack.imgur.com/rwOBN.png" alt="job table"></p>

<p>The <strong>average wait time</strong> would be using a FCFS algorithm:</p>

<p>(6-6)+(7-2)+(11-5)+(17-5)+(14-1) -> 0+5+6+10+13 -> 34/5 = 7 (6.8)</p>

<p>What would the <strong>ave... | algorithms operating systems process scheduling scheduling | 1 | What is the average turnaround time? -- (algorithms operating systems process scheduling scheduling)
<p>For the following jobs: </p>

<p><img src="https://i.stack.imgur.com/rwOBN.png" alt="job table"></p>

<p>The <strong>average wait time</strong> would be using a FCFS algorithm:</p>

<p>(6-6)+(... | habedi/stack-exchange-dataset |
1,271 | Why is Relativization a barrier? | <p>When I was explaining the Baker-Gill-Solovay proof that there exists an oracle with which we can have, $\mathsf{P} = \mathsf{NP}$, and an oracle with which we can have $\mathsf{P} \neq \mathsf{NP}$ to a friend, a question came up as to why such techniques are ill-suited for proving the $\mathsf{P} \neq \mathsf{NP}$ ... | complexity theory proof techniques p vs np relativization | 1 | Why is Relativization a barrier? -- (complexity theory proof techniques p vs np relativization)
<p>When I was explaining the Baker-Gill-Solovay proof that there exists an oracle with which we can have, $\mathsf{P} = \mathsf{NP}$, and an oracle with which we can have $\mathsf{P} \neq \mathsf{NP}$ to a friend, a question... | habedi/stack-exchange-dataset |
1,280 | What are examples of inconsistency and incompleteness in Unix/C? | <p>In Richard Gabriel's famous essay <a href="http://dreamsongs.com/RiseOfWorseIsBetter.html">The Rise of Worse is Better</a>, he contrasts caricatured versions of the MIT/Stanford (Lisp) and New Jersey (C/Unix) design philosophies along the axes of simplicity, correctness, consistency, and completeness. He gives the ... | programming languages operating systems | 1 | What are examples of inconsistency and incompleteness in Unix/C? -- (programming languages operating systems)
<p>In Richard Gabriel's famous essay <a href="http://dreamsongs.com/RiseOfWorseIsBetter.html">The Rise of Worse is Better</a>, he contrasts caricatured versions of the MIT/Stanford (Lisp) and New Jersey (C/Unix... | habedi/stack-exchange-dataset |
1,287 | Find subsequence of maximal length simultaneously satisfying two ordering constraints | <p>We are given a set $F=\{f_1, f_2, f_3, …, f_N\}$ of $N$ Fruits. Each Fruit has price $P_i$ and vitamin content $V_i$; we associated fruit $f_i$ with the ordered pair $(P_i, V_i)$. Now we have to arrange these fruits in such a way that the sorted list contains prices in ascending order and vitamin contents in descend... | algorithms arrays constraint programming subsequences | 1 | Find subsequence of maximal length simultaneously satisfying two ordering constraints -- (algorithms arrays constraint programming subsequences)
<p>We are given a set $F=\{f_1, f_2, f_3, …, f_N\}$ of $N$ Fruits. Each Fruit has price $P_i$ and vitamin content $V_i$; we associated fruit $f_i$ with the ordered pair $(P_i,... | habedi/stack-exchange-dataset |
1,288 | Security Lattice Construction | <p>I am having a problem trying to solve a question on a past paper asking to design a security lattice. Here is the question:</p>

<blockquote>
 <p>The AB model (Almost Biba) is a model for expressing integrity policies rather
 than confidentiality. It has the same setup as Bell-LaPadula, except ... | security lattices integrity | 1 | Security Lattice Construction -- (security lattices integrity)
<p>I am having a problem trying to solve a question on a past paper asking to design a security lattice. Here is the question:</p>

<blockquote>
 <p>The AB model (Almost Biba) is a model for expressing integrity policies rather
 than c... | habedi/stack-exchange-dataset |
1,290 | How to output all longest decreasing sequences | <p>Suppose I have an array of integers having length $N$. How can I output all longest decreasing sequences? (A subsequence consists of elements of the array that do not have to be consecustive, for example $(3,2,1)$ is a decreasing subsequence of $(7,3,5,2,0,1)$.) I know how to calculate the length of longest decreasi... | algorithms arrays subsequences | 1 | How to output all longest decreasing sequences -- (algorithms arrays subsequences)
<p>Suppose I have an array of integers having length $N$. How can I output all longest decreasing sequences? (A subsequence consists of elements of the array that do not have to be consecustive, for example $(3,2,1)$ is a decreasing subs... | habedi/stack-exchange-dataset |
1,292 | What is required for universal analogue computation? | <p>What operations need to be performed in order to do any arbitrary <a href="http://en.wikipedia.org/wiki/Analog_computer">analogue computation</a>? Would addition, subtraction, multiplication and division be sufficient?</p>

<p>Also, does anyone know exactly what problems are tractable using analogue computat... | computability computation models turing completeness | 1 | What is required for universal analogue computation? -- (computability computation models turing completeness)
<p>What operations need to be performed in order to do any arbitrary <a href="http://en.wikipedia.org/wiki/Analog_computer">analogue computation</a>? Would addition, subtraction, multiplication and division be... | habedi/stack-exchange-dataset |
1,296 | Solve a recurrence using the master theorem | <p>This is the recursive formula for which I'm trying to find an asymptotic closed form by the <a href="http://en.wikipedia.org/wiki/Master_theorem" rel="nofollow">master theorem</a>:
$$T(n)=9T(n/27)+(n \cdot \lg(n))^{1/2}$$</p>

<p>I started with $a=9,b=27$ and $f(n)=(n\cdot \lg n)^{1/2}$ for using the ma... | algorithm analysis asymptotics recurrence relation master theorem | 1 | Solve a recurrence using the master theorem -- (algorithm analysis asymptotics recurrence relation master theorem)
<p>This is the recursive formula for which I'm trying to find an asymptotic closed form by the <a href="http://en.wikipedia.org/wiki/Master_theorem" rel="nofollow">master theorem</a>:
$$T(n)=9T(n/27)+(... | habedi/stack-exchange-dataset |
1,299 | NP-completeness of a spanning tree problem | <p>I was reviewing some NP-complete problems on this site, and I meet one interesting problem from </p>

<p><a href="https://cs.stackexchange.com/questions/808/np-completeness-proof-of-a-spanning-tree-problem">NP completeness proof of a spanning tree problem</a></p>

<p>In this problem, I am interested ... | complexity theory np complete graphs spanning trees | 1 | NP-completeness of a spanning tree problem -- (complexity theory np complete graphs spanning trees)
<p>I was reviewing some NP-complete problems on this site, and I meet one interesting problem from </p>

<p><a href="https://cs.stackexchange.com/questions/808/np-completeness-proof-of-a-spanning-tree-problem">NP... | habedi/stack-exchange-dataset |
1,301 | Find minimum number 1's so the matrix consist of 1 connected region of 1's | <p>Let $M$ be a $(0, 1)$ matrix. We say two entries are neighbors if they are adjacent horizontal or vertically, and both entries are $1$'s. One wants to find minimum number of $1$'s to add, so every $1$ can reach another one through a sequence of neighbors. </p>

<p>Example:</p>

<pre><code>100
000... | algorithms graphs matrices | 1 | Find minimum number 1's so the matrix consist of 1 connected region of 1's -- (algorithms graphs matrices)
<p>Let $M$ be a $(0, 1)$ matrix. We say two entries are neighbors if they are adjacent horizontal or vertically, and both entries are $1$'s. One wants to find minimum number of $1$'s to add, so every $1$ can reach... | habedi/stack-exchange-dataset |
1,319 | Solving problems related to Marginal Contribution Nets | <p>So, I encoutered this problem in examination:</p>

<blockquote>
 <p>Consider the following marginal contribution net:</p>
 
 <p>$\{a \wedge b\} \to 5$</p>
 
 <p>$\{b\} \to 2$</p>
 
 <p>$\{c\} \to 4$</p>
 
 <p>$\{b \wedge \neg c\} \to −2$</p>
 
 <p>Let $v... | artificial intelligence | 1 | Solving problems related to Marginal Contribution Nets -- (artificial intelligence)
<p>So, I encoutered this problem in examination:</p>

<blockquote>
 <p>Consider the following marginal contribution net:</p>
 
 <p>$\{a \wedge b\} \to 5$</p>
 
 <p>$\{b\} \to 2$</p>
 
 <p>$\{c\... | habedi/stack-exchange-dataset |
1,326 | How to prove regular languages are closed under left quotient? | <p>$L$ is a regular language over the alphabet $\Sigma = \{a,b\}$. The left quotient of $L$ regarding $w \in \Sigma^*$ is the language 
$$w^{-1} L := \{v \mid wv \in L\}$$</p>

<p>How can I prove that $w^{-1}L$ is regular?</p>
 | formal languages regular languages closure properties | 1 | How to prove regular languages are closed under left quotient? -- (formal languages regular languages closure properties)
<p>$L$ is a regular language over the alphabet $\Sigma = \{a,b\}$. The left quotient of $L$ regarding $w \in \Sigma^*$ is the language 
$$w^{-1} L := \{v \mid wv \in L\}$$</p>

<p>How ca... | habedi/stack-exchange-dataset |
1,329 | Shortest Path on an Undirected Graph? | <p>So I thought this (though somewhat basic) question belonged here:</p>

<p>Say I have a graph of size 100 nodes arrayed in a 10x10 pattern (think chessboard). The graph is undirected, and unweighted. Moving through the graph involves moving three spaces forward and one space to either right or left (similar t... | algorithms graphs search algorithms shortest path | 1 | Shortest Path on an Undirected Graph? -- (algorithms graphs search algorithms shortest path)
<p>So I thought this (though somewhat basic) question belonged here:</p>

<p>Say I have a graph of size 100 nodes arrayed in a 10x10 pattern (think chessboard). The graph is undirected, and unweighted. Moving through th... | habedi/stack-exchange-dataset |
1,331 | How to prove a language is regular? | <p>There are many methods to prove that <a href="https://cs.stackexchange.com/q/1031/157">a language is not regular</a>, but what do I need to do to prove that some language <em>is</em> regular?</p>

<p>For instance, if I am given that $L$ is regular, 
how can I prove that the following $L'$ is regular, too... | formal languages regular languages automata proof techniques reference question | 1 | How to prove a language is regular? -- (formal languages regular languages automata proof techniques reference question)
<p>There are many methods to prove that <a href="https://cs.stackexchange.com/q/1031/157">a language is not regular</a>, but what do I need to do to prove that some language <em>is</em> regular?</p>&... | habedi/stack-exchange-dataset |
1,332 | Modified Djikstra's algorithm | <p>So, I'm trying to conceptualize something:</p>

<p>Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats:</p>

<ol>
<li><p>movements on the graph are regulated by a circular cycle of length 48, in such a manner t... | algorithms graphs shortest path | 1 | Modified Djikstra's algorithm -- (algorithms graphs shortest path)
<p>So, I'm trying to conceptualize something:</p>

<p>Say we have a weighed graph of size N. A and B are nodes on the graph. You want to find the shortest path from A to B, given a few caveats:</p>

<ol>
<li><p>movements on the graph... | habedi/stack-exchange-dataset |
1,334 | Randomized Selection | <p>The randomized selection algorithm is the following:</p>

<p>Input: An array $A$ of $n$ (distinct, for simplicity) numbers and a number $k\in [n]$</p>

<p>Output: The the "rank $k$ element" of $A$ (i.e., the one in position $k$ if $A$ was sorted)</p>

<p>Method:</p>

<ul>
<li>If t... | algorithms algorithm analysis probability theory randomized algorithms | 1 | Randomized Selection -- (algorithms algorithm analysis probability theory randomized algorithms)
<p>The randomized selection algorithm is the following:</p>

<p>Input: An array $A$ of $n$ (distinct, for simplicity) numbers and a number $k\in [n]$</p>

<p>Output: The the "rank $k$ element" of $A$ (i.e., ... | habedi/stack-exchange-dataset |
1,335 | What is a good reference to learn about state transition systems? | <p>I am studying different approaches for the definition of computation with continuous dynamical systems. I have been trying to find a nice introduction to the theory of <a href="http://en.wikipedia.org/wiki/State_transition_system">"State transition systems"</a> but failed to do so.</p>

<p>Does anybody know ... | computability automata reference request computation models | 1 | What is a good reference to learn about state transition systems? -- (computability automata reference request computation models)
<p>I am studying different approaches for the definition of computation with continuous dynamical systems. I have been trying to find a nice introduction to the theory of <a href="http://en... | habedi/stack-exchange-dataset |
1,336 | Extending the implementation of a Queue using a circular array | <p>I'm doing some exam (Java-based algorithmics) revision and have been given the question:</p>

<blockquote>
 <p>Describe how you might extend your implementation [of a queue using a circular array] to support the expansion of the Queue to allow it to store more data items.</p>
</blockquote>

... | algorithms data structures | 1 | Extending the implementation of a Queue using a circular array -- (algorithms data structures)
<p>I'm doing some exam (Java-based algorithmics) revision and have been given the question:</p>

<blockquote>
 <p>Describe how you might extend your implementation [of a queue using a circular array] to support t... | habedi/stack-exchange-dataset |
1,339 | $\log^*(n)$ runtime analysis | <p>So I know that $\log^*$ means iterated logarithm, so $\log^*(3)$ = $(\log\log\log\log...)$ until $n \leq 1$.</p>

<p>I'm trying to solve the following:</p>

<p>is </p>

<blockquote>
 <p>$\log^*(2^{2^n})$</p>
</blockquote>

<p>little $o$, little $\omega$, or $\Theta$ of</p>&#x... | asymptotics landau notation mathematical analysis | 1 | $\log^*(n)$ runtime analysis -- (asymptotics landau notation mathematical analysis)
<p>So I know that $\log^*$ means iterated logarithm, so $\log^*(3)$ = $(\log\log\log\log...)$ until $n \leq 1$.</p>

<p>I'm trying to solve the following:</p>

<p>is </p>

<blockquote>
 <p>$\log^*(2^{2^n})$<... | habedi/stack-exchange-dataset |
1,346 | Sharp concentration for selection via random partitioning? | <p>The usual simple algorithm for finding the median element in an array $A$ of $n$ numbers is:</p>

<ul>
<li>Sample $n^{3/4}$ elements from $A$ with replacement into $B$</li>
<li>Sort $B$ and find the rank $|B|\pm \sqrt{n}$ elements $l$ and $r$ of $B$</li>
<li>Check that $l$ and $r$ are on opposite... | algorithms algorithm analysis randomized algorithms | 1 | Sharp concentration for selection via random partitioning? -- (algorithms algorithm analysis randomized algorithms)
<p>The usual simple algorithm for finding the median element in an array $A$ of $n$ numbers is:</p>

<ul>
<li>Sample $n^{3/4}$ elements from $A$ with replacement into $B$</li>
<li>Sort $B$... | habedi/stack-exchange-dataset |
1,347 | Complexity of 3SAT variants | <p>This question is motivated by my <a href="https://cs.stackexchange.com/a/1328/96">answer</a> to another question in which I stated the fact that both Betweeness and Non-Betweeness problems are $NP$-complete. In the former problem there is a total order such that the betweeness constraint of each triple is enforced w... | complexity theory satisfiability | 1 | Complexity of 3SAT variants -- (complexity theory satisfiability)
<p>This question is motivated by my <a href="https://cs.stackexchange.com/a/1328/96">answer</a> to another question in which I stated the fact that both Betweeness and Non-Betweeness problems are $NP$-complete. In the former problem there is a total orde... | habedi/stack-exchange-dataset |
1,353 | Optimizing a strictly monotone function | <p>I am looking for algorithms to optimize a strictly monotonic function $f$ such that $f(x) < y$ </p>

<p>$f : [a,b] \longrightarrow [c,d]
\qquad \text{where } [a,b] \subset {\mathbb N}, [c,d] \subset {\mathbb N}$<br>
such that $\arg\max{_x} f(x) < y$</p>

<p>My first idea was to us... | algorithms optimization | 1 | Optimizing a strictly monotone function -- (algorithms optimization)
<p>I am looking for algorithms to optimize a strictly monotonic function $f$ such that $f(x) < y$ </p>

<p>$f : [a,b] \longrightarrow [c,d]
\qquad \text{where } [a,b] \subset {\mathbb N}, [c,d] \subset {\mathbb N}$<br>
such th... | habedi/stack-exchange-dataset |
1,354 | Quicksort vs. insertion sort on linked list: performance | <p>I have written a program to sort Linked Lists and I noticed that my insertion sort works much better than my quicksort algorithm. 
Does anyone have any idea why this is?
Insertion sort has a complexity of $\Theta(n^2)$ and quicksort $O(n\log n)$ so therefore quicksort should be faster. I tried for random inp... | algorithms algorithm analysis sorting lists | 1 | Quicksort vs. insertion sort on linked list: performance -- (algorithms algorithm analysis sorting lists)
<p>I have written a program to sort Linked Lists and I noticed that my insertion sort works much better than my quicksort algorithm. 
Does anyone have any idea why this is?
Insertion sort has a complexity o... | habedi/stack-exchange-dataset |
1,367 | Quicksort explained to kids | <p>Last year, I was reading a fantastic <a href="http://arxiv.org/abs/quant-ph/0510032">paper on “Quantum Mechanics for Kindergarden”</a>. It was not easy paper.</p>

<p>Now, I wonder how to explain quicksort in the simplest words possible. How can I prove (or at least handwave) that the average complexity is $... | algorithms education algorithm analysis didactics sorting | 1 | Quicksort explained to kids -- (algorithms education algorithm analysis didactics sorting)
<p>Last year, I was reading a fantastic <a href="http://arxiv.org/abs/quant-ph/0510032">paper on “Quantum Mechanics for Kindergarden”</a>. It was not easy paper.</p>

<p>Now, I wonder how to explain quicksort in the simpl... | habedi/stack-exchange-dataset |
1,370 | What is co-something? | <p>What does the notation <code>co-</code> mean when prefixing <code>co-NP</code>, <code>co-RE</code> (recursively enumerable), or <code>co-CE</code> (computably enumerable) ?</p>
 | complexity theory computability terminology | 1 | What is co-something? -- (complexity theory computability terminology)
<p>What does the notation <code>co-</code> mean when prefixing <code>co-NP</code>, <code>co-RE</code> (recursively enumerable), or <code>co-CE</code> (computably enumerable) ?</p>
 | habedi/stack-exchange-dataset |
1,377 | Lower bound for finding kth smallest element using adversary arguments | <p>In many texts a lower bound for finding $k$th smallest element is derived making use of arguments using medians. How can I find one using an adversary argument?</p>

<p><a href="http://en.wikipedia.org/wiki/Selection_algorithm">Wikipedia</a> says that tournament algorithm runs in $O(n+k\log n)$, and $n - k +... | algorithms algorithm analysis | 1 | Lower bound for finding kth smallest element using adversary arguments -- (algorithms algorithm analysis)
<p>In many texts a lower bound for finding $k$th smallest element is derived making use of arguments using medians. How can I find one using an adversary argument?</p>

<p><a href="http://en.wikipedia.org/w... | habedi/stack-exchange-dataset |
1,392 | Algorithm to chase a moving target | <p>Suppose that we have a black-box $f$ which we can query and reset. When we reset $f$, the state $f_S$ of $f$ is set to an element chosen uniformly at random from the set $$\{0, 1, ..., n - 1\}$$ where $n$ is fixed and known for given $f$. To query $f$, an element $x$ (the guess) from $$\{0, 1, ..., n - 1\}$$ is prov... | algorithms probability theory randomized algorithms | 1 | Algorithm to chase a moving target -- (algorithms probability theory randomized algorithms)
<p>Suppose that we have a black-box $f$ which we can query and reset. When we reset $f$, the state $f_S$ of $f$ is set to an element chosen uniformly at random from the set $$\{0, 1, ..., n - 1\}$$ where $n$ is fixed and known f... | habedi/stack-exchange-dataset |
1,393 | Rectangle Coverage by Sweep Line | <p>I am given an exercise unfortunately I didn't succeed by myself.</p>

<blockquote>
 <p>There is a set of rectangles $R_{1}..R_{n}$ and a rectangle $R_{0}$. Using plane sweeping algorithm determine if $R_{0}$ is completely covered by the set of $R_{1}..R_{n}$.</p>
</blockquote>

<p>For more d... | algorithms computational geometry | 1 | Rectangle Coverage by Sweep Line -- (algorithms computational geometry)
<p>I am given an exercise unfortunately I didn't succeed by myself.</p>

<blockquote>
 <p>There is a set of rectangles $R_{1}..R_{n}$ and a rectangle $R_{0}$. Using plane sweeping algorithm determine if $R_{0}$ is completely covered by... | habedi/stack-exchange-dataset |
1,394 | How to represent the interests of a Facebook user | <p>I'm trying to figure out a way I could represent a Facebook user as a vector. I decided to go with stacking the different attributes/parameters of the user into one big vector (i.e. age is a vector of size 100, where 100 is the maximum age you can have, if you are lets say 50, the first 50 values of the vector would... | machine learning modelling social networks knowledge representation | 1 | How to represent the interests of a Facebook user -- (machine learning modelling social networks knowledge representation)
<p>I'm trying to figure out a way I could represent a Facebook user as a vector. I decided to go with stacking the different attributes/parameters of the user into one big vector (i.e. age is a vec... | habedi/stack-exchange-dataset |
1,399 | Distribute objects in a cube so that they have maximum distance between each other | <p>I'm trying to use a color camera to track multiple objects in space. Each object will have a different color and in order to be able to distinguish well between each objects I'm trying to make sure that each color assigned to an object is as different from any color on any other object as possible.</p>

<p>I... | algorithms optimization computational geometry | 1 | Distribute objects in a cube so that they have maximum distance between each other -- (algorithms optimization computational geometry)
<p>I'm trying to use a color camera to track multiple objects in space. Each object will have a different color and in order to be able to distinguish well between each objects I'm tryi... | habedi/stack-exchange-dataset |
1,407 | How to interpret "Windows - Virtual Memory minimum too low" from a CS student point of view? | <p>On my old 256MB RAM, pc I get this message. (I guess it is quite common)</p>

<blockquote>
 <p><strong>Windows - Virtual Memory minimum too low</strong><br>
 Your system is low on virtual memory. Windows is increasing the size of your virtual memory paging file. During this process, memory requests... | operating systems virtual memory paging | 1 | How to interpret "Windows - Virtual Memory minimum too low" from a CS student point of view? -- (operating systems virtual memory paging)
<p>On my old 256MB RAM, pc I get this message. (I guess it is quite common)</p>

<blockquote>
 <p><strong>Windows - Virtual Memory minimum too low</strong><br>
 You... | habedi/stack-exchange-dataset |
1,413 | Why are blocking artifacts serious when there is fast motion in MPEG? | <p>Why are blocking artifacts serious when there is fast motion in MPEG?</p>

<p>Here is the guess I made:</p>

<p>In MPEG, each block in an encoding frame is matched with a block in the reference frame.
If the difference of two blocks is small, only the difference is encoded using DCT. Is the reaso... | information theory data compression video | 1 | Why are blocking artifacts serious when there is fast motion in MPEG? -- (information theory data compression video)
<p>Why are blocking artifacts serious when there is fast motion in MPEG?</p>

<p>Here is the guess I made:</p>

<p>In MPEG, each block in an encoding frame is matched with a block in the ... | habedi/stack-exchange-dataset |
1,414 | Proving a specific language is regular | <p>In my computability class we were given a practice final to go over and I'm really struggling with one of the questions on it.</p>
<blockquote>
<p>Prove the following statement:</p>
<p>If <span class="math-container">$L_1$</span> is a regular language, then so is</p>
<p><span class="math-container">$... | formal languages regular languages | 1 | Proving a specific language is regular -- (formal languages regular languages)
<p>In my computability class we were given a practice final to go over and I'm really struggling with one of the questions on it.</p>
<blockquote>
<p>Prove the following statement:</p>
<p>If <span class="math-container">$L_1$</sp... | habedi/stack-exchange-dataset |
1,415 | P-Completeness and Parallel Computation | <p>I was recently reading about algorithms for checking bisimilarity and read that the problem is <a href="http://en.wikipedia.org/wiki/P-complete">P-complete</a>. Furthermore, a consequence of this is that this problem, or any P-complete problem, is unlikely to have an efficient parallel algorithms.</p>

<bloc... | complexity theory parallel computing | 1 | P-Completeness and Parallel Computation -- (complexity theory parallel computing)
<p>I was recently reading about algorithms for checking bisimilarity and read that the problem is <a href="http://en.wikipedia.org/wiki/P-complete">P-complete</a>. Furthermore, a consequence of this is that this problem, or any P-complete... | habedi/stack-exchange-dataset |
1,418 | When to use recursion? | <p>When are some (relatively) basic (think first year college level CS student) instances when one would use recursion instead of just a loop? </p>
 | algorithms recursion | 1 | When to use recursion? -- (algorithms recursion)
<p>When are some (relatively) basic (think first year college level CS student) instances when one would use recursion instead of just a loop? </p>
 | habedi/stack-exchange-dataset |
1,424 | Overflow safe summation | <p>Suppose I am given $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$ such that their sum $a_1 + a_2 + \dots + a_n = S$ also fits in a register of width $w$.</p>

<p>It seems to me that we can always permute the numbers to $b_1, b_2, \dots b_n$ such that each prefix su... | algorithms arrays integers numerical analysis | 1 | Overflow safe summation -- (algorithms arrays integers numerical analysis)
<p>Suppose I am given $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$ such that their sum $a_1 + a_2 + \dots + a_n = S$ also fits in a register of width $w$.</p>

<p>It seems to me that we can a... | habedi/stack-exchange-dataset |
1,426 | Detecting overflow in summation | <p>Suppose I am given an array of $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$. I want to compute the sum $S = a_1 + \ldots + a_n$ on a machine with 2's complement arithmetic, which performs additions modulo $2^w$ with wraparound semantics. That's easy — but the sum may ove... | algorithms arrays integers numerical analysis | 1 | Detecting overflow in summation -- (algorithms arrays integers numerical analysis)
<p>Suppose I am given an array of $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$. I want to compute the sum $S = a_1 + \ldots + a_n$ on a machine with 2's complement arithmetic, which performs ... | habedi/stack-exchange-dataset |
1,427 | Sub language is not Turing-recognizable, or could it be? | <p>Let A and B be languages with A ⊆ B, and B is Turing-recognizable. Can A be not Turing-recognizable? If so, is there any example?</p>
 | computability | 1 | Sub language is not Turing-recognizable, or could it be? -- (computability)
<p>Let A and B be languages with A ⊆ B, and B is Turing-recognizable. Can A be not Turing-recognizable? If so, is there any example?</p>
 | habedi/stack-exchange-dataset |
1,440 | What is the name of this logistic variant of TSP? | <p>I have a logistic problem that can be seen as a variant of $\text{TSP}$. It is so natural, I'm sure it has been studied in Operations research or something similar. Here's one way of looking at the problem.</p>

<p>I have $P$ warehouses on the Cartesian plane. There's a path from a warehouse to every other w... | algorithms optimization reference request approximation | 1 | What is the name of this logistic variant of TSP? -- (algorithms optimization reference request approximation)
<p>I have a logistic problem that can be seen as a variant of $\text{TSP}$. It is so natural, I'm sure it has been studied in Operations research or something similar. Here's one way of looking at the problem.... | habedi/stack-exchange-dataset |
1,444 | How many possible ways are there? | <p>Suppose I have the given data set of length 11 of scores:</p>

<pre><code>p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1]
</code></pre>

<p>I want to select scores 6, 5, 5, 4, 2, 2 from the data set. How many ways are there?</p>

<p>For the above example answer is: 6 ways</p>

<pre><code>{p[1... | combinatorics | 1 | How many possible ways are there? -- (combinatorics)
<p>Suppose I have the given data set of length 11 of scores:</p>

<pre><code>p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1]
</code></pre>

<p>I want to select scores 6, 5, 5, 4, 2, 2 from the data set. How many ways are there?</p>

<p>For the above e... | habedi/stack-exchange-dataset |
1,447 | What is most efficient for GCD? | <p>I know that Euclid’s algorithm is the best algorithm for getting the GCD (great common divisor) of a list of positive integers.
But in practice you can code this algorithm in various ways. (In my case, I decided to use Java, but C/C++ may be another option).</p>

<p>I need to use the most efficient code ... | algorithms recursion arithmetic | 1 | What is most efficient for GCD? -- (algorithms recursion arithmetic)
<p>I know that Euclid’s algorithm is the best algorithm for getting the GCD (great common divisor) of a list of positive integers.
But in practice you can code this algorithm in various ways. (In my case, I decided to use Java, but C/C++ may be an... | habedi/stack-exchange-dataset |
1,455 | How to use adversary arguments for selection and insertion sort? | <p>I was asked to find the adversary arguments necessary for finding the lower bounds for selection and insertion sort. I could not find a reference to it anywhere.</p>

<p>I have some doubts regarding this. I understand that adversary arguments are usually used for finding lower bounds for certain "problems" r... | algorithms algorithm analysis proof techniques lower bounds | 1 | How to use adversary arguments for selection and insertion sort? -- (algorithms algorithm analysis proof techniques lower bounds)
<p>I was asked to find the adversary arguments necessary for finding the lower bounds for selection and insertion sort. I could not find a reference to it anywhere.</p>

<p>I have so... | habedi/stack-exchange-dataset |
1,458 | Encoding the sequence 0110 and determining parity, data bit and value | <p>I've been struggling with several Hamming code/error detection questions because the logic behind it doesn't seem to make sense.</p>
<p>eg.1</p>
<p><img src="https://i.stack.imgur.com/v9F4w.png" alt="enter image description here" /></p>
<p>eg.2</p>
<p><img src="https://i.stack.imgur.com/tGxIZ.png" al... | coding theory | 1 | Encoding the sequence 0110 and determining parity, data bit and value -- (coding theory)
<p>I've been struggling with several Hamming code/error detection questions because the logic behind it doesn't seem to make sense.</p>
<p>eg.1</p>
<p><img src="https://i.stack.imgur.com/v9F4w.png" alt="enter image descript... | habedi/stack-exchange-dataset |
1,466 | Circle Intersection with Sweep Line Algorithm | <p>Unfortunately I am still not so strong in understanding <a href="http://en.wikipedia.org/wiki/Sweep_line_algorithm">Sweep Line Algorithm</a>. All papers and textbooks on the topic are already read, however understanding is still far away. Just in order to make it clearer I try to solve as many exercises as I can. Bu... | algorithms computational geometry | 1 | Circle Intersection with Sweep Line Algorithm -- (algorithms computational geometry)
<p>Unfortunately I am still not so strong in understanding <a href="http://en.wikipedia.org/wiki/Sweep_line_algorithm">Sweep Line Algorithm</a>. All papers and textbooks on the topic are already read, however understanding is still far... | habedi/stack-exchange-dataset |
1,467 | Words that have the same right- and left-associative product | <p>I have started to study non deterministic automata using the book of <a href="https://en.wikipedia.org/wiki/Introduction_to_Automata_Theory,_Languages,_and_Computation" rel="nofollow">Hopcroft and Ullman</a>. I'm stuck in a problem that I found very interesting:</p>

<blockquote>
 <p>Give a non determin... | formal languages automata regular languages finite automata nondeterminism | 1 | Words that have the same right- and left-associative product -- (formal languages automata regular languages finite automata nondeterminism)
<p>I have started to study non deterministic automata using the book of <a href="https://en.wikipedia.org/wiki/Introduction_to_Automata_Theory,_Languages,_and_Computation" rel="no... | habedi/stack-exchange-dataset |
1,469 | Null Characters and Splitting the String in the Pumping Lemma | <p>So I'm really struggling with the pumping lemma. I think most of my problems come from not understanding how you can and can't split the string in a pumping lemma question. Here is an example, take the problem prove that $L = \{w | w$ contains more $0$'s than $1$'s over the language $\{0,1\} \}$ is not regular via... | formal languages regular languages proof techniques pumping lemma | 1 | Null Characters and Splitting the String in the Pumping Lemma -- (formal languages regular languages proof techniques pumping lemma)
<p>So I'm really struggling with the pumping lemma. I think most of my problems come from not understanding how you can and can't split the string in a pumping lemma question. Here is a... | habedi/stack-exchange-dataset |
1,471 | Looking for a ranking algorithm that favors newer entries | <p>I'm working on a ranking system that will rank entries based on votes that have been cast over a period of time. I'm looking for an algorithm that will calculate a score which is kinda like an average, however I would like it to favor newer scores over older ones. I was thinking of something along the line of: </p... | algorithms data mining | 1 | Looking for a ranking algorithm that favors newer entries -- (algorithms data mining)
<p>I'm working on a ranking system that will rank entries based on votes that have been cast over a period of time. I'm looking for an algorithm that will calculate a score which is kinda like an average, however I would like it to f... | habedi/stack-exchange-dataset |
1,477 | Dealing with intractability: NP-complete problems | <p>Assume that I am a programmer and I have an NP-complete problem that I need to solve it. What methods are available to deal with NPC problems? Is there a survey or something similar on this topic?</p>
 | algorithms reference request np complete efficiency reference question | 1 | Dealing with intractability: NP-complete problems -- (algorithms reference request np complete efficiency reference question)
<p>Assume that I am a programmer and I have an NP-complete problem that I need to solve it. What methods are available to deal with NPC problems? Is there a survey or something similar on this t... | habedi/stack-exchange-dataset |
1,485 | Complexity of finding the largest $m$ numbers in an array of size $n$ | <p>What follows is my algorithm for doing this in what I believe to be $O(n)$ time, and my proof for that. My professor disagrees that it runs in $O(n)$ and instead thinks that it runs in $\Omega(n^2)$ time. Any comments regarding the proof itself, or the style (i.e. my ideas may be clear but the presentation not).</p>... | algorithms time complexity runtime analysis | 1 | Complexity of finding the largest $m$ numbers in an array of size $n$ -- (algorithms time complexity runtime analysis)
<p>What follows is my algorithm for doing this in what I believe to be $O(n)$ time, and my proof for that. My professor disagrees that it runs in $O(n)$ and instead thinks that it runs in $\Omega(n^2)$... | habedi/stack-exchange-dataset |
1,493 | Requirements for emulation | <p>What are the complete specifications that must be documented in order to ensure the correct execution of a particular program written in Java? For instance, if one were archiving a program for long-term preservation, and no testing or porting would be done.</p>

<p>I need to be able to compile and execute th... | operating systems computer architecture digital preservation | 1 | Requirements for emulation -- (operating systems computer architecture digital preservation)
<p>What are the complete specifications that must be documented in order to ensure the correct execution of a particular program written in Java? For instance, if one were archiving a program for long-term preservation, and no ... | habedi/stack-exchange-dataset |
1,494 | Find the longest path from root to leaf in a tree | <p>I have a <a href="https://www.iis.se/docs/DNS-bok-sid-14.jpg" rel="noreferrer">tree</a> (in the graph theory sense), such as the following example:</p>

<p><img src="https://i.stack.imgur.com/sK90D.jpg" alt="enter image description here"></p>

<p>This is a directed tree with one starting node (the ro... | algorithms graphs | 1 | Find the longest path from root to leaf in a tree -- (algorithms graphs)
<p>I have a <a href="https://www.iis.se/docs/DNS-bok-sid-14.jpg" rel="noreferrer">tree</a> (in the graph theory sense), such as the following example:</p>

<p><img src="https://i.stack.imgur.com/sK90D.jpg" alt="enter image description here... | habedi/stack-exchange-dataset |
1,495 | What is the most efficient way to compute factorials modulo a prime? | <p>Do you know any algorithm that calculates the factorial after modulus efficiently?</p>

<p>For example, I want to program:</p>

<pre><code>for(i=0; i<5; i++)
 sum += factorial(p-i) % p;
</code></pre>

<p>But, <code>p</code> is a big number (prime) for applying factorial directly $... | algorithms efficiency integers | 1 | What is the most efficient way to compute factorials modulo a prime? -- (algorithms efficiency integers)
<p>Do you know any algorithm that calculates the factorial after modulus efficiently?</p>

<p>For example, I want to program:</p>

<pre><code>for(i=0; i<5; i++)
 sum += factorial(p-i) % p;&#x... | habedi/stack-exchange-dataset |
1,507 | Runtime of the optimal greedy $2$-approximation algorithm for the $k$-clustering problem | <p>We are given a set 2-dimensional points $|P| = n$ and an integer $k$. We must find a collection of $k$ circles that enclose all the $n$ points such that the radius of the largest circle is as small as possible. In other words, we must find a set $C = \{ c_1,c_2,\ldots,c_k\}$ of $k$ center points such that the cost f... | algorithms computational geometry | 1 | Runtime of the optimal greedy $2$-approximation algorithm for the $k$-clustering problem -- (algorithms computational geometry)
<p>We are given a set 2-dimensional points $|P| = n$ and an integer $k$. We must find a collection of $k$ circles that enclose all the $n$ points such that the radius of the largest circle is ... | habedi/stack-exchange-dataset |
1,511 | "Dense" regular expressions generate $\Sigma^*$? | <p>Here's a conjecture for regular expressions:</p>

<blockquote>
 <p>For regular expression $R$, let the length $|R|$ be the number of symbols in it,
 ignoring parentheses and operators. E.g. $|0 \cup 1| = |(0 \cup 1)^*| = 2$</p>
 
 <p><strong>Conjecture:</strong> If $|R| > 1$ and $L(R)$... | formal languages regular languages regular expressions | 1 | "Dense" regular expressions generate $\Sigma^*$? -- (formal languages regular languages regular expressions)
<p>Here's a conjecture for regular expressions:</p>

<blockquote>
 <p>For regular expression $R$, let the length $|R|$ be the number of symbols in it,
 ignoring parentheses and operators. E.g. ... | habedi/stack-exchange-dataset |
1,514 | Is it possible to create a "Time Capsule" using encryption? | <p>I want to create a digital time capsule which will remain unreadable for some period of time and then become readable. I do not want to rely on any outside service to, for instance, keep the key secret and then reveal it at the required time. Is this possible? If not, is some kind of proof possible that it is not?</... | cryptography encryption digital preservation | 1 | Is it possible to create a "Time Capsule" using encryption? -- (cryptography encryption digital preservation)
<p>I want to create a digital time capsule which will remain unreadable for some period of time and then become readable. I do not want to rely on any outside service to, for instance, keep the key secret and t... | habedi/stack-exchange-dataset |
1,517 | If A is mapping reducible to B then the complement of A is mapping reducible to the complement of B | <p>I'm studying for my final in theory of computation, and I'm struggling with the proper way of answering whether this statement is true of false.</p>

<p>By the <a href="https://en.wikipedia.org/wiki/Mapping_reducibility" rel="noreferrer">definition</a> of $\leq_m$ we can construct the following statement, </... | complexity theory computability reductions | 1 | If A is mapping reducible to B then the complement of A is mapping reducible to the complement of B -- (complexity theory computability reductions)
<p>I'm studying for my final in theory of computation, and I'm struggling with the proper way of answering whether this statement is true of false.</p>

<p>By the <... | habedi/stack-exchange-dataset |
1,525 | Chomsky normal form and regular languages | <p>I'd love your help with the following question:</p>

<blockquote>
 <p>Let $G$ be context free grammar in the <strong>Chomksy normal form</strong> with $k$
 variables.</p>
 
 <p>Is the language $B = \{ w \in L(G) : |w| >2^k \}$ regular ?</p>
</blockquote>

<p>What is it abou... | formal languages regular languages context free formal grammars | 1 | Chomsky normal form and regular languages -- (formal languages regular languages context free formal grammars)
<p>I'd love your help with the following question:</p>

<blockquote>
 <p>Let $G$ be context free grammar in the <strong>Chomksy normal form</strong> with $k$
 variables.</p>
 
 <p>I... | habedi/stack-exchange-dataset |
1,531 | Is Logical Min-Cut NP-Complete? | <h3>Logical Min Cut (LMC) problem definition</h3>

<p>Suppose that $G = (V, E)$ is an unweighted digraph, $s$ and $t$ are two vertices of $V$, and $t$ is reachable from $s$. The LMC Problem studies how we can make $t$ unreachable from $s$ by the removal of some edges of $G$ following the following constraints:<... | complexity theory graphs np complete | 1 | Is Logical Min-Cut NP-Complete? -- (complexity theory graphs np complete)
<h3>Logical Min Cut (LMC) problem definition</h3>

<p>Suppose that $G = (V, E)$ is an unweighted digraph, $s$ and $t$ are two vertices of $V$, and $t$ is reachable from $s$. The LMC Problem studies how we can make $t$ unreachable from $s$... | habedi/stack-exchange-dataset |
1,536 | Closure against the operator $A(L)=\{ww^Rw \mid w \in L \wedge |w| \lt 2007\}$ | <p>I would like your help with the following question:</p>

<blockquote>
 <p>Let $L$ be a language, and operator $A(L)=\{\,ww^Rw \mid w \in L\ \wedge\ |w| \lt 2007\,\}$ where $x^R$ is the reversed string of $x$. Which of the
 following statements are correct?</p>
 
 <ol>
 <li>If $L$ is... | formal languages regular languages context free closure properties | 1 | Closure against the operator $A(L)=\{ww^Rw \mid w \in L \wedge |w| \lt 2007\}$ -- (formal languages regular languages context free closure properties)
<p>I would like your help with the following question:</p>

<blockquote>
 <p>Let $L$ be a language, and operator $A(L)=\{\,ww^Rw \mid w \in L\ \wedge\ |w| \... | habedi/stack-exchange-dataset |
1,542 | Approximation algorithm for TSP variant, fixed start and end anywhere but starting point + multiple visits at each vertex ALLOWED | <p>NOTE: Due to the fact that the trip does not end at the same place it started and also the fact that every point can be visited more than once as long as I still visit all of them, this is not really a TSP variant, but I put it due to lack of a better definition of the problem.</p>

<p>This problem was origi... | algorithms complexity theory graphs approximation | 1 | Approximation algorithm for TSP variant, fixed start and end anywhere but starting point + multiple visits at each vertex ALLOWED -- (algorithms complexity theory graphs approximation)
<p>NOTE: Due to the fact that the trip does not end at the same place it started and also the fact that every point can be visited more... | habedi/stack-exchange-dataset |
1,547 | Closure against right quotient with a fixed language | <p>I'd really love your help with the following:</p>

<p>For <em>any</em> fixed $L_2$ I need to decide whether there is closure under the following operators:</p>

<ol>
<li><p>$A_r(L)=\{x \mid \exists y \in L_2 : xy \in L\}$</p></li>
<li><p>$A_l(L)=\{x \mid \exists y \in L : xy \in L_2\}$.</p>... | formal languages regular languages closure properties | 1 | Closure against right quotient with a fixed language -- (formal languages regular languages closure properties)
<p>I'd really love your help with the following:</p>

<p>For <em>any</em> fixed $L_2$ I need to decide whether there is closure under the following operators:</p>

<ol>
<li><p>$A_r(L)=\{x ... | habedi/stack-exchange-dataset |
1,556 | Is $A=\{ w \in \{a,b,c\}^* \mid \#_a(w)+ 2\#_b(w) = 3\#_c(w)\}$ a CFG? | <p>I wonder whether the following language is a context free language:
$$A = \{w \in \{a,b,c\}^* \mid \#_a(w) + 2\#_b(w) = 3\#c(w)\}$$
where $\#_x(w)$ is the number of occurrences of $x$ in $w$.
I can't find any word that would be useful to refute by the pumping lemma, on the other hand I haven't been able ... | formal languages context free | 1 | Is $A=\{ w \in \{a,b,c\}^* \mid \#_a(w)+ 2\#_b(w) = 3\#_c(w)\}$ a CFG? -- (formal languages context free)
<p>I wonder whether the following language is a context free language:
$$A = \{w \in \{a,b,c\}^* \mid \#_a(w) + 2\#_b(w) = 3\#c(w)\}$$
where $\#_x(w)$ is the number of occurrences of $x$ in $w$.
I can't... | habedi/stack-exchange-dataset |
1,560 | Can a program language be malleable enough to allow programs to extend language semantics | <p>With reference to features in languages like ruby (and javascript), which allow a programmer to extend/override classes any time after defining it (including classes like String), is it theoretically feasible to design a language which can allow programs to later on extend its semantics.</p>

<p>ex: Ruby doe... | programming languages semantics | 1 | Can a program language be malleable enough to allow programs to extend language semantics -- (programming languages semantics)
<p>With reference to features in languages like ruby (and javascript), which allow a programmer to extend/override classes any time after defining it (including classes like String), is it theo... | habedi/stack-exchange-dataset |
1,562 | Turing reducibility implies mapping reducibility | <p>The question is whether the following statement is true or false:</p>

<p>$A \leq_T B \implies A \leq_m B$</p>

<p>I know that if $A \leq_T B$ then there is an oracle which can decide A relative to B. I know that this is not enough to say that there is a computable function from A to B that can satis... | computability reductions turing machines | 1 | Turing reducibility implies mapping reducibility -- (computability reductions turing machines)
<p>The question is whether the following statement is true or false:</p>

<p>$A \leq_T B \implies A \leq_m B$</p>

<p>I know that if $A \leq_T B$ then there is an oracle which can decide A relative to B. I kno... | habedi/stack-exchange-dataset |
1,567 | Running time - Linked Lists Polynomial | <p>I have developed two algorithms and now they are asking me to find their running time.
The problem is to develop a singly linked list version for manipulating polynomials. The two main operations are <em>addition</em> and <em>multiplication</em>.</p>

<p>In general for lists the running for these two ope... | algorithms algorithm analysis runtime analysis | 1 | Running time - Linked Lists Polynomial -- (algorithms algorithm analysis runtime analysis)
<p>I have developed two algorithms and now they are asking me to find their running time.
The problem is to develop a singly linked list version for manipulating polynomials. The two main operations are <em>addition</em> and ... | habedi/stack-exchange-dataset |
1,577 | How do I test if a polygon is monotone with respect to a line? | <p>It's well known that <a href="http://en.wikipedia.org/wiki/Monotone_polygon" rel="nofollow noreferrer">monotone polygons</a> play a crucial role in <a href="http://en.wikipedia.org/wiki/Polygon_triangulation" rel="nofollow noreferrer">polygon triangulation</a>. </p>

<blockquote>
 <p><strong>Definition:... | algorithms computational geometry | 1 | How do I test if a polygon is monotone with respect to a line? -- (algorithms computational geometry)
<p>It's well known that <a href="http://en.wikipedia.org/wiki/Monotone_polygon" rel="nofollow noreferrer">monotone polygons</a> play a crucial role in <a href="http://en.wikipedia.org/wiki/Polygon_triangulation" rel="n... | habedi/stack-exchange-dataset |
1,580 | Distributed vs parallel computing | <p>I often hear people talking about <em>parallel</em> computing and <em>distributed</em> computing, but I'm under the impression that there is no clear boundary between the 2, and people tend to confuse that pretty easily, while I believe it is very different:</p>

<ul>
<li><em>Parallel</em> computing is m... | terminology distributed systems parallel computing | 1 | Distributed vs parallel computing -- (terminology distributed systems parallel computing)
<p>I often hear people talking about <em>parallel</em> computing and <em>distributed</em> computing, but I'm under the impression that there is no clear boundary between the 2, and people tend to confuse that pretty easily, while ... | habedi/stack-exchange-dataset |
1,591 | Finding the maximum bandwidth along a single path in a network | <p>I am trying to search for an algorithm that can tell me which node has the highest download (or upload) capacity given a weighted directed graph, where weights correspond to individual link bandwidths. I have looked at the maximal flow problem and at the Edmond-Karp algorithm. My questions are the following: </p>&#x... | algorithms graphs network flow | 1 | Finding the maximum bandwidth along a single path in a network -- (algorithms graphs network flow)
<p>I am trying to search for an algorithm that can tell me which node has the highest download (or upload) capacity given a weighted directed graph, where weights correspond to individual link bandwidths. I have looked at... | habedi/stack-exchange-dataset |
1,592 | Why does $A(L)= \{ w_1w_2: |w_1|=|w_2|$ and $w_1, w_2^R \in L \}$ generate a context free language for regular $L$? | <p>How can I prove that the language that the operator $A$ defines for regular language $L$ is a context free language.</p>

<p>$A(L)= \{ w_1w_2: |w_1|=|w_2|$ and $w_1, w_2^R \in L \}$, where $x^R$ is the reversed form of $x$. </p>

<p>I understand that since $L$ is regular so does $L^R$.also on my way ... | formal languages regular languages context free formal grammars | 1 | Why does $A(L)= \{ w_1w_2: |w_1|=|w_2|$ and $w_1, w_2^R \in L \}$ generate a context free language for regular $L$? -- (formal languages regular languages context free formal grammars)
<p>How can I prove that the language that the operator $A$ defines for regular language $L$ is a context free language.</p>

<p... | habedi/stack-exchange-dataset |
1,597 | Maximise sum of "non-overlapping" numbers in square array - help with proof | <p>A <a href="https://stackoverflow.com/questions/10378738/maximise-sum-of-non-overlapping-numbers-from-matrix">question was posted on Stack Overflow</a> asking for an algorithm to solve this problem:</p>

<blockquote>
 <p>I have a matrix (call it A) which is nxn. I wish to select a subset
 (call it B... | algorithms dynamic programming check my algorithm | 1 | Maximise sum of "non-overlapping" numbers in square array - help with proof -- (algorithms dynamic programming check my algorithm)
<p>A <a href="https://stackoverflow.com/questions/10378738/maximise-sum-of-non-overlapping-numbers-from-matrix">question was posted on Stack Overflow</a> asking for an algorithm to solve th... | habedi/stack-exchange-dataset |
1,603 | Mapping Reductions to Complement of A$_{TM}$ | <p>I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$</p>

<p>where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accepts string } w\}$</p>

<p>which is great for proving undecidability. But say I want t... | computability proof techniques reductions | 1 | Mapping Reductions to Complement of A$_{TM}$ -- (computability proof techniques reductions)
<p>I have a general question about mapping reductions. I have seen several examples of reducing functions to $A_{TM}$</p>

<p>where $A_{TM} = \{\langle M, w \rangle : \text{ For } M \text{ is a turing machine which accep... | habedi/stack-exchange-dataset |
1,606 | Restricted version of the Clique problem? | <p>Consider the following version of the Clique problem where the input is of size $n$ and we're asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any other representation and cannot use any other representation to compute its answer, other than $\log(... | complexity theory time complexity | 1 | Restricted version of the Clique problem? -- (complexity theory time complexity)
<p>Consider the following version of the Clique problem where the input is of size $n$ and we're asked to find a clique of size $k$. The restriction is that the decision procedure cannot change the input graph into any other representation... | habedi/stack-exchange-dataset |
1,609 | Example of Soundness & Completeness of Inference | <p>Is the following example correct about whether an <em>inference</em> algorithm is <em>sound</em> and <em>complete</em>? </p>

<p>Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles.</p>

<ul>
<li><p><em>sound</em> - Only needles a, ... | logic | 1 | Example of Soundness & Completeness of Inference -- (logic)
<p>Is the following example correct about whether an <em>inference</em> algorithm is <em>sound</em> and <em>complete</em>? </p>

<p>Suppose we have needles a, b, c in a haystack, and have also an inference algorithm that is designed to find needles.</p... | habedi/stack-exchange-dataset |
1,616 | Irregularity of $\{a^ib^jc^k \mid \text{if } i=1 \text{ then } j=k \}$ | <p>I read <a href="https://cs.stackexchange.com/questions/1027/using-pumping-lemma-to-prove-language-is-not-regular">on the site</a> on how to use the pumping lemma but still I don't what is wrong with way I'm using it for proving that the following language is not a regular language:</p>

<p>$L = \{a^ib^jc^k \... | formal languages regular languages pumping lemma | 1 | Irregularity of $\{a^ib^jc^k \mid \text{if } i=1 \text{ then } j=k \}$ -- (formal languages regular languages pumping lemma)
<p>I read <a href="https://cs.stackexchange.com/questions/1027/using-pumping-lemma-to-prove-language-is-not-regular">on the site</a> on how to use the pumping lemma but still I don't what is wron... | habedi/stack-exchange-dataset |
1,632 | All soldiers should shoot at the same time | <p>When I was a student, I saw a problem in a digital systems/logic design textbook, about N soldiers standing in a row, and want to shoot at the same time. A more difficult version of the problem was that the soldiers stand in a general network instead of a row. I am sure this is a classical problem, but I cannot reme... | algorithms distributed systems clocks | 1 | All soldiers should shoot at the same time -- (algorithms distributed systems clocks)
<p>When I was a student, I saw a problem in a digital systems/logic design textbook, about N soldiers standing in a row, and want to shoot at the same time. A more difficult version of the problem was that the soldiers stand in a gene... | habedi/stack-exchange-dataset |
1,636 | Reason to learn propositional & predicate logic | <p>I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. </p>

<p>But is there any tasks/jobs that explicitly require the knowledge about these, other than the tasks that require any kind of knowledge r... | logic | 1 | Reason to learn propositional & predicate logic -- (logic)
<p>I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. </p>

<p>But is there any tasks/jobs that explicitly require the knowledge about these... | habedi/stack-exchange-dataset |
1,643 | How can we assume that basic operations on numbers take constant time? | <p>Normally in algorithms we do not care about comparison, addition, or subtraction of numbers -- we assume they run in time $O(1)$. For example, we assume this when we say that comparison-based sorting is $O(n\log n)$, but when numbers are too big to fit into registers, we normally represent them as arrays so basic o... | algorithms complexity theory algorithm analysis time complexity reference question | 1 | How can we assume that basic operations on numbers take constant time? -- (algorithms complexity theory algorithm analysis time complexity reference question)
<p>Normally in algorithms we do not care about comparison, addition, or subtraction of numbers -- we assume they run in time $O(1)$. For example, we assume this... | habedi/stack-exchange-dataset |
1,647 | How to scale down parallel complexity results to constantly many cores? | <p>I have had problems accepting the complexity theoretic view of "efficiently solved by parallel algorithm" which is given by the class <a href="https://en.wikipedia.org/wiki/NC_%28complexity%29">NC</a>:</p>

<blockquote>
 <p>NC is the class of problems that can be solved by a parallel algorithm in time $... | complexity theory reference request parallel computing | 1 | How to scale down parallel complexity results to constantly many cores? -- (complexity theory reference request parallel computing)
<p>I have had problems accepting the complexity theoretic view of "efficiently solved by parallel algorithm" which is given by the class <a href="https://en.wikipedia.org/wiki/NC_%28comple... | habedi/stack-exchange-dataset |
1,652 | The operator $A(L)= \{w \mid ww \in L\}$ | <p>Consider the operator $A(L)= \{w \mid ww \in L\}$. Apparently, the class of context free languages is not closed against $A$. Still, after a lot of thinking, I can't find any CFL for which $A(L)$ wouldn't be CFL. </p>

<p>Does anyone have an idea for such a language?</p>
 | formal languages context free closure properties | 1 | The operator $A(L)= \{w \mid ww \in L\}$ -- (formal languages context free closure properties)
<p>Consider the operator $A(L)= \{w \mid ww \in L\}$. Apparently, the class of context free languages is not closed against $A$. Still, after a lot of thinking, I can't find any CFL for which $A(L)$ wouldn't be CFL. </p>
... | habedi/stack-exchange-dataset |
1,662 | Why are lambda-abstractions the only terms that are values in the untyped lambda calculus? | <p>I am confused about the following claim: "The only values in the untyped lambda calculus are lambda-abstractions".</p>

<p>Why are the other terms not values? What does it mean for a lambda-abstraction to be a value? The first thing that came to my mind was that maybe lambda-abstractions are the only possibl... | logic lambda calculus | 1 | Why are lambda-abstractions the only terms that are values in the untyped lambda calculus? -- (logic lambda calculus)
<p>I am confused about the following claim: "The only values in the untyped lambda calculus are lambda-abstractions".</p>

<p>Why are the other terms not values? What does it mean for a lambda-a... | habedi/stack-exchange-dataset |
1,665 | Frame Pointers in Assembler | <p>I am currently learning assembly programming on wombat 4, I am looking at Frame pointers. I understand exactly what a frame pointer is: it is a register and are used to access parameters on a stack. But i'm confused on how they affect the program counter and why they are preferred over normal registers. </p>
&#x... | computer architecture compilers | 1 | Frame Pointers in Assembler -- (computer architecture compilers)
<p>I am currently learning assembly programming on wombat 4, I am looking at Frame pointers. I understand exactly what a frame pointer is: it is a register and are used to access parameters on a stack. But i'm confused on how they affect the program count... | habedi/stack-exchange-dataset |
1,669 | Connection between KMP prefix function and string matching automaton | <p>Let $A_P = (Q,\Sigma,\delta,0,\{m\})$ the <em>string matching automaton</em> for pattern $P \in \Sigma^m$, that is </p>

<ul>
<li>$Q = \{0,1,\dots,m\}$</li>
<li>$\delta(q,a) = \sigma_P(P_{0,q}\cdot a)$ for all $q\in Q$ and $a\in \Sigma$</li>
</ul>

<p>with $\sigma_P(w)$ the length of the ... | algorithms finite automata strings searching | 1 | Connection between KMP prefix function and string matching automaton -- (algorithms finite automata strings searching)
<p>Let $A_P = (Q,\Sigma,\delta,0,\{m\})$ the <em>string matching automaton</em> for pattern $P \in \Sigma^m$, that is </p>

<ul>
<li>$Q = \{0,1,\dots,m\}$</li>
<li>$\delta(q,a) = \sigma... | habedi/stack-exchange-dataset |
1,671 | Connection between castability and convexity | <p>I am wondering if there are any connection between convex polygon and castable object? What can we say about castability of the object if we know that the object is convex polygon and vice versa.</p>
<p>Let's gather together few basic things that we have to know.</p>
<blockquote>
<p>The object is castabl... | complexity theory time complexity computational geometry | 1 | Connection between castability and convexity -- (complexity theory time complexity computational geometry)
<p>I am wondering if there are any connection between convex polygon and castable object? What can we say about castability of the object if we know that the object is convex polygon and vice versa.</p>
<p>Let... | habedi/stack-exchange-dataset |
1,672 | Line separates two sets of points | <p>If there is a way to identify if two sets of points can be separated by a line?</p>

<blockquote>
 <p>We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$ and only $A$ on the one side of the line, and all points of $B$ and only $B$ on the other... | algorithms machine learning computational geometry | 1 | Line separates two sets of points -- (algorithms machine learning computational geometry)
<p>If there is a way to identify if two sets of points can be separated by a line?</p>

<blockquote>
 <p>We have two sets of points $A$ and $B$ if there is a line that separates $A$ and $B$ such that all points of $A$... | habedi/stack-exchange-dataset |
1,681 | Big-Endian/Little-Endian argument - paper by Danny Cohen | <p>Reading a book I was redirected to <a href="http://www.ietf.org/rfc/ien/ien137.txt" rel="nofollow">"On holy wars and a plea for peace"</a> paper by Danny Cohen, which covers the "holy war" between big-endians and little-endians considering byte-order.</p>

<p>Reaching the summary of the memory section I got ... | terminology computer architecture | 1 | Big-Endian/Little-Endian argument - paper by Danny Cohen -- (terminology computer architecture)
<p>Reading a book I was redirected to <a href="http://www.ietf.org/rfc/ien/ien137.txt" rel="nofollow">"On holy wars and a plea for peace"</a> paper by Danny Cohen, which covers the "holy war" between big-endians and little-e... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.