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 |
|---|---|---|---|---|---|---|
91,833 | Evolutionary algorithm - is there a relation between minimum iterations and size of decision variables | <p>I am solving an optimization problem using SPEA2, my problem has three cases with decision variables 25, 50 and 100 in each case. I want to ask if there is some relationship between the number of variables and iterations of evolution process. I mean to say I run algorithm fewer times when decision variables are 25 t... | optimization genetic algorithms evolutionary computing | 1 | Evolutionary algorithm - is there a relation between minimum iterations and size of decision variables -- (optimization genetic algorithms evolutionary computing)
<p>I am solving an optimization problem using SPEA2, my problem has three cases with decision variables 25, 50 and 100 in each case. I want to ask if there i... | habedi/stack-exchange-dataset |
91,847 | How to prove the existence of a number which cannot be written by any algorithm? | <p>I have the problem:</p>

<blockquote>
 <p>Show that there exists a real number for which no program exists
 that runs infinitely long and writes that number's decimal
 digits.</p>
</blockquote>

<p>I suppose it can be solved by reducing it to the Halting problem, but I have no idea... | algorithms reductions halting problem | 1 | How to prove the existence of a number which cannot be written by any algorithm? -- (algorithms reductions halting problem)
<p>I have the problem:</p>

<blockquote>
 <p>Show that there exists a real number for which no program exists
 that runs infinitely long and writes that number's decimal
 di... | habedi/stack-exchange-dataset |
91,849 | Given list of numbers find for each number in the list the next distinct number | <p>Given a sequence of numbers $l_1, \ldots, l_n$, I want to find for each index $i$ the next possible number to the right of $l_i$ (if any) that is different from $l_i$. What is the best time and space optimal solution to do this?</p>

<p>The numbers may be repeating and are in no particular order.</p>
 | algorithms data structures | 1 | Given list of numbers find for each number in the list the next distinct number -- (algorithms data structures)
<p>Given a sequence of numbers $l_1, \ldots, l_n$, I want to find for each index $i$ the next possible number to the right of $l_i$ (if any) that is different from $l_i$. What is the best time and space optim... | habedi/stack-exchange-dataset |
91,853 | Does the Working Set Paging Algorithm use a separate page table? | <p>I am doing research on paging algorithms. While learning about the working set algorithm from several scientific sources I was not really able to figure out where exactly the working set is defined or realized.</p>

<p>I can only imagine two ways of realising this. The first is to put it into the page table ... | virtual memory paging | 1 | Does the Working Set Paging Algorithm use a separate page table? -- (virtual memory paging)
<p>I am doing research on paging algorithms. While learning about the working set algorithm from several scientific sources I was not really able to figure out where exactly the working set is defined or realized.</p>

<... | habedi/stack-exchange-dataset |
91,858 | How to express a structure of a 5-colorable graph in logic | <p>A graph can be expressed as an structure $G = <A,R>$ satisfying the axioms
$ \forall xy R(x,y) \rightarrow R(y,x)$ and $ \forall x \lnot R(x,x)$.</p>

<p>How to extend the structure and/or axioms to express a 5 colourable graph?</p>
 | graphs logic | 1 | How to express a structure of a 5-colorable graph in logic -- (graphs logic)
<p>A graph can be expressed as an structure $G = <A,R>$ satisfying the axioms
$ \forall xy R(x,y) \rightarrow R(y,x)$ and $ \forall x \lnot R(x,x)$.</p>

<p>How to extend the structure and/or axioms to express a 5 colourable ... | habedi/stack-exchange-dataset |
91,865 | Transitivity of quasi-reducibility | <p>A set $A$ is quasi-reducible to $B$ ($A \leq_Q B$) if there is a recursive function $f$ such that $$x \in A \iff W_{f(x)} \subseteq B$$
Or equivalently $$ x \in \overline{A} \iff W_{f(x)} \cap \overline{B} \neq \emptyset $$
Where $W_{e}$ is the domain of the recursive function of index $e$, i.e. $W_{e} = \{y... | computability reductions | 1 | Transitivity of quasi-reducibility -- (computability reductions)
<p>A set $A$ is quasi-reducible to $B$ ($A \leq_Q B$) if there is a recursive function $f$ such that $$x \in A \iff W_{f(x)} \subseteq B$$
Or equivalently $$ x \in \overline{A} \iff W_{f(x)} \cap \overline{B} \neq \emptyset $$
Where $W_{e}$ is the... | habedi/stack-exchange-dataset |
91,872 | What is the difference between a block and a procedure? | <p>A procedure is a sequence of program instructions that perform a specific task, packaged as a unit (Techopedia). </p>

<p>We use block structure to make our code more readable by using indentations and spaces. </p>

<p>Now, is one block the same as a procedure and is vice versa true?</p>
 | lisp | 1 | What is the difference between a block and a procedure? -- (lisp)
<p>A procedure is a sequence of program instructions that perform a specific task, packaged as a unit (Techopedia). </p>

<p>We use block structure to make our code more readable by using indentations and spaces. </p>

<p>Now, is one bloc... | habedi/stack-exchange-dataset |
91,873 | Algorithm Comparison with Theta-notation | <p>We consider two algorithms, Algo1 and Algo2, that solve the same problem. For any input of size n, Algo1 takes time $T_1(n)$ and Algo2 takes time $T_2(n)$. </p>

<p>Prove or disprove each of the following statements. </p>

<p>To prove a statement, you should provide a formal proof that is based on th... | algorithm analysis asymptotics runtime analysis | 1 | Algorithm Comparison with Theta-notation -- (algorithm analysis asymptotics runtime analysis)
<p>We consider two algorithms, Algo1 and Algo2, that solve the same problem. For any input of size n, Algo1 takes time $T_1(n)$ and Algo2 takes time $T_2(n)$. </p>

<p>Prove or disprove each of the following statements... | habedi/stack-exchange-dataset |
91,874 | Testing two distributions, both accept null hypothesis | <p>I have a sample that is collected to verify the accuracy of a new random number generator.
Applying the goodness of fit test to check if this sample comes from the Standard Normal Distribution and Uniform Distribution, I found out that both of these accept null hypothesis although they are contradicting to each ... | statistics sampling random number generator | 1 | Testing two distributions, both accept null hypothesis -- (statistics sampling random number generator)
<p>I have a sample that is collected to verify the accuracy of a new random number generator.
Applying the goodness of fit test to check if this sample comes from the Standard Normal Distribution and Uniform Dist... | habedi/stack-exchange-dataset |
91,880 | Partitioning in time complexity of the sum | <p>We all know the partitioning problem: Given a super-set S of integers, can we partition S into 2 subsets with the same sum. And of course this problem is NP-complete.</p>

<p>My question is - let's denote M as the sum of all numbers in S. Is O(M) considered to be polynomial in this case?</p>

<p>I wi... | complexity theory np complete | 1 | Partitioning in time complexity of the sum -- (complexity theory np complete)
<p>We all know the partitioning problem: Given a super-set S of integers, can we partition S into 2 subsets with the same sum. And of course this problem is NP-complete.</p>

<p>My question is - let's denote M as the sum of all number... | habedi/stack-exchange-dataset |
91,884 | $\mathsf{PSPACE}$ membership in exponentially many steps? | <p>I am trying to argue that a certain problem is in $\mathsf{PSPACE}$ and my question is, essentially, whether it is ok to have an algorithm that takes an exponential number of steps as long as, overall, the whole thing stays in polynomial space. </p>

<p>The context for this is that I have a naive algorithm w... | complexity theory | 1 | $\mathsf{PSPACE}$ membership in exponentially many steps? -- (complexity theory)
<p>I am trying to argue that a certain problem is in $\mathsf{PSPACE}$ and my question is, essentially, whether it is ok to have an algorithm that takes an exponential number of steps as long as, overall, the whole thing stays in polynomia... | habedi/stack-exchange-dataset |
91,892 | How does reducing the Halting problem prove the reduction cannot exist? | <p>For example, take the problem "Does M Halt on the Blank Tape?".</p>

<p>My approach was to reduce the halting problem to prove this problem is also undecidable. I generated a Mw by</p>

<ol>
<li>Writing w on the tape</li>
<li>Moving to the leftmost blank</li>
<li>Running M</li>
</ol>&... | turing machines halting problem | 1 | How does reducing the Halting problem prove the reduction cannot exist? -- (turing machines halting problem)
<p>For example, take the problem "Does M Halt on the Blank Tape?".</p>

<p>My approach was to reduce the halting problem to prove this problem is also undecidable. I generated a Mw by</p>

<ol>&#... | habedi/stack-exchange-dataset |
91,893 | Provide a derivation from backwards on? | <p>Suppose you have to provide a derivation by natural deduction, e.g.</p>

<p>$((A \rightarrow B) \rightarrow A) \rightarrow A$</p>

<p>Is it a good advice to start from backwards on in general?
I mean doing the derivation from bottom to top. The required premises or hypothesis should arise by itse... | logic | 1 | Provide a derivation from backwards on? -- (logic)
<p>Suppose you have to provide a derivation by natural deduction, e.g.</p>

<p>$((A \rightarrow B) \rightarrow A) \rightarrow A$</p>

<p>Is it a good advice to start from backwards on in general?
I mean doing the derivation from bottom to top. The r... | habedi/stack-exchange-dataset |
91,901 | Manipulating Adjacency matrix | <p>I have created an adjacency matrix which looks something like this </p>

<pre><code> A B C D E F G H I
A 0 0 0 0 0 0 0 0 0
B 1 0 0 0 0 0 0 0 0
C 1 0 0 0 0 0 0 0 0
D 0 0 0 0 0 0 0 0 0
E 1 1 0 ... | algorithms adjacency matrix | 1 | Manipulating Adjacency matrix -- (algorithms adjacency matrix)
<p>I have created an adjacency matrix which looks something like this </p>

<pre><code> A B C D E F G H I
A 0 0 0 0 0 0 0 0 0
B 1 0 0 0 0 0 0 0 0
C 1 0 0 0 0 0 0 0 ... | habedi/stack-exchange-dataset |
91,903 | The "complexity" of the Turing machine state specification | <p>Suppose we want to represent some arbitrary Boolean function $f(x_1,x_2,...,x_N)$ on $N$ bits. We can explicitly specify such a representation using the disjunctive normal form. For "most" Boolean functions, this representation will be of length exponential in $N$, and incompressible (as per Shannon). We will assume... | complexity theory turing machines time complexity | 1 | The "complexity" of the Turing machine state specification -- (complexity theory turing machines time complexity)
<p>Suppose we want to represent some arbitrary Boolean function $f(x_1,x_2,...,x_N)$ on $N$ bits. We can explicitly specify such a representation using the disjunctive normal form. For "most" Boolean functi... | habedi/stack-exchange-dataset |
91,908 | How does in-order traversal in Binary search tree works (recursion) | <p>I visit some question but their implementations are slightly different and my doubt is not like theirs. I have this code in Javascript.</p>

<p>The code is typical BST implementation with methods to support in-order traversal. The code that is the most relavant for this question is the the inOrderTraverse an... | binary trees recursion | 1 | How does in-order traversal in Binary search tree works (recursion) -- (binary trees recursion)
<p>I visit some question but their implementations are slightly different and my doubt is not like theirs. I have this code in Javascript.</p>

<p>The code is typical BST implementation with methods to support in-ord... | habedi/stack-exchange-dataset |
91,912 | Data Structure - Array of Array | <p>Suppose that we have a family $F=\{a_1,\dots,a_s\}$ of sorted arrays
to merge. Our strategy is to choose two of them, say $a_i$ and $a_j$,
remove them from $F$, merge them and put the resulting array back into
$F$; we keep doing that until there is only one array in $F$. We will
use a greedy strategy... | algorithms algorithm analysis data structures | 1 | Data Structure - Array of Array -- (algorithms algorithm analysis data structures)
<p>Suppose that we have a family $F=\{a_1,\dots,a_s\}$ of sorted arrays
to merge. Our strategy is to choose two of them, say $a_i$ and $a_j$,
remove them from $F$, merge them and put the resulting array back into
$F$; we keep... | habedi/stack-exchange-dataset |
91,923 | Do the classes $P$ and $NP$ include problems faster then polynomial? | <p>I have being reading up on complexity classes (in Rieffel & Polak, 2011; pg149). I am slightly confused about something. Does for example $P$ (DTime($n^k$)) include all problems that can be solved faster then polynomial in time (e.g. logarithmic) on a deterministic Turing? And likewise for e.g. PSpace (DSpace($n... | complexity theory terminology | 1 | Do the classes $P$ and $NP$ include problems faster then polynomial? -- (complexity theory terminology)
<p>I have being reading up on complexity classes (in Rieffel & Polak, 2011; pg149). I am slightly confused about something. Does for example $P$ (DTime($n^k$)) include all problems that can be solved faster then ... | habedi/stack-exchange-dataset |
91,924 | Why can't a compiler create universal N-bit code (e.g. 32-bit, 64-bit, etc.) | <p>It is my understanding from what I have read that you need to compile separate executables for 32 bit and 64 bit machines. So if I compile a C program for example I need to compile 2 different binaries for 32-bit and 64-bit machines.</p>

<p>However, it seems like intuitively a compiler should just be able t... | computer architecture compilers | 1 | Why can't a compiler create universal N-bit code (e.g. 32-bit, 64-bit, etc.) -- (computer architecture compilers)
<p>It is my understanding from what I have read that you need to compile separate executables for 32 bit and 64 bit machines. So if I compile a C program for example I need to compile 2 different binaries f... | habedi/stack-exchange-dataset |
91,932 | Is there way to calculate $\sum_{i<j<k\leq n} A_i \cdot A_j \cdot A_k$ faster than $O(n^3)$ | <p>Given array $A$ of size $n$, we want to calculate $\sum_{i<j<k\leq n} A_i \cdot A_j \cdot A_k$. Is there way to speed this up rather than the standard $O(n^3) $ calculation with 3 for loops. I haven't worked with sums so I don't know their properties, but I was thinking if there is some way to rewrite the form... | algorithms mathematical programming | 1 | Is there way to calculate $\sum_{i<j<k\leq n} A_i \cdot A_j \cdot A_k$ faster than $O(n^3)$ -- (algorithms mathematical programming)
<p>Given array $A$ of size $n$, we want to calculate $\sum_{i<j<k\leq n} A_i \cdot A_j \cdot A_k$. Is there way to speed this up rather than the standard $O(n^3) $ calculation with ... | habedi/stack-exchange-dataset |
91,940 | Efficient streaming sort | <p>Consider following task: we have an input of N+1 lines, where first line contains N - number of items, and then we have N lines, each one contains one item, which is a tuple (number id, number m), id < 10^9, m < 100. We have to perform a stable sort on this sequence and print the result.</p>

<p>Sample... | algorithms algorithm analysis sorting mathematical programming streaming algorithm | 1 | Efficient streaming sort -- (algorithms algorithm analysis sorting mathematical programming streaming algorithm)
<p>Consider following task: we have an input of N+1 lines, where first line contains N - number of items, and then we have N lines, each one contains one item, which is a tuple (number id, number m), id <... | habedi/stack-exchange-dataset |
91,945 | Understanding Bellman-Ford and Floyd-Warshall Algorithms as Dynamic Programming Algorithms | <p>From my understanding, a problem amenable to a dynamic programming solution has these two properties:</p>

<ol>
<li><strong>Overlapping Subproblems</strong> — The same subcase (a subsection of the overall problem) keeps reappearing. Thus, memoization can be used to boost performance.</li>
<li><... | algorithms graphs dynamic programming shortest path | 1 | Understanding Bellman-Ford and Floyd-Warshall Algorithms as Dynamic Programming Algorithms -- (algorithms graphs dynamic programming shortest path)
<p>From my understanding, a problem amenable to a dynamic programming solution has these two properties:</p>

<ol>
<li><strong>Overlapping Subproblems</strong> ... | habedi/stack-exchange-dataset |
91,948 | Does Floyd–Warshall work on all graphs? | <p>Floyd–Warshall calculates minimum distance between any two vertices in the graph.</p>

<pre><code>for(int k=0;k<n;k++){
 for(int i=0;i<n;i++){
 for(int j=0;j<n;j++){
 dist[i][j]=min(dist[i][j],dist[i][k]+dist[k][j]);
 }
 }
}
</code></p... | algorithms graphs shortest path | 1 | Does Floyd–Warshall work on all graphs? -- (algorithms graphs shortest path)
<p>Floyd–Warshall calculates minimum distance between any two vertices in the graph.</p>

<pre><code>for(int k=0;k<n;k++){
 for(int i=0;i<n;i++){
 for(int j=0;j<n;j++){
 dist[i][j]=min(di... | habedi/stack-exchange-dataset |
91,956 | Making a CFG for a^i b^j c^k such that i+j = 3k | <p>I have the language $L = \{a^i b^j c^k \mid i+j=3k\}$, however I am struggling to convert it to a CFG.</p>

<p>I have made it into a PDA fairly easily, its just now getting this to the CFG which is the issue.</p>

<p>I have thought about dividing it into 3 cases then taking the union of them for exam... | context free formal grammars pushdown automata | 1 | Making a CFG for a^i b^j c^k such that i+j = 3k -- (context free formal grammars pushdown automata)
<p>I have the language $L = \{a^i b^j c^k \mid i+j=3k\}$, however I am struggling to convert it to a CFG.</p>

<p>I have made it into a PDA fairly easily, its just now getting this to the CFG which is the issue.<... | habedi/stack-exchange-dataset |
91,960 | Runtime analysis of while-loop analysis | <pre><code>s = n
while (s > 4)
 s = s / 2
else 
 s = s - 1
</code></pre>

<p>Let $T(n) = \Theta(S(n))$ where $S(n)$ is number of while-loop runs.</p>

<p>$S(n)=1 + S(n/2)$ if $n$ is even</p>

<p>$S(n)=1 + S(n-1)$ if $n$ is odd</p>

<p>$S(n)=0$ if $n \leq 4$</p>&#... | algorithms algorithm analysis asymptotics runtime analysis loops | 1 | Runtime analysis of while-loop analysis -- (algorithms algorithm analysis asymptotics runtime analysis loops)
<pre><code>s = n
while (s > 4)
 s = s / 2
else 
 s = s - 1
</code></pre>

<p>Let $T(n) = \Theta(S(n))$ where $S(n)$ is number of while-loop runs.</p>

<p>$S(n)=1 + S(n/2... | habedi/stack-exchange-dataset |
91,961 | If Q1 and Q2 are countably enumerable, then is Q1\Q2 countably enumerable? | <p>If Q1 and Q2 are countably enumerable, then is Q1\Q2 countably enumerable?</p>

<p>I am reading a text where they claim that this is not the case and ask the reader to come up with a counter example.</p>

<p>Can someone give a counter example to the claim that if both Q1 and Q2 are c.e. then so is Q1... | computability semi decidability | 1 | If Q1 and Q2 are countably enumerable, then is Q1\Q2 countably enumerable? -- (computability semi decidability)
<p>If Q1 and Q2 are countably enumerable, then is Q1\Q2 countably enumerable?</p>

<p>I am reading a text where they claim that this is not the case and ask the reader to come up with a counter exampl... | habedi/stack-exchange-dataset |
91,962 | Sorting by Comparisons Proof | <p><a href="https://i.stack.imgur.com/f6emd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f6emd.png" alt="enter image description here"></a></p>

<p><p>I came across this question while solving past papers and I'm not very sure as to how to construct my proof for the second and third questi... | algorithms sorting | 1 | Sorting by Comparisons Proof -- (algorithms sorting)
<p><a href="https://i.stack.imgur.com/f6emd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f6emd.png" alt="enter image description here"></a></p>

<p><p>I came across this question while solving past papers and I'm not very sure as to how ... | habedi/stack-exchange-dataset |
91,963 | What do Arora and Barak mean by $x|_S$ in their definition of certificate complexity? | <p>I am having much trouble understanding the following definition (of certificate complexity - for decision trees) from Arora and Barak's book <em>Computational Complexity: A Modern Approach</em>. Perhaps there is a typo in it:</p>

<blockquote>
 <p>Definition 12.3 (page 262). Let $f : \{0,1\}^n \to \{0, ... | complexity theory decision tree | 1 | What do Arora and Barak mean by $x|_S$ in their definition of certificate complexity? -- (complexity theory decision tree)
<p>I am having much trouble understanding the following definition (of certificate complexity - for decision trees) from Arora and Barak's book <em>Computational Complexity: A Modern Approach</em>.... | habedi/stack-exchange-dataset |
91,968 | Is it NP hard to partition a graph into 2 vertex sets with minimum degree of 2 and 3? | <p>The following problem is from my algorithms class:</p>

<blockquote>
 <p>Given a graph $G=(V, E)$, decide whether a partition of $V=(V_1, V_2)$ exists such that $\delta(G(V_1))\ge 2 $ and $\delta(G(V_2))\ge 3 $, where $G(V_1)$ denotes the subgraph induced by $V_1$ and $\delta(G(V_1))$ denotes the minimu... | complexity theory np complete reductions np hard | 1 | Is it NP hard to partition a graph into 2 vertex sets with minimum degree of 2 and 3? -- (complexity theory np complete reductions np hard)
<p>The following problem is from my algorithms class:</p>

<blockquote>
 <p>Given a graph $G=(V, E)$, decide whether a partition of $V=(V_1, V_2)$ exists such that $\d... | habedi/stack-exchange-dataset |
91,971 | Is it NP hard to decide whether there exists a subset of V of size at most $k$ hitting all maximal bicliques of G? | <p>The following problem is from my algorithms class:</p>

<blockquote>
 <p>Given a graph $G(V, E)$, a set $C \subseteq V$ is called a <em>biclique</em> iff $G[C]$ is a complete bipartite graph, where $G(C)$ is the subgraph induced by $C$. A biclique is called <strong>maximal</strong> if it is not a subse... | complexity theory graphs reductions np hard | 1 | Is it NP hard to decide whether there exists a subset of V of size at most $k$ hitting all maximal bicliques of G? -- (complexity theory graphs reductions np hard)
<p>The following problem is from my algorithms class:</p>

<blockquote>
 <p>Given a graph $G(V, E)$, a set $C \subseteq V$ is called a <em>bicl... | habedi/stack-exchange-dataset |
91,972 | Confluent directed acyclic graph | <blockquote>
 <p>A directed acyclic graph $G$ is <em>confluent</em>, if any two vertices
 ${v_1},{v_2}$ in $G$ which have a common ancestor $u$ also have a
 common successor $w$. (I.e. if there are paths from some $u$ to both
 ${v_1}$ and ${v_2}$, then there are also paths from ${v_1}$ and
 ${v... | graphs | 1 | Confluent directed acyclic graph -- (graphs)
<blockquote>
 <p>A directed acyclic graph $G$ is <em>confluent</em>, if any two vertices
 ${v_1},{v_2}$ in $G$ which have a common ancestor $u$ also have a
 common successor $w$. (I.e. if there are paths from some $u$ to both
 ${v_1}$ and ${v_2}$, then th... | habedi/stack-exchange-dataset |
91,974 | Alan Perlis Epigram on Recursion | <p>So, while trying to dive into "recursion" and the like, I came across an epigram about recursion by Alan Perlis:</p>

<blockquote>
 <p>Recursion is the root of computation since it trades description for time. </p>
 
 <p>-- Alan Perlis</p>
</blockquote>

<p>Common to epigrams, this... | computability recursion | 1 | Alan Perlis Epigram on Recursion -- (computability recursion)
<p>So, while trying to dive into "recursion" and the like, I came across an epigram about recursion by Alan Perlis:</p>

<blockquote>
 <p>Recursion is the root of computation since it trades description for time. </p>
 
 <p>-- Alan Per... | habedi/stack-exchange-dataset |
91,975 | Why don't we delete a node in adjacency list after visiting an edge in Fleury algorithm? | <p>I was reading an article on fleury's algorithm <a href="https://www.geeksforgeeks.org/fleurys-algorithm-for-printing-eulerian-path/" rel="nofollow noreferrer">GeeksforGeeks</a>. In fleury's algorithm, Once an edge is processed (included in Euler tour), we remove it from the graph. To remove the edge, we replace the ... | algorithms graphs | 1 | Why don't we delete a node in adjacency list after visiting an edge in Fleury algorithm? -- (algorithms graphs)
<p>I was reading an article on fleury's algorithm <a href="https://www.geeksforgeeks.org/fleurys-algorithm-for-printing-eulerian-path/" rel="nofollow noreferrer">GeeksforGeeks</a>. In fleury's algorithm, Once... | habedi/stack-exchange-dataset |
92,009 | how to defend against DOS caused by SYN cookies? | <p>i have read about SYN cookies and i understood that they help to avoid DOS .. BUt my prof wants an answer as how SYN cookies can be used to cause DOS and how can it be avoided ? any help woul dbe really appreciated.. thanks in advance </p>
 | computer networks security | 1 | how to defend against DOS caused by SYN cookies? -- (computer networks security)
<p>i have read about SYN cookies and i understood that they help to avoid DOS .. BUt my prof wants an answer as how SYN cookies can be used to cause DOS and how can it be avoided ? any help woul dbe really appreciated.. thanks in advance <... | habedi/stack-exchange-dataset |
92,012 | Detecting Hamiltonian path in a graph | <p>There are various methods to detect hamiltonian path in a graph.</p>

<ol>
<li><p>Brute force approach. i.e. considering all permutations T(n)=O(n*n!)</p></li>
<li><p>Backtracking T(n)=O(n!)</p></li>
<li><p>Using Dynamic programming T(n)=O(2^n * n^2)</p></li>
</ol>

<p>Now, there is o... | algorithms graphs hamiltonian path | 1 | Detecting Hamiltonian path in a graph -- (algorithms graphs hamiltonian path)
<p>There are various methods to detect hamiltonian path in a graph.</p>

<ol>
<li><p>Brute force approach. i.e. considering all permutations T(n)=O(n*n!)</p></li>
<li><p>Backtracking T(n)=O(n!)</p></li>
<li><p>Using Dynami... | habedi/stack-exchange-dataset |
92,035 | Are there any techniques for checking whether a clause is subsumed by another clause when adding it to a cnf formula? | <p>When doing variable elimination on a formula in cnf form, there is created a lot of new clauses. Is there any efficient way to check if these are subsumed by other, already existing clauses?</p>
 | satisfiability boolean algebra propositional logic | 1 | Are there any techniques for checking whether a clause is subsumed by another clause when adding it to a cnf formula? -- (satisfiability boolean algebra propositional logic)
<p>When doing variable elimination on a formula in cnf form, there is created a lot of new clauses. Is there any efficient way to check if these a... | habedi/stack-exchange-dataset |
92,042 | How to prove that a bounded pushdown automaton is regular? | <p>I'm studying computer science and I want to show that a language which is accepted by a pushdown automaton with a bounded stack height is regular, but I'm totally lost... Can someone try to explain how we can prove it ? </p>

<p>Thank you in advance!</p>
 | regular languages automata pushdown automata | 1 | How to prove that a bounded pushdown automaton is regular? -- (regular languages automata pushdown automata)
<p>I'm studying computer science and I want to show that a language which is accepted by a pushdown automaton with a bounded stack height is regular, but I'm totally lost... Can someone try to explain how we can... | habedi/stack-exchange-dataset |
92,045 | What does "order of growth decreases exponentially" mean? | <p>I understand than function decreases exponentially, then order of growth of this function is exponential with negative exponent. But what does it mean that <em>order of growth decreases exponentially</em>?</p>

<p>I don't understand what should i look for in this exercise:</p>

<blockquote>
 <p>... | asymptotics | 1 | What does "order of growth decreases exponentially" mean? -- (asymptotics)
<p>I understand than function decreases exponentially, then order of growth of this function is exponential with negative exponent. But what does it mean that <em>order of growth decreases exponentially</em>?</p>

<p>I don't understand w... | habedi/stack-exchange-dataset |
92,053 | Erlang- Creating a function which only adds/subtracts positive integers | <p>I want to create a function which allows me to input a list, and then add all of the positive numbers from the list together, leaving any that are negative.</p>

<p>([3,1,-1])
For example only 3 and 1 would be added from this list.</p>

<p>Would I right in thinking the function should be recursiv... | programming languages concurrency functional programming | 1 | Erlang- Creating a function which only adds/subtracts positive integers -- (programming languages concurrency functional programming)
<p>I want to create a function which allows me to input a list, and then add all of the positive numbers from the list together, leaving any that are negative.</p>

<p>([3,1,-1])... | habedi/stack-exchange-dataset |
92,058 | Weighted probability using Huffman Tree | <p>I want to produce a value from a set, where each value has an associated weight.</p>

<p>Eg:</p>

<pre><code>[(1, 4), (2, 3), (3, 3)]
</code></pre>

<p>should give me a 40% chance of picking 1, and a 30% chance of picking 2 or 3 respectively. </p>

<p>Using a cumulative sum table ... | time complexity binary trees randomized algorithms average case huffman coding | 1 | Weighted probability using Huffman Tree -- (time complexity binary trees randomized algorithms average case huffman coding)
<p>I want to produce a value from a set, where each value has an associated weight.</p>

<p>Eg:</p>

<pre><code>[(1, 4), (2, 3), (3, 3)]
</code></pre>

<p>should give m... | habedi/stack-exchange-dataset |
92,081 | Determine if an array is divisible in pairs of equal sum | <p>I'm currently studying the time complexity of the solution provided by my teacher to this problem, and I can't understand the logic:</p>
<blockquote>
<p>Let A be an unordered array of positive natural numbers. Write an algorithm that checks if it's possible to divide A into pairs (subsets of two elements) of... | algorithms time complexity partitions subset sum | 1 | Determine if an array is divisible in pairs of equal sum -- (algorithms time complexity partitions subset sum)
<p>I'm currently studying the time complexity of the solution provided by my teacher to this problem, and I can't understand the logic:</p>
<blockquote>
<p>Let A be an unordered array of positive natur... | habedi/stack-exchange-dataset |
92,085 | When does an extendible 1:1 p.c. function have a 1:1 computable extension? | <p>A partial computable function $\varphi_e$, defined on a c.e. set $W_e$, is called extendible if there exists some computable function $f$ which extends $\varphi_e$, i.e. $\varphi_e(W_e) = f(W_e)$.<br>
My question is what are the conditions for a p.c. function $\varphi_e$ to have an injective extension.</p>
&... | computability semi decidability | 1 | When does an extendible 1:1 p.c. function have a 1:1 computable extension? -- (computability semi decidability)
<p>A partial computable function $\varphi_e$, defined on a c.e. set $W_e$, is called extendible if there exists some computable function $f$ which extends $\varphi_e$, i.e. $\varphi_e(W_e) = f(W_e)$.<br>
... | habedi/stack-exchange-dataset |
92,087 | Are there any problems in $P$ which we do not know any $P$ algorithms? | <p>A problem in $P$ is one that can be solved in polynomial time (or faster) on a deterministic Turing machine. Now if I am correct, there is nothing here referring to the algorithms - which can themselves can be given a complexity class (necessarily greater or equal to that or the problem).</p>

<p>My question... | algorithms complexity theory | 1 | Are there any problems in $P$ which we do not know any $P$ algorithms? -- (algorithms complexity theory)
<p>A problem in $P$ is one that can be solved in polynomial time (or faster) on a deterministic Turing machine. Now if I am correct, there is nothing here referring to the algorithms - which can themselves can be gi... | habedi/stack-exchange-dataset |
92,091 | Is relation following given characteristic already in 2NF, 3NF and BCNF? | <p>The definitions of 2NF, 3NF and BCNF goes like this:</p>

<blockquote>
 <p><strong>2 Normal Form (NF) definition</strong><br>
 A relation is in second normal form if and only if it is in first normal form and all the non-key attributes are fully functionally dependent on the candidate key. </p>&#... | database theory databases | 1 | Is relation following given characteristic already in 2NF, 3NF and BCNF? -- (database theory databases)
<p>The definitions of 2NF, 3NF and BCNF goes like this:</p>

<blockquote>
 <p><strong>2 Normal Form (NF) definition</strong><br>
 A relation is in second normal form if and only if it is in first n... | habedi/stack-exchange-dataset |
92,101 | does order matter when two different derivations are to be made for ambiguous grammar | <p>E -> E + E | E * E | (E) | a</p>

<p>Derivation for ( (a+a) * a)</p>

<p>Question : Show that the grammar is ambiguous by sparse tree method</p>

<p>Now, I have derived two derivation using left most derivation </p>

<p>but it results in like this
1st : <strong>((a+a) * a)</stron... | automata | 1 | does order matter when two different derivations are to be made for ambiguous grammar -- (automata)
<p>E -> E + E | E * E | (E) | a</p>

<p>Derivation for ( (a+a) * a)</p>

<p>Question : Show that the grammar is ambiguous by sparse tree method</p>

<p>Now, I have derived two derivation using le... | habedi/stack-exchange-dataset |
92,120 | What would be the time complexity for following recurrence? | <p>T (n) = T (n/2) + 2^n</p>

<p>I am solving this using master theorem and I calculated it to be big theta(log2 n) (log n to the base 2). But answer state it to be 2^n.</p>

<p>Any help would be appreciated.</p>
 | algorithms time complexity recurrence relation master theorem | 1 | What would be the time complexity for following recurrence? -- (algorithms time complexity recurrence relation master theorem)
<p>T (n) = T (n/2) + 2^n</p>

<p>I am solving this using master theorem and I calculated it to be big theta(log2 n) (log n to the base 2). But answer state it to be 2^n.</p>

<p... | habedi/stack-exchange-dataset |
92,122 | CFLs are inherently unambiguous? | <p>As reading the textbook of Introduction to the theory of computation_third edition - Michael Sipser, which have the concept that we call a context-free language L inherently unambiguous if there does not exist an ambiguous CFG that generates L. </p>

<p>Do we have any CFLs are inherently unambiguous? if so, ... | context free ambiguity | 1 | CFLs are inherently unambiguous? -- (context free ambiguity)
<p>As reading the textbook of Introduction to the theory of computation_third edition - Michael Sipser, which have the concept that we call a context-free language L inherently unambiguous if there does not exist an ambiguous CFG that generates L. </p>
&#... | habedi/stack-exchange-dataset |
92,139 | How should I describe the relationships between type expressions? | <p>Lets say I have two type expressions: <code>Maybe a</code> (X) and <code>Maybe Integer</code> (Y), where <code>Maybe</code> is a type constructor, <code>Integer</code> is a Type and <code>a</code> is a type variable.</p>

<p>What language should I use to describe the relationship between these expressions, ... | type theory haskell | 1 | How should I describe the relationships between type expressions? -- (type theory haskell)
<p>Lets say I have two type expressions: <code>Maybe a</code> (X) and <code>Maybe Integer</code> (Y), where <code>Maybe</code> is a type constructor, <code>Integer</code> is a Type and <code>a</code> is a type variable.</p>
... | habedi/stack-exchange-dataset |
92,145 | What to prove and how to prove it | <p>In learning about proof theory, I am interested to know how to go about "proving properties of a program". I don't exactly see yet what needs to be proven, nor how to prove it, which leads to this brief discussion followed by some questions.</p>

<p>In some languages (such as <a href="https://en.wikipedia.or... | proof assistants software testing | 1 | What to prove and how to prove it -- (proof assistants software testing)
<p>In learning about proof theory, I am interested to know how to go about "proving properties of a program". I don't exactly see yet what needs to be proven, nor how to prove it, which leads to this brief discussion followed by some questions.</p... | habedi/stack-exchange-dataset |
92,151 | Random award question | <p>I'm assisting with the design of an algorithm over the next week to fit the following use case:</p>

<p>A person walking in a store has a tablet and approaches possible customers to notify them of a competition. When a customer enters their details, upon completion of the form - a request is sent to the serv... | probability theory probabilistic algorithms | 1 | Random award question -- (probability theory probabilistic algorithms)
<p>I'm assisting with the design of an algorithm over the next week to fit the following use case:</p>

<p>A person walking in a store has a tablet and approaches possible customers to notify them of a competition. When a customer enters the... | habedi/stack-exchange-dataset |
92,161 | Number of states in NFA and DFA accepting strings from length 0 to n with alphabet Σ= {0,1} | <p>The question is in title. Let me repeat:</p>

<blockquote>
 <p>What are the number of states in NFA and DFA accepting strings from length 0 to n with alphabet $\Sigma = {0,1}$</p>
</blockquote>

<p>I feel both NFA and DFA will take following form:</p>

<p><a href="https://i.stack.img... | automata finite automata nondeterminism | 1 | Number of states in NFA and DFA accepting strings from length 0 to n with alphabet Σ= {0,1} -- (automata finite automata nondeterminism)
<p>The question is in title. Let me repeat:</p>

<blockquote>
 <p>What are the number of states in NFA and DFA accepting strings from length 0 to n with alphabet $\Sigma ... | habedi/stack-exchange-dataset |
92,164 | Understanding trap and dead state in automata | <p>Well, this sounds somewhat basic definitions, but I feel they needs to be clearly defined.</p>

<p>In book by Hopcroft et. al., <a href="https://books.google.co.in/books?id=tzttuN4gsVgC&pg=PA63" rel="nofollow noreferrer">there is an excerpt</a>:</p>

<blockquote>
 <p>...a <strong><em>dead st... | automata finite automata nondeterminism | 1 | Understanding trap and dead state in automata -- (automata finite automata nondeterminism)
<p>Well, this sounds somewhat basic definitions, but I feel they needs to be clearly defined.</p>

<p>In book by Hopcroft et. al., <a href="https://books.google.co.in/books?id=tzttuN4gsVgC&pg=PA63" rel="nofollow noref... | habedi/stack-exchange-dataset |
92,173 | Maximum number of vertices in undirected graph | <p>I'm studying about time complexity of Kruskal's algorithm.</p>

<p>But there are two opinions to express time complexity as $O(|E|\lg|E|), O(|E|\lg|V|)$.</p>

<p>I know $O(|E|\lg|E|)$ is occurred from sorting by non-decreasing order of vertices.</p>

<p>But I don't understand of $O(|E|\lg|V|)... | graphs time complexity | 1 | Maximum number of vertices in undirected graph -- (graphs time complexity)
<p>I'm studying about time complexity of Kruskal's algorithm.</p>

<p>But there are two opinions to express time complexity as $O(|E|\lg|E|), O(|E|\lg|V|)$.</p>

<p>I know $O(|E|\lg|E|)$ is occurred from sorting by non-decreasing... | habedi/stack-exchange-dataset |
92,177 | Do "Type-2" Turing machines with infinite length inputs have more computational power? | <p>Certain idealizations of a Turing machine yield an increase in computational power, such as an inductive Turing machine, which can (trivially) solve the halting problem if it has an infinite amount of time to run.</p>

<p>A related variation is the "type-2 Turing machine" defined by Weihrauch, which (if I un... | turing machines computability computation models real numbers hypercomputation | 1 | Do "Type-2" Turing machines with infinite length inputs have more computational power? -- (turing machines computability computation models real numbers hypercomputation)
<p>Certain idealizations of a Turing machine yield an increase in computational power, such as an inductive Turing machine, which can (trivially) sol... | habedi/stack-exchange-dataset |
92,183 | Application of lambda function in Simply Typed Lambda Calculus | <p>I'm just getting started with STLC (Simply Typed Lambda Calculus) and I'm trying to understand an evaluation rule I've been given in some lecture notes by my professor. What it says is the following:</p>

<pre><code>(λx. x(λx. x)) (u r) evaluates to (u r) (λx. x)
</code></pre>

<p>I don't really ... | lambda calculus evaluation strategies | 1 | Application of lambda function in Simply Typed Lambda Calculus -- (lambda calculus evaluation strategies)
<p>I'm just getting started with STLC (Simply Typed Lambda Calculus) and I'm trying to understand an evaluation rule I've been given in some lecture notes by my professor. What it says is the following:</p>
&#x... | habedi/stack-exchange-dataset |
92,192 | Priority data structure supporting operations Insert, Delete, Get in O(log n) | <p>I need a data structure to store priority $p$ for each key $k$ (unique). It must also support the following operations in $O(\log n)$ time:</p>

<p>$\text{Insert}(k,p)$ Inserts a key $k$ with priority $p$ into the structure. If there already is an element with key $k$, it changes its priority instead.</p>&#x... | data structures | 1 | Priority data structure supporting operations Insert, Delete, Get in O(log n) -- (data structures)
<p>I need a data structure to store priority $p$ for each key $k$ (unique). It must also support the following operations in $O(\log n)$ time:</p>

<p>$\text{Insert}(k,p)$ Inserts a key $k$ with priority $p$ into ... | habedi/stack-exchange-dataset |
92,193 | Why the time complexity of Prim's algorithm is not $|V||E|lg|V|$ but $|E|lg|V|$? | <p>In the CLRS, time complexity of Prim's algorithm is $O(|V|lg|V|+|E|lg|V|)=O(|E|lg|V|)$.</p>

<p>But, for my understanding, Prim's algorithm iterates $|E|$ times for DECREASE-KEY operation which takes $O(lg|V|)$ times and it leads to $O(|E|lg|V|)$.</p>

<p>So, it iterates $|V|$ times then, I think $O(... | graphs time complexity prims algorithm | 1 | Why the time complexity of Prim's algorithm is not $|V||E|lg|V|$ but $|E|lg|V|$? -- (graphs time complexity prims algorithm)
<p>In the CLRS, time complexity of Prim's algorithm is $O(|V|lg|V|+|E|lg|V|)=O(|E|lg|V|)$.</p>

<p>But, for my understanding, Prim's algorithm iterates $|E|$ times for DECREASE-KEY operat... | habedi/stack-exchange-dataset |
92,206 | A "packing" optimisation problem with application in dynamic programming | <p>I'm interested in the following problem :</p>

<p><strong>Input</strong> : an integer $n$, and $k$ <em>increasing</em> functions $f_i:\mathbb{N}\rightarrow\mathbb{R}$, such that $f_i(0)=0$ for all $1\le i \le k$</p>

<p><strong>Output</strong> : $k$ integers $n_1,\dots,n_k$, such that $n_1+\dots+n_k=... | algorithms dynamic programming | 1 | A "packing" optimisation problem with application in dynamic programming -- (algorithms dynamic programming)
<p>I'm interested in the following problem :</p>

<p><strong>Input</strong> : an integer $n$, and $k$ <em>increasing</em> functions $f_i:\mathbb{N}\rightarrow\mathbb{R}$, such that $f_i(0)=0$ for all $1\... | habedi/stack-exchange-dataset |
92,210 | In LPA*, how are predecessors/successors of a vertex defined? | <p>While trying to implement <a href="http://idm-lab.org/bib/abstracts/papers/nips2001.pdf" rel="nofollow noreferrer">LPA*</a> (mostly based on its description in the same authors’ <a href="http://idm-lab.org/bib/abstracts/papers/aaai02b.pdf" rel="nofollow noreferrer">paper</a> on its derivative D*Lite), I noticed it m... | algorithms graphs shortest path | 1 | In LPA*, how are predecessors/successors of a vertex defined? -- (algorithms graphs shortest path)
<p>While trying to implement <a href="http://idm-lab.org/bib/abstracts/papers/nips2001.pdf" rel="nofollow noreferrer">LPA*</a> (mostly based on its description in the same authors’ <a href="http://idm-lab.org/bib/abstract... | habedi/stack-exchange-dataset |
92,221 | Dijkstra's Notes on Structured Programming - concerning the program to compute first 1000 prime numbers | <p>In his "Notes on Structured Programming" essay, E. W. Dijkstra gives an example of a program that computes the first 1000 primes (Section 9. "A First Example of Step-Wise Program Composition").</p>

<p>The idea is to iterate all the numbers from 1 to 1000 in increasing order, to test each one and if found to... | algorithms algorithm analysis primes | 1 | Dijkstra's Notes on Structured Programming - concerning the program to compute first 1000 prime numbers -- (algorithms algorithm analysis primes)
<p>In his "Notes on Structured Programming" essay, E. W. Dijkstra gives an example of a program that computes the first 1000 primes (Section 9. "A First Example of Step-Wise ... | habedi/stack-exchange-dataset |
92,222 | Question on "Hitting the memory wall, implications of the obvious" | <p>I'm reading through a short paper about <a href="http://www.di-srv.unisa.it/~vitsca/SC-2011/DesignPrinciplesMulticoreProcessors/Wulf1995.pdf" rel="nofollow noreferrer">hitting the memory wall</a> and I'm struggling to understand how exactly said wall will be hit.</p>

<p>The equation for average access time ... | memory access | 1 | Question on "Hitting the memory wall, implications of the obvious" -- (memory access)
<p>I'm reading through a short paper about <a href="http://www.di-srv.unisa.it/~vitsca/SC-2011/DesignPrinciplesMulticoreProcessors/Wulf1995.pdf" rel="nofollow noreferrer">hitting the memory wall</a> and I'm struggling to understand ho... | habedi/stack-exchange-dataset |
92,227 | do the ram lose what it remembers when the power if cut off? | <p>after shutting down the computer do the ram loses what it remember ? if yes is there some technics that are used to get what is stocked into the ram after shutting down the computer ?</p>
 | computation models | 1 | do the ram lose what it remembers when the power if cut off? -- (computation models)
<p>after shutting down the computer do the ram loses what it remember ? if yes is there some technics that are used to get what is stocked into the ram after shutting down the computer ?</p>
 | habedi/stack-exchange-dataset |
92,231 | Big-O complexity upon taking exponent | <p>If $X \sim \mathcal{O}(\log n)$, then $e^{-X} \sim \mathcal{O} (?)$</p>

<p>Is this a valid question to ask?</p>
 | complexity theory asymptotics | 1 | Big-O complexity upon taking exponent -- (complexity theory asymptotics)
<p>If $X \sim \mathcal{O}(\log n)$, then $e^{-X} \sim \mathcal{O} (?)$</p>

<p>Is this a valid question to ask?</p>
 | habedi/stack-exchange-dataset |
92,237 | Removing lambda-productions when it's at the start symbol | <p>I had a question regarding removing lambda-productions from context-free grammars.</p>

<p>I understand that the basic theorem or process for removing lambda-productions is to find nullable productions and replace them with the version of the same production when we use lambda. However, I had a question rega... | context free formal grammars | 1 | Removing lambda-productions when it's at the start symbol -- (context free formal grammars)
<p>I had a question regarding removing lambda-productions from context-free grammars.</p>

<p>I understand that the basic theorem or process for removing lambda-productions is to find nullable productions and replace the... | habedi/stack-exchange-dataset |
92,242 | Serializability and the Lost Update Problem | <p><a href="https://en.wikipedia.org/wiki/Serializability" rel="nofollow noreferrer">Serializability</a> is the strongest consistency level with regard to the execution of two concurrent transactions T1 and T2. That is, if T1 and T2 independently change the application between consistent states, and a concurrent execut... | concurrency database theory | 1 | Serializability and the Lost Update Problem -- (concurrency database theory)
<p><a href="https://en.wikipedia.org/wiki/Serializability" rel="nofollow noreferrer">Serializability</a> is the strongest consistency level with regard to the execution of two concurrent transactions T1 and T2. That is, if T1 and T2 independen... | habedi/stack-exchange-dataset |
92,250 | Is Phong shading a pixel-first computational model? | <p>Wikipedia says that:</p>

<blockquote>
 <p>If a mesh covers more pixels in screen space than it has vertices, interpolating colour values from samples of expensive lighting calculations at vertices is less processor intensive than performing the lighting calculation for each pixel as in Phong shading.</... | graphics | 1 | Is Phong shading a pixel-first computational model? -- (graphics)
<p>Wikipedia says that:</p>

<blockquote>
 <p>If a mesh covers more pixels in screen space than it has vertices, interpolating colour values from samples of expensive lighting calculations at vertices is less processor intensive than perform... | habedi/stack-exchange-dataset |
92,254 | Find all local minima in a big 2d array | <p>Assume we have a big 2d array. All its elements are either zeros or natural numbers. A local minimum is an element that is less than all its 8 neighbors. Is there an effective algorithm to find all local minima in the array?</p>
 | optimization search algorithms arrays matrices | 1 | Find all local minima in a big 2d array -- (optimization search algorithms arrays matrices)
<p>Assume we have a big 2d array. All its elements are either zeros or natural numbers. A local minimum is an element that is less than all its 8 neighbors. Is there an effective algorithm to find all local minima in the array?<... | habedi/stack-exchange-dataset |
92,262 | Variant of nim game with particular rules | <p>Let's say we have the following rule for that particular Nim game: You have multiple heaps, and you have to remove 1,2 or 3 sticks (not more) from a SINGLE choosen heap. The player who pick up the last stick LOSES. (misere game). Is there an algorithm which solves this variant of Nim game ?</p>

<p>Thanks in... | algorithms complexity theory search algorithms game theory | 1 | Variant of nim game with particular rules -- (algorithms complexity theory search algorithms game theory)
<p>Let's say we have the following rule for that particular Nim game: You have multiple heaps, and you have to remove 1,2 or 3 sticks (not more) from a SINGLE choosen heap. The player who pick up the last stick LOS... | habedi/stack-exchange-dataset |
92,268 | Assertion of Type Inference Rules/Type Checking | <p>I have a problem in a book I am trying to accomplish.</p>

<p><a href="https://i.stack.imgur.com/fHj1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fHj1l.png" alt="Image"></a></p>

<p>I understand the overall type of the expression is boolean and how it derives. (y * x) will be ... | compilers type theory type checking type inference | 1 | Assertion of Type Inference Rules/Type Checking -- (compilers type theory type checking type inference)
<p>I have a problem in a book I am trying to accomplish.</p>

<p><a href="https://i.stack.imgur.com/fHj1l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fHj1l.png" alt="Image"></a></p>
... | habedi/stack-exchange-dataset |
92,272 | Algorithm to place apples in boxes | <p>Suppose we have $x$ apples and $y$ boxes. Each box can fit at most 3 apples, and we say that a box is half full iff the box contains $\leq$ 1 apple. If each apple has a (non-empty) list of boxes that it can be placed in, what is a polynomial time algorithm that places apples in boxes such that the number of half ful... | algorithms | 1 | Algorithm to place apples in boxes -- (algorithms)
<p>Suppose we have $x$ apples and $y$ boxes. Each box can fit at most 3 apples, and we say that a box is half full iff the box contains $\leq$ 1 apple. If each apple has a (non-empty) list of boxes that it can be placed in, what is a polynomial time algorithm that plac... | habedi/stack-exchange-dataset |
92,279 | Can one quickly update CRC codes based on small change and previous CRC code? | <p>I asked this on StackOverflow, but, alas, no answers.</p>

<p>I'd like to use CRC or similar codes to check whether certain very large objects are likely to be identical. The trouble is, small parts of these objects are sometimes modified, and it would be very inefficient to re-compute CRC code from the enti... | crc | 1 | Can one quickly update CRC codes based on small change and previous CRC code? -- (crc)
<p>I asked this on StackOverflow, but, alas, no answers.</p>

<p>I'd like to use CRC or similar codes to check whether certain very large objects are likely to be identical. The trouble is, small parts of these objects are so... | habedi/stack-exchange-dataset |
92,287 | What is the range of possible IP addresses when expressed as decimal and hexadecimal? | <p>I know that there are $2^{32}$ different combinations of IPv4 addresses possible , if expressed in binary.</p>

<p>In decimal notation, they range from $0.0.0.0$ to $255.255.255.255$.</p>

<p>So are there $256^{4}$ possibilities if expressed in decimal?</p>

<p>And $16^{4}$ in hexadecimal?</p... | number formats | 1 | What is the range of possible IP addresses when expressed as decimal and hexadecimal? -- (number formats)
<p>I know that there are $2^{32}$ different combinations of IPv4 addresses possible , if expressed in binary.</p>

<p>In decimal notation, they range from $0.0.0.0$ to $255.255.255.255$.</p>

<p>So ... | habedi/stack-exchange-dataset |
92,289 | If a Triple Graph Grammar rule counts as a Mathematical Proof | <p>I am intrigued by <a href="http://www.wagner-gt.de/fileadmin/user_upload/publications/KW07.pdf" rel="nofollow noreferrer">Triple Graph Grammars</a> (TGG) as a potential for formal mathematical proof. </p>

<blockquote>
 <p>Triple Graph Grammars (TGGs) are a technique for defining the
 correspondenc... | graphs formal grammars proof techniques software verification | 1 | If a Triple Graph Grammar rule counts as a Mathematical Proof -- (graphs formal grammars proof techniques software verification)
<p>I am intrigued by <a href="http://www.wagner-gt.de/fileadmin/user_upload/publications/KW07.pdf" rel="nofollow noreferrer">Triple Graph Grammars</a> (TGG) as a potential for formal mathemat... | habedi/stack-exchange-dataset |
92,291 | How to construct a max heap that preserves insertion order for duplicate elements? | <p>I have a priority queue (using a max heap) that preserves insertion order for duplicate priorities, such that equal priorities fall back to FIFO behaviour. I'm doing this by creating a node with the value, the priority, and an 'insertion stamp' that is basically an incrementing number on the structure. I'd like to r... | data structures heaps | 1 | How to construct a max heap that preserves insertion order for duplicate elements? -- (data structures heaps)
<p>I have a priority queue (using a max heap) that preserves insertion order for duplicate priorities, such that equal priorities fall back to FIFO behaviour. I'm doing this by creating a node with the value, t... | habedi/stack-exchange-dataset |
92,305 | Solving the emptiness problem for a CFG in Chomsky normal form (linear) | <p>Given a CFG in Chomsky normal form, is there an algorithm that solves the emptiness problem in linear runtime? I thought about using depth search here, but I think it's a little bit above linear runtime.</p>
 | context free | 1 | Solving the emptiness problem for a CFG in Chomsky normal form (linear) -- (context free)
<p>Given a CFG in Chomsky normal form, is there an algorithm that solves the emptiness problem in linear runtime? I thought about using depth search here, but I think it's a little bit above linear runtime.</p>
 | habedi/stack-exchange-dataset |
92,316 | Implications of Integral linear program | <p>Let $(P)$ an <em>Integer Linear Program</em>, where we aim to find $x\in \{0,1\}^n$ maximizing a linear function $f:\mathbb{R}^n\rightarrow\mathbb{R}$ under some linear constraints $Ax\le b$</p>

<p>Let $(P^*)$ be its relaxation, which means that the constraint $x\in \{0,1\}^n$ is replaced by $x\in [0,1]^n$.... | optimization integer programming mathematical programming | 1 | Implications of Integral linear program -- (optimization integer programming mathematical programming)
<p>Let $(P)$ an <em>Integer Linear Program</em>, where we aim to find $x\in \{0,1\}^n$ maximizing a linear function $f:\mathbb{R}^n\rightarrow\mathbb{R}$ under some linear constraints $Ax\le b$</p>

<p>Let $(P... | habedi/stack-exchange-dataset |
92,322 | Are process-safe mutexes shared between OSes? | <p>I understand you can use process wide mutexes, but does this still apply if you have an additional virtualized operating system provisioned?</p>

<p>For example, take two OSes: <code>O1</code> and <code>O2</code> where <code>O2</code> is a virtualized OS provisioned on <code>O1</code>. Now take some code <co... | operating systems concurrency os kernel | 1 | Are process-safe mutexes shared between OSes? -- (operating systems concurrency os kernel)
<p>I understand you can use process wide mutexes, but does this still apply if you have an additional virtualized operating system provisioned?</p>

<p>For example, take two OSes: <code>O1</code> and <code>O2</code> where... | habedi/stack-exchange-dataset |
92,333 | Necessity to define co-NP in the first place? | <p>I've recently started to deal with complexity theory and I'm trying to wrap my head around all the definitions and why they make sense. </p>

<p>One thing I don't quite understand is the importance/necessity of co-NP as its own set/class of problems. Couldn't for example TAUT be classified as a NP-complete p... | complexity theory co np | 1 | Necessity to define co-NP in the first place? -- (complexity theory co np)
<p>I've recently started to deal with complexity theory and I'm trying to wrap my head around all the definitions and why they make sense. </p>

<p>One thing I don't quite understand is the importance/necessity of co-NP as its own set/cl... | habedi/stack-exchange-dataset |
92,336 | Suffix array construction algorithm linear complexity constant | <p>A non-recursive linear Suffix Array construction algorithm is presented in this thesis: <a href="https://www.uni-ulm.de/fileadmin/website_uni_ulm/iui.inst.190/Mitarbeiter/baier/gsaca.pdf" rel="nofollow noreferrer">Linear-time Suffix Sorting</a>. The author claims that, overall, the algorithm runs at $O(n)$. While it... | algorithm analysis time complexity suffix array | 1 | Suffix array construction algorithm linear complexity constant -- (algorithm analysis time complexity suffix array)
<p>A non-recursive linear Suffix Array construction algorithm is presented in this thesis: <a href="https://www.uni-ulm.de/fileadmin/website_uni_ulm/iui.inst.190/Mitarbeiter/baier/gsaca.pdf" rel="nofollow... | habedi/stack-exchange-dataset |
92,351 | Temporal logic - mixing AF and AG in CTL formula | <p>Let's look at example <code>AF(φ1 -> AG(φ2))</code>.</p>

<p>Does it mean that:</p>

<ol>
<li>In all paths it eventually happens that if φ1 was satisfied, φ2 is satisfied <strong>all along the path (so it basically means φ2 is satisfied in all states in all paths)</strong></li>
</ol>
&... | temporal logic | 1 | Temporal logic - mixing AF and AG in CTL formula -- (temporal logic)
<p>Let's look at example <code>AF(φ1 -> AG(φ2))</code>.</p>

<p>Does it mean that:</p>

<ol>
<li>In all paths it eventually happens that if φ1 was satisfied, φ2 is satisfied <strong>all along the path (so it basically means φ2 i... | habedi/stack-exchange-dataset |
92,355 | Are there any estimated, imperfect or fuzzy sorting algorithms? | <p>I'm implementing some estimation metrics that take samples of optimisation functions and estimate their properties. One of the metrics requires the data to be sorted; however, since the metric is only an estimation, I was wondering if I could get a comparatively accurate result if the data wasn't sorted precisely, b... | algorithms sorting nondeterminism fuzzy logic | 1 | Are there any estimated, imperfect or fuzzy sorting algorithms? -- (algorithms sorting nondeterminism fuzzy logic)
<p>I'm implementing some estimation metrics that take samples of optimisation functions and estimate their properties. One of the metrics requires the data to be sorted; however, since the metric is only a... | habedi/stack-exchange-dataset |
92,357 | Is z-buffering the same as rasterization? | <p>I understand z-buffering as being "object-first" in contrast to "pixel-first" since the for loop starts with checking each triangle in the scene rather than each pixel. However, is this the same as rasterization, or is rasterization just a general technique that encompasses z-buffering?</p>
 | graphics | 1 | Is z-buffering the same as rasterization? -- (graphics)
<p>I understand z-buffering as being "object-first" in contrast to "pixel-first" since the for loop starts with checking each triangle in the scene rather than each pixel. However, is this the same as rasterization, or is rasterization just a general technique th... | habedi/stack-exchange-dataset |
92,360 | Does an algorithm exist for scheduling jobs on two processors? | <p>I have two processors, and I want to schedule as many jobs as I can. I have their starting time and finishing time, and each job has to be unique to a processor (no overlap). I looked around and found one processor, or <code>n</code> processors - but none for two. I thought it'd be popular but I can't find if anyone... | algorithms runtime analysis greedy algorithms scheduling | 1 | Does an algorithm exist for scheduling jobs on two processors? -- (algorithms runtime analysis greedy algorithms scheduling)
<p>I have two processors, and I want to schedule as many jobs as I can. I have their starting time and finishing time, and each job has to be unique to a processor (no overlap). I looked around a... | habedi/stack-exchange-dataset |
92,368 | Shortest path in a maze where you can break one wall | <p>How would I solve the following problem?</p>

<p>You have maps of parts of the space station, each starting at a prison exit
and ending at the door to an escape pod. The map is represented as a
matrix of 0s and 1s, where 0s are passable space and 1s are impassable
walls. The door out of the priso... | algorithms graphs shortest path | 1 | Shortest path in a maze where you can break one wall -- (algorithms graphs shortest path)
<p>How would I solve the following problem?</p>

<p>You have maps of parts of the space station, each starting at a prison exit
and ending at the door to an escape pod. The map is represented as a
matrix of 0s and ... | habedi/stack-exchange-dataset |
92,373 | In the Traveling Salesperson Problem, is the shortest tour the same regardless of the start/return city? How do you prove it? | <p>This is the form of the problem where you start at a city, visit every other city, and return to the start city. Since you "return" to every city in the completed cycle, it seems intuitive that the cycle would be the same regardless of the starting city.</p>
 | traveling salesman | 1 | In the Traveling Salesperson Problem, is the shortest tour the same regardless of the start/return city? How do you prove it? -- (traveling salesman)
<p>This is the form of the problem where you start at a city, visit every other city, and return to the start city. Since you "return" to every city in the completed cycl... | habedi/stack-exchange-dataset |
92,380 | Maximizing the sum from m stacks using k pop's | <p>Assume you have <strong>m</strong> stacks each some elements within it. If you are allowed to do <strong>k</strong> pops , the objective is to maximize the sum(<em>sum increases by the value of the popped element</em>). What is the best algorithm which would be able to solve this problem.<br>
Can the complexity ... | algorithms complexity theory stacks | 1 | Maximizing the sum from m stacks using k pop's -- (algorithms complexity theory stacks)
<p>Assume you have <strong>m</strong> stacks each some elements within it. If you are allowed to do <strong>k</strong> pops , the objective is to maximize the sum(<em>sum increases by the value of the popped element</em>). What is t... | habedi/stack-exchange-dataset |
92,382 | is it possible to have a mapping reduction between 2 NP complete languages? | <p>so i have a good understanding about languages that belong to NP, P and NP complete, and how Polynomial reduction works between languages that belong to those areas. but i just can't figure out a conclusion about mapping reduction between languages in those areas.
for example if i have 2 languages - A and B, th... | computability np complete reductions | 1 | is it possible to have a mapping reduction between 2 NP complete languages? -- (computability np complete reductions)
<p>so i have a good understanding about languages that belong to NP, P and NP complete, and how Polynomial reduction works between languages that belong to those areas. but i just can't figure out a co... | habedi/stack-exchange-dataset |
92,387 | How to apply Operational Semantics to this function | <p>Say I have a function like this:</p>

<pre><code>function colorize(integer) {
 var hex = '#'

 if (integer > 1) hex += 'ff'
 else hex += '00'
 if (integer < 100) hex += 'aa'
 else hex += 'bb'
 if (integer > 10) hex += '11'
 else hex += '22'

 return he... | logic proof techniques formal methods software verification | 1 | How to apply Operational Semantics to this function -- (logic proof techniques formal methods software verification)
<p>Say I have a function like this:</p>

<pre><code>function colorize(integer) {
 var hex = '#'

 if (integer > 1) hex += 'ff'
 else hex += '00'
 if (integer < 100) ... | habedi/stack-exchange-dataset |
92,401 | What is the fastest way to bytewise examine the contetnt of quadword | <p>I have the following byte: <code>0x0A</code> and I need to test if a quadword contains it or no using standard bitwise operarion (or, nor, xor). For instance:</p>

<p>0x1689FFBB768922AC ---> false
0x106489320A792399 ---> true</p>

<p>Unfortunately I cannot use intel SSE2 extension because this wi... | algorithms testing | 1 | What is the fastest way to bytewise examine the contetnt of quadword -- (algorithms testing)
<p>I have the following byte: <code>0x0A</code> and I need to test if a quadword contains it or no using standard bitwise operarion (or, nor, xor). For instance:</p>

<p>0x1689FFBB768922AC ---> false
0x106489320A792... | habedi/stack-exchange-dataset |
92,402 | What is sub graph isomorphism? | <p>I am confused about the definition of sub graph isomorphism, wikipedia says that the subgraph isomorphism problem is a computational task in which two graphs $G$ and $H$ are given as input, and one must determine whether $G$ contains a subgraph that is isomorphic to $H$.</p>

<p>Is this the correct statement... | graph isomorphism | 1 | What is sub graph isomorphism? -- (graph isomorphism)
<p>I am confused about the definition of sub graph isomorphism, wikipedia says that the subgraph isomorphism problem is a computational task in which two graphs $G$ and $H$ are given as input, and one must determine whether $G$ contains a subgraph that is isomorphic... | habedi/stack-exchange-dataset |
92,409 | Calculate ϴ dependent on n for an algorithm with constant c | <p>I want to calculate ϴ dependent on n for this algorithm:</p>

<pre><code>for (k = n; k < c; k++){
 j = 1;
 while(j < n){
 j++;
 }
</code></pre>

<p>n is the parameter. c is a constant.</p>

<p>I calculated the amount of operations to (c-n)*(n-1). But ... | algorithms complexity theory algorithm analysis | 1 | Calculate ϴ dependent on n for an algorithm with constant c -- (algorithms complexity theory algorithm analysis)
<p>I want to calculate ϴ dependent on n for this algorithm:</p>

<pre><code>for (k = n; k < c; k++){
 j = 1;
 while(j < n){
 j++;
 }
</code></pre>

<... | habedi/stack-exchange-dataset |
92,410 | Why is the start symbol "not allowed" on the right hand side in Chomsky normal form? | <p>I had a question regarding CNF (Chomsky normal form) in formal language theory.</p>

<p>I noticed that a lot of authors (including my own professor, and the Wikipedia page for CNF) frown upon or don't allow the start symbol to be on the right hand side of the production. However, I just can't wrap my head ar... | formal languages context free formal grammars normal forms | 1 | Why is the start symbol "not allowed" on the right hand side in Chomsky normal form? -- (formal languages context free formal grammars normal forms)
<p>I had a question regarding CNF (Chomsky normal form) in formal language theory.</p>

<p>I noticed that a lot of authors (including my own professor, and the Wik... | habedi/stack-exchange-dataset |
92,419 | Why do we have free variables in mu-calculus? | <p>I'm reading the <em>Model Chekcing</em> book of E. M. Clarke and in the chapter about µ-calculus there is an example formula
$$
f = \mu Z. ((q \mathrel{\mathrm{AND}} Y) \mathrel{\mathrm{OR}} \langle a \rangle Z)
$$
As the author has mentioned, here $Y$ is a free variable, and we need an association l... | model checking mu calculus | 1 | Why do we have free variables in mu-calculus? -- (model checking mu calculus)
<p>I'm reading the <em>Model Chekcing</em> book of E. M. Clarke and in the chapter about µ-calculus there is an example formula
$$
f = \mu Z. ((q \mathrel{\mathrm{AND}} Y) \mathrel{\mathrm{OR}} \langle a \rangle Z)
$$
As the a... | habedi/stack-exchange-dataset |
92,421 | Does $R(L_1\cdot L_2)=L_2\cdot L_1$? | <p>Does $R(L_1\cdot L_2)=L_2\cdot L_1$?</p>

<p>Where $R$ is the reverse.</p>

<p>I can't think about counter example</p>
 | formal languages | 1 | Does $R(L_1\cdot L_2)=L_2\cdot L_1$? -- (formal languages)
<p>Does $R(L_1\cdot L_2)=L_2\cdot L_1$?</p>

<p>Where $R$ is the reverse.</p>

<p>I can't think about counter example</p>
 | habedi/stack-exchange-dataset |
92,426 | How are lookup tables described from the perspective of complexity theory? | <p>Lookup tables can convert a piece of computational time into space. I remember that it was a part of a complexity theory course, but I cannot recall how it's called in its terms. I know how to use lookup tables in code to increase performance of my applications, so I don't need a definition of it in common sense.</p... | complexity theory terminology | 1 | How are lookup tables described from the perspective of complexity theory? -- (complexity theory terminology)
<p>Lookup tables can convert a piece of computational time into space. I remember that it was a part of a complexity theory course, but I cannot recall how it's called in its terms. I know how to use lookup tab... | habedi/stack-exchange-dataset |
92,431 | Lower bound for point set triangulation | <p>How can I show that the lower bound for getting a triangulation from a point set in the plane is $\Omega(n \log n)$?</p>

<p>I know that the lower bound for finding the convex hull for a point set is also $\Omega(n \log n)$. Is it valid to argue that since the convex hull is also part of the triangulation it... | time complexity convex hull | 1 | Lower bound for point set triangulation -- (time complexity convex hull)
<p>How can I show that the lower bound for getting a triangulation from a point set in the plane is $\Omega(n \log n)$?</p>

<p>I know that the lower bound for finding the convex hull for a point set is also $\Omega(n \log n)$. Is it valid... | habedi/stack-exchange-dataset |
92,432 | Operation with second-order logic formulas | <p>I have one or more second-order logic formulas that correct for some finity model. What operation can I perform on them, so that resault is also correct for some finity model?</p>

<p>Just conjunction is impossible, example:
$x$ has finity model, $\lnot x$ has finity model, but $x \wedge \lnot x$ has not... | logic | 1 | Operation with second-order logic formulas -- (logic)
<p>I have one or more second-order logic formulas that correct for some finity model. What operation can I perform on them, so that resault is also correct for some finity model?</p>

<p>Just conjunction is impossible, example:
$x$ has finity model, $\ln... | habedi/stack-exchange-dataset |
92,438 | Understanding Hoare Logic Axioms | <p>Given these <a href="http://umathur3.web.engr.illinois.edu/documents/slides/hoare.pdf" rel="nofollow noreferrer">5 axioms</a> of <a href="https://en.wikipedia.org/wiki/Hoare_logic" rel="nofollow noreferrer">Hoare Logic</a>:</p>

<p>\begin{array}{cl}
\frac{}{\{\phi([x \leftarrow E])\}\ x := E\ \{\phi(x)\}... | proof techniques hoare logic | 1 | Understanding Hoare Logic Axioms -- (proof techniques hoare logic)
<p>Given these <a href="http://umathur3.web.engr.illinois.edu/documents/slides/hoare.pdf" rel="nofollow noreferrer">5 axioms</a> of <a href="https://en.wikipedia.org/wiki/Hoare_logic" rel="nofollow noreferrer">Hoare Logic</a>:</p>

<p>\begin{arr... | habedi/stack-exchange-dataset |
92,441 | How to use Hoare Logic to Prove this Assertion | <p>Given <a href="http://fsl.cs.illinois.edu/images/6/61/CS522-Fall-2009-11-Hoare-Logic.pdf" rel="nofollow noreferrer">this assertion</a> in Hoare Logic:</p>

<p>\begin{align}
&\mathbf{\{p >= 0\}}\\
&s = 0 ; n = 1 ;\\
&\mathtt{while}\ (n <= p)\ \{\\
&\quad s = s + n ;\\
... | formal methods software verification hoare logic | 1 | How to use Hoare Logic to Prove this Assertion -- (formal methods software verification hoare logic)
<p>Given <a href="http://fsl.cs.illinois.edu/images/6/61/CS522-Fall-2009-11-Hoare-Logic.pdf" rel="nofollow noreferrer">this assertion</a> in Hoare Logic:</p>

<p>\begin{align}
&\mathbf{\{p >= 0\}}\\&#... | habedi/stack-exchange-dataset |
92,444 | The difference between a Hoare Triple/Assertion and a Typed Function | <p>I have been trying to wrap my head around applying Hoare Logic and am running into the question of how Hoare triples are any different from (simply) a typed function.</p>

<p>That is, say you have a typed function $f : A \to B$. The initial state for the function is thus $A$, and the final state is $B$. Simi... | type theory hoare logic | 1 | The difference between a Hoare Triple/Assertion and a Typed Function -- (type theory hoare logic)
<p>I have been trying to wrap my head around applying Hoare Logic and am running into the question of how Hoare triples are any different from (simply) a typed function.</p>

<p>That is, say you have a typed functi... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.