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
95,806
What is hardware trap?
<p>Since it's called a trap I consider it caused by software, so why it's called a hardware trap? And how does it work?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/VSezf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VSezf.png" alt="hardtrap"></a></p>&#xA;
operating systems
1
What is hardware trap? -- (operating systems) <p>Since it's called a trap I consider it caused by software, so why it's called a hardware trap? And how does it work?</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/VSezf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VSezf.png" alt="hardtrap"></a>...
habedi/stack-exchange-dataset
95,820
Why does everyone say that NFA guesses it's next state?
<p><a href="https://i.stack.imgur.com/fas2U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fas2U.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>In the picture above e is an empty string, and a is a symbol from an alphabet. Every book or professor I have heard from, says than when we ma...
finite automata terminology
1
Why does everyone say that NFA guesses it's next state? -- (finite automata terminology) <p><a href="https://i.stack.imgur.com/fas2U.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fas2U.png" alt="enter image description here"></a></p>&#xA;&#xA;<p>In the picture above e is an empty string, and a is a...
habedi/stack-exchange-dataset
95,826
Algorithm to compute maximum of blocks
<p>We have $n$ numbers lying on a circle, where $n$ is even. We want to compute the maximum of any $n/2$ consecutive numbers (so, we should get $n$ values in total). </p>&#xA;&#xA;<p>One algorithm is to compute the maximum of every $n/2$ consecutive numbers separately. This leads to an $O(n^2)$ algorithm.</p>&#xA;&#xA;...
algorithms arrays
1
Algorithm to compute maximum of blocks -- (algorithms arrays) <p>We have $n$ numbers lying on a circle, where $n$ is even. We want to compute the maximum of any $n/2$ consecutive numbers (so, we should get $n$ values in total). </p>&#xA;&#xA;<p>One algorithm is to compute the maximum of every $n/2$ consecutive numbers ...
habedi/stack-exchange-dataset
95,835
If $\overline{M}$ is recursively enumerable and $A$ is recursive, what could we say about $A \cap M$?
<p>If $\overline{M}$ is recursively enumerable and $A$ is recursive, what could we say about $A \cap M$?<br>&#xA;I think that as we know nothin about $M$, in general case we can't determine wherther a random element $m$ belongs to $M$, so we coundn't say anything about $A \cap M$. Am I right?</p>&#xA;
computability
1
If $\overline{M}$ is recursively enumerable and $A$ is recursive, what could we say about $A \cap M$? -- (computability) <p>If $\overline{M}$ is recursively enumerable and $A$ is recursive, what could we say about $A \cap M$?<br>&#xA;I think that as we know nothin about $M$, in general case we can't determine wherther...
habedi/stack-exchange-dataset
95,849
IP Address CIDR Bitmask Conversion
<p>In looking for a programming function to validate an IP address within a subnet, I had to calculate the subnet mask from a given CIDR bitmask value ie. 192.168.0.0/<strong>24</strong>, the value 24 in this example.</p>&#xA;&#xA;<p>The first step is to convert the bitmask value (24) into an unsigned 32bit integer. I...
computer networks arithmetic
1
IP Address CIDR Bitmask Conversion -- (computer networks arithmetic) <p>In looking for a programming function to validate an IP address within a subnet, I had to calculate the subnet mask from a given CIDR bitmask value ie. 192.168.0.0/<strong>24</strong>, the value 24 in this example.</p>&#xA;&#xA;<p>The first step is...
habedi/stack-exchange-dataset
95,854
Prove $EXP \subset E^E$
<p>I'm trying to prove $EXP \subset E^E$ (strictly).</p>&#xA;&#xA;<p>I believe I need to construct my own $A \in E^E$ and show that $A \notin EXP$, but I cannot think of a smart way of doing that.</p>&#xA;&#xA;<p>Thanks.</p>&#xA;
complexity theory time complexity
1
Prove $EXP \subset E^E$ -- (complexity theory time complexity) <p>I'm trying to prove $EXP \subset E^E$ (strictly).</p>&#xA;&#xA;<p>I believe I need to construct my own $A \in E^E$ and show that $A \notin EXP$, but I cannot think of a smart way of doing that.</p>&#xA;&#xA;<p>Thanks.</p>&#xA;
habedi/stack-exchange-dataset
95,855
Haskell type class and initial algebra
<p>For the example below, I am trying to understand how Haskell type classes, type class instances, and data types relate to the concept of <a href="https://www.wikiwand.com/en/Initial_algebra" rel="nofollow noreferrer">initial algebra</a>.&#xA;There are two Haskell data types sharing a pair of operations for equality ...
haskell
1
Haskell type class and initial algebra -- (haskell) <p>For the example below, I am trying to understand how Haskell type classes, type class instances, and data types relate to the concept of <a href="https://www.wikiwand.com/en/Initial_algebra" rel="nofollow noreferrer">initial algebra</a>.&#xA;There are two Haskell d...
habedi/stack-exchange-dataset
95,859
Peterson Algorithm for process synchronisation
<p>Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below.</p>&#xA;&#xA;<p>repeat</p>&#xA;&#xA;<pre><code>flag[i] = true;&#xA;turn = j;&#xA;while (P) do no-op;&#xA;Enter critical section, perform actions, then&#xA;exit critical section...
operating systems
1
Peterson Algorithm for process synchronisation -- (operating systems) <p>Consider Peterson's algorithm for mutual exclusion between two concurrent processes i and j. The program executed by process is shown below.</p>&#xA;&#xA;<p>repeat</p>&#xA;&#xA;<pre><code>flag[i] = true;&#xA;turn = j;&#xA;while (P) do no-op;&#xA;E...
habedi/stack-exchange-dataset
95,868
Length of longest arithmetic progression in an array
<p>I was reading an article on <a href="https://www.geeksforgeeks.org/length-of-the-longest-arithmatic-progression-in-a-sorted-array/" rel="nofollow noreferrer">Longest Arithmetic Progression</a>. The solution given has S(n)=$O(n^2)$. Can't I solve it in $O(1)$ space? To find the three elements, we first fix an element...
dynamic programming
1
Length of longest arithmetic progression in an array -- (dynamic programming) <p>I was reading an article on <a href="https://www.geeksforgeeks.org/length-of-the-longest-arithmatic-progression-in-a-sorted-array/" rel="nofollow noreferrer">Longest Arithmetic Progression</a>. The solution given has S(n)=$O(n^2)$. Can't I...
habedi/stack-exchange-dataset
95,876
Applicative-order languages don't support constant time array writes? If not, why not?
<p>I'm reading Steven Skiena's "The Algorithm Design Manual", and in one of his <em>War Stories</em> on page 155 he states:</p>&#xA;&#xA;<blockquote>&#xA; <p>Efficiency is a great challenge in Mathematica, due to its applicative&#xA; model of computation (it does not support constant-time write&#xA; operations to ar...
arrays
1
Applicative-order languages don't support constant time array writes? If not, why not? -- (arrays) <p>I'm reading Steven Skiena's "The Algorithm Design Manual", and in one of his <em>War Stories</em> on page 155 he states:</p>&#xA;&#xA;<blockquote>&#xA; <p>Efficiency is a great challenge in Mathematica, due to its app...
habedi/stack-exchange-dataset
95,887
Correct cost function of multi classification problem using neural network?
<p>I am going through machine learning course on coursera. While going through the section on neural networks I came across the cost function for multi - classification problem using neural networks ( ignoring the regularization term ):&#xA;$$\begin{gather*} J(\Theta) = - \frac{1}{m} \sum_{i=1}^m \sum_{k=1}^K \left[y^{...
machine learning neural networks
1
Correct cost function of multi classification problem using neural network? -- (machine learning neural networks) <p>I am going through machine learning course on coursera. While going through the section on neural networks I came across the cost function for multi - classification problem using neural networks ( ignor...
habedi/stack-exchange-dataset
95,891
Compute context free grammars for twice the amount
<p>$$\{ a^{k}b^{j} : k = 2j , k \geq 0\}$$</p>&#xA;&#xA;<p>I'm trying to wrap my head around CFG's but I am having trouble. From this language, there should be twice as many a's than b's. Here is my attempt.</p>&#xA;&#xA;<p>$$S \to aSb \ | \ a Sa \ | \ \epsilon $$</p>&#xA;&#xA;<p>$$S \Rightarrow aSb \Rightarrow aaSbb \...
context free
1
Compute context free grammars for twice the amount -- (context free) <p>$$\{ a^{k}b^{j} : k = 2j , k \geq 0\}$$</p>&#xA;&#xA;<p>I'm trying to wrap my head around CFG's but I am having trouble. From this language, there should be twice as many a's than b's. Here is my attempt.</p>&#xA;&#xA;<p>$$S \to aSb \ | \ a Sa \ | ...
habedi/stack-exchange-dataset
95,896
Why does parallelising slow down this simple problem against looping through all the data?
<p>I've been using multiprocessing and parallelisation for the first time this week on a very large data set using 32 CPUs. I decided to explore it for a smaller task just to see if I could learn anything, just on the 4 CPUs of my Mac.</p>&#xA;&#xA;<p>I created a task to add 100 to every element in a 500,000 element li...
runtime analysis efficiency cpu python multi tasking
1
Why does parallelising slow down this simple problem against looping through all the data? -- (runtime analysis efficiency cpu python multi tasking) <p>I've been using multiprocessing and parallelisation for the first time this week on a very large data set using 32 CPUs. I decided to explore it for a smaller task just...
habedi/stack-exchange-dataset
95,899
Divide an array into two sub arrays such that their sums are equal and possibly maximum
<p>Given an array A, we should partition A into two subarrays whose sums are equal, and that maximizes this sum. We are free to omit items from the subarrays.</p>&#xA;&#xA;<p>For example, <code>[7,2,5,7,12]</code> can be divided as the following:</p>&#xA;&#xA;<ol>&#xA;<li><code>[5,2][7] = 7</code></li>&#xA;<li><code>[...
dynamic programming partitions backtracking
1
Divide an array into two sub arrays such that their sums are equal and possibly maximum -- (dynamic programming partitions backtracking) <p>Given an array A, we should partition A into two subarrays whose sums are equal, and that maximizes this sum. We are free to omit items from the subarrays.</p>&#xA;&#xA;<p>For exa...
habedi/stack-exchange-dataset
95,917
If $L=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)=\Sigma^* \big\}$ is in $RE$ or $coRE$ or not in $RE\cup coRE$?
<p>I tried to solve it as the following:&#xA;$$\overline{L}=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)\neq\Sigma^* \big\}$$&#xA;I'll show that $\overline{L}\not\in RE$ by reduction from $$\overline{A_{TM}} = \big\{ \langle M, w \rangle \mid M \text{ is TM and }M \text{ rejects } w \b...
turing machines reductions
1
If $L=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)=\Sigma^* \big\}$ is in $RE$ or $coRE$ or not in $RE\cup coRE$? -- (turing machines reductions) <p>I tried to solve it as the following:&#xA;$$\overline{L}=\big\{\langle M_1,M_2\rangle\mid M_1, M_2\text{ are TM and } L(M_1)\cup L(M_1)\n...
habedi/stack-exchange-dataset
95,920
How to solve for the precondition give a postcondtion that must satisfy two conditions
<p>I tried solving past exam question but there is this one that I haven't been able to solve.</p>&#xA;&#xA;<p>The question states that a suitable precondition should be found for the statement.</p>&#xA;&#xA;<p>$$&#xA; a= i +2; i++\{(a = 7)\land(i = 5)\}&#xA;$$&#xA;Here's my solution and where I got stuck:</p>&#xA;&#xA...
logic formal methods hoare logic
1
How to solve for the precondition give a postcondtion that must satisfy two conditions -- (logic formal methods hoare logic) <p>I tried solving past exam question but there is this one that I haven't been able to solve.</p>&#xA;&#xA;<p>The question states that a suitable precondition should be found for the statement.<...
habedi/stack-exchange-dataset
95,922
SAT Solving + Turing Machines
<p>I have a couple of questions based on how SAT solvers work. I understand that SAT solvers may employ any/all of the following techniques:</p>&#xA;&#xA;<ul>&#xA;<li>Randomness</li>&#xA;<li>Heuristics</li>&#xA;<li>Backtracking</li>&#xA;</ul>&#xA;&#xA;<p>SAT is just one example of an NP-complete problem. Is it common t...
turing machines np complete heuristics probabilistic algorithms backtracking
1
SAT Solving + Turing Machines -- (turing machines np complete heuristics probabilistic algorithms backtracking) <p>I have a couple of questions based on how SAT solvers work. I understand that SAT solvers may employ any/all of the following techniques:</p>&#xA;&#xA;<ul>&#xA;<li>Randomness</li>&#xA;<li>Heuristics</li>&#...
habedi/stack-exchange-dataset
95,935
Is there a complexity class “BQP without error”?
<p>I was wondering if there is a complexity class for problems that can be solved efficiently by a quantum computer such that it always gives the right answer? For example the Deutsch-Josza algorithm never fails. Another way of asking would be: is there a class (call it Q) such that Q is to P what BQP is to BPP?</p>&#x...
complexity classes quantum computing randomness
1
Is there a complexity class “BQP without error”? -- (complexity classes quantum computing randomness) <p>I was wondering if there is a complexity class for problems that can be solved efficiently by a quantum computer such that it always gives the right answer? For example the Deutsch-Josza algorithm never fails. Anoth...
habedi/stack-exchange-dataset
95,939
Applying a permutation on a sequence with multiplication
<p>We are given a sequence of $n$ numbers called $\alpha$ and an arbitrary number $x$. Give an algorithm to find a permutation $\pi$ of size $n$ such that $\sum_{i=1}^n{\alpha_i.\pi_i} = x$ or tell if there is none. </p>&#xA;&#xA;<p>Well I wasn't able to solve it in polynomial time and I'm not sure whether it's possib...
algorithms np complete decision problem permutations
1
Applying a permutation on a sequence with multiplication -- (algorithms np complete decision problem permutations) <p>We are given a sequence of $n$ numbers called $\alpha$ and an arbitrary number $x$. Give an algorithm to find a permutation $\pi$ of size $n$ such that $\sum_{i=1}^n{\alpha_i.\pi_i} = x$ or tell if ther...
habedi/stack-exchange-dataset
95,942
Edit distance for huge strings with bounds
<p>My question is simple but I don't know if the answer is.</p>&#xA;&#xA;<blockquote>&#xA; <p>If you have two strings of length 10 million each, is there an algorithm that would allow you in&#xA; practice to compute their <a href="https://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow noreferrer">edit dist...
algorithms edit distance
1
Edit distance for huge strings with bounds -- (algorithms edit distance) <p>My question is simple but I don't know if the answer is.</p>&#xA;&#xA;<blockquote>&#xA; <p>If you have two strings of length 10 million each, is there an algorithm that would allow you in&#xA; practice to compute their <a href="https://en.wik...
habedi/stack-exchange-dataset
95,947
Why is this n^2 growth?
<p>I am attempting to understand the growth of the following algorithm, which is described as $n^2$ growth in the book I am reading:</p>&#xA;&#xA;<p>"... performs of the order of $n^2$ steps on a sequence of length $n$."</p>&#xA;&#xA;<p>Could someone please explain how this is calculated in the following code, which is...
algorithms algorithm analysis python
1
Why is this n^2 growth? -- (algorithms algorithm analysis python) <p>I am attempting to understand the growth of the following algorithm, which is described as $n^2$ growth in the book I am reading:</p>&#xA;&#xA;<p>"... performs of the order of $n^2$ steps on a sequence of length $n$."</p>&#xA;&#xA;<p>Could someone ple...
habedi/stack-exchange-dataset
95,949
Define a grammar to emmulate chess rules
<p>Is it possible to define a 《chess language》:&#xA;language={alphabet = {(chess pieces, squares of chess board)}, grammar={rules of movement of pieces over the board}}?</p>&#xA;&#xA;<p>I looked online but I cannot find a way to define the grammar. Every way I can think of, is either stupidly long and complicated, or d...
formal languages regular languages automata formal grammars
1
Define a grammar to emmulate chess rules -- (formal languages regular languages automata formal grammars) <p>Is it possible to define a 《chess language》:&#xA;language={alphabet = {(chess pieces, squares of chess board)}, grammar={rules of movement of pieces over the board}}?</p>&#xA;&#xA;<p>I looked online but I cannot...
habedi/stack-exchange-dataset
95,951
Is there a name and efficient algorithm for this Tree Traversal method?
<p>Consider a tree structured task list where intermediate nodes define sub-groupings of tasks but are not tasks themselves, and the leaves represent the actual tasks.</p>&#xA;&#xA;<p>I want to traverse this type of tree giving <strong>equal opportunity/priority/time(?)</strong> for each group with respect to its paren...
algorithms data structures trees
1
Is there a name and efficient algorithm for this Tree Traversal method? -- (algorithms data structures trees) <p>Consider a tree structured task list where intermediate nodes define sub-groupings of tasks but are not tasks themselves, and the leaves represent the actual tasks.</p>&#xA;&#xA;<p>I want to traverse this ty...
habedi/stack-exchange-dataset
95,958
Deletion from 2,3,4 tree
<p>Consider a 2,3,4 tree like so,</p>&#xA;&#xA;<pre><code> 53&#xA; / \&#xA; / \&#xA; / \&#xA; 46 60 | 70&#xA; / \ / \ \ &#xA; / \ / \ \ &#xA; / \ / \ \ &#xA; 41 48 55|59 65|68 73|75|79 &#xA;</code><...
search trees balanced search trees
1
Deletion from 2,3,4 tree -- (search trees balanced search trees) <p>Consider a 2,3,4 tree like so,</p>&#xA;&#xA;<pre><code> 53&#xA; / \&#xA; / \&#xA; / \&#xA; 46 60 | 70&#xA; / \ / \ \ &#xA; / \ / \ \ &#xA; / \ / ...
habedi/stack-exchange-dataset
95,959
Mimimum spanning tree with a constraint on number of certain types of edges
<p>I have the the following problem.</p>&#xA;&#xA;<p>Say we have a graph $G = (V,E)$ where all $e \in E$ have positive weight, and $E$ can be separated in to two disjoint sets $E = A \cup B$. We have to find a spanning tree such that we minimize total weight but also we can only use a maximum of $c$ edges in $B$.</p>&#...
algorithms greedy algorithms weighted graphs minimum spanning tree constraint satisfaction
1
Mimimum spanning tree with a constraint on number of certain types of edges -- (algorithms greedy algorithms weighted graphs minimum spanning tree constraint satisfaction) <p>I have the the following problem.</p>&#xA;&#xA;<p>Say we have a graph $G = (V,E)$ where all $e \in E$ have positive weight, and $E$ can be separa...
habedi/stack-exchange-dataset
95,962
Breadth First Search actually require specifically Queue instead of any other type of Collection?
<p>As far as I know, <strong>Breadth-First-Search [BFS] theory traditionally requires a Queue</strong> to process a given level of a graph (i.e: <a href="https://en.wikipedia.org/wiki/Breadth-first_search" rel="nofollow noreferrer">wiki</a> seems to assume so).</p>&#xA;&#xA;<p>But <strong>does BFS really actually requi...
data structures graph traversal queues
1
Breadth First Search actually require specifically Queue instead of any other type of Collection? -- (data structures graph traversal queues) <p>As far as I know, <strong>Breadth-First-Search [BFS] theory traditionally requires a Queue</strong> to process a given level of a graph (i.e: <a href="https://en.wikipedia.org...
habedi/stack-exchange-dataset
95,988
FPTAS definition
<p>I read that a fully polynomial time approximation scheme (FPTAS) has time complexity polynomial in the input size and also polynomial in $1/\epsilon$. However, this leaves some ambiguity.</p>&#xA;&#xA;<p>For example, $T(n,1/\epsilon)=\min(n^{1/\epsilon},(1/\epsilon)^n)$ is both polynomial in $n$ (when holding $1/\ep...
algorithms complexity theory terminology
1
FPTAS definition -- (algorithms complexity theory terminology) <p>I read that a fully polynomial time approximation scheme (FPTAS) has time complexity polynomial in the input size and also polynomial in $1/\epsilon$. However, this leaves some ambiguity.</p>&#xA;&#xA;<p>For example, $T(n,1/\epsilon)=\min(n^{1/\epsilon},...
habedi/stack-exchange-dataset
95,994
Recurrence Substitution Method with multiple givens
<p>Solve by using the substitution method $T(n)=T(n-1)+2T(n-2)+3$<br>&#xA;Given $T(0)=3$ and $T(1)=5$ </p>&#xA;&#xA;<p>I kind of understand it with only one given and one recurrence call by expanding the call using what is inside.<br>&#xA;ex. if it was $T(n)=T(n-1)+3$<br>&#xA;Given $T(1)=5$<br>&#xA;I would take the $n...
algorithms time complexity recurrence relation
1
Recurrence Substitution Method with multiple givens -- (algorithms time complexity recurrence relation) <p>Solve by using the substitution method $T(n)=T(n-1)+2T(n-2)+3$<br>&#xA;Given $T(0)=3$ and $T(1)=5$ </p>&#xA;&#xA;<p>I kind of understand it with only one given and one recurrence call by expanding the call using ...
habedi/stack-exchange-dataset
96,003
Proof that (A ∪ B)∘C = A∘C ∪ B∘C where A, B and C are languages
<p>How can I prove this identity of languages?</p>&#xA;&#xA;<p>My aproach is the following:</p>&#xA;&#xA;<p>Let A, B and C to be languages, and let x to be an arbitrary string.</p>&#xA;&#xA;<p>(A ∪ B) ⇒ x ∈ A ∨ x ∈ B</p>&#xA;&#xA;<p>How do you proceed?</p>&#xA;
formal languages regular languages
1
Proof that (A ∪ B)∘C = A∘C ∪ B∘C where A, B and C are languages -- (formal languages regular languages) <p>How can I prove this identity of languages?</p>&#xA;&#xA;<p>My aproach is the following:</p>&#xA;&#xA;<p>Let A, B and C to be languages, and let x to be an arbitrary string.</p>&#xA;&#xA;<p>(A ∪ B) ⇒ x ∈ A ∨ x ∈ B...
habedi/stack-exchange-dataset
96,006
why do we run out of heap space even if we have virtual memory?
<p>Whenever we try to get space in heap(using malloc or new) we can get out of heap space error if it exceeds the limit. But, we have virtual memory so why can't OS allocate that much space and then do swapping when I need some part of it or not?</p>&#xA;
operating systems virtual memory
1
why do we run out of heap space even if we have virtual memory? -- (operating systems virtual memory) <p>Whenever we try to get space in heap(using malloc or new) we can get out of heap space error if it exceeds the limit. But, we have virtual memory so why can't OS allocate that much space and then do swapping when I ...
habedi/stack-exchange-dataset
96,009
Is huffman coding tree a heap or a trie?
<p>I study Huffman Coding tree from "Data Structures and Algorithm Analysis" of Shaffer and it says that Huffman Coding tree is an opportunity to experience a search trie. However, the code implements it with a heap class.</p>&#xA;&#xA;<p>As a result, I wonder if Huffman Coding tree is actually a heap or a trie? If it ...
huffman coding
1
Is huffman coding tree a heap or a trie? -- (huffman coding) <p>I study Huffman Coding tree from "Data Structures and Algorithm Analysis" of Shaffer and it says that Huffman Coding tree is an opportunity to experience a search trie. However, the code implements it with a heap class.</p>&#xA;&#xA;<p>As a result, I wonde...
habedi/stack-exchange-dataset
96,010
Is my interpretation correct?
<p>I am trying to implement the algorithm described in the paper <a href="https://arxiv.org/pdf/1807.04271.pdf" rel="nofollow noreferrer">A quantum-inspired classical algorithm for&#xA;recommendation systems</a>. </p>&#xA;&#xA;<p>This is the algorithm:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/75T1F.png" rel="...
algorithms complexity theory quantum computing
1
Is my interpretation correct? -- (algorithms complexity theory quantum computing) <p>I am trying to implement the algorithm described in the paper <a href="https://arxiv.org/pdf/1807.04271.pdf" rel="nofollow noreferrer">A quantum-inspired classical algorithm for&#xA;recommendation systems</a>. </p>&#xA;&#xA;<p>This is ...
habedi/stack-exchange-dataset
96,016
Problem with understanding proof of the Space Hierarchy Theorem
<p>The Space Hierarchy Theorem states that</p>&#xA;<blockquote>&#xA;<p>If <span class="math-container">$f(n)$</span> is space contructible, then for any <span class="math-container">$g(n) \in o(f(n))$</span> we have <span class="math-container">$SPACE(f(n)) \neq SPACE(g(n))$</span></p>&#xA;</blockquote>&#xA;<p>An examp...
complexity theory space complexity
1
Problem with understanding proof of the Space Hierarchy Theorem -- (complexity theory space complexity) <p>The Space Hierarchy Theorem states that</p>&#xA;<blockquote>&#xA;<p>If <span class="math-container">$f(n)$</span> is space contructible, then for any <span class="math-container">$g(n) \in o(f(n))$</span> we have ...
habedi/stack-exchange-dataset
96,017
Solve Hamilton Circuit with Hamilton Path
<p>I want to show the reduction $HC \leq HP$.<br>&#xA;Let $G=(V,E)$ be my undirected graph.</p>&#xA;&#xA;<p>My idea is: For each edge $e=(u,v) \in E$ check whether $(V,E\backslash\{e\})$ has a Hamiltonian Path. If this is true for all edges, we have a Hamiltonian circuit in $G$. </p>&#xA;&#xA;<p>It is pretty trivial to...
np complete reductions hamiltonian path hamiltonian circuit
1
Solve Hamilton Circuit with Hamilton Path -- (np complete reductions hamiltonian path hamiltonian circuit) <p>I want to show the reduction $HC \leq HP$.<br>&#xA;Let $G=(V,E)$ be my undirected graph.</p>&#xA;&#xA;<p>My idea is: For each edge $e=(u,v) \in E$ check whether $(V,E\backslash\{e\})$ has a Hamiltonian Path. If...
habedi/stack-exchange-dataset
96,024
Predicate Logic - Natural Deduction; Assumptions about exists-elimination
<p>I am stuck on how to progress with this proof; i cannot see my next move.</p>&#xA;&#xA;<p>The task is to show $S \to \exists x Q(x) \vdash \exists x (S \to Q(x))$ using natural deduction for predicate logic.</p>&#xA;&#xA;<p>My first attempt was the following;</p>&#xA;&#xA;<p>1: $S \to \exists x Q(x) \space \space \s...
logic natural deduction
1
Predicate Logic - Natural Deduction; Assumptions about exists-elimination -- (logic natural deduction) <p>I am stuck on how to progress with this proof; i cannot see my next move.</p>&#xA;&#xA;<p>The task is to show $S \to \exists x Q(x) \vdash \exists x (S \to Q(x))$ using natural deduction for predicate logic.</p>&#x...
habedi/stack-exchange-dataset
96,027
Why is $n + 2n^2 + 10n^4 = O(n^5)$?
<p>I'm going through an algorithms text book. One of the questions asks:</p>&#xA;<blockquote>&#xA;<p>True or false?</p>&#xA;<p><span class="math-container">$n + 2n^2 + 10n^4$</span> is <span class="math-container">$O(n^5)$</span>.</p>&#xA;</blockquote>&#xA;<p>This is marked as true.</p>&#xA;<p>Shouldn't it be <span cla...
asymptotics
1
Why is $n + 2n^2 + 10n^4 = O(n^5)$? -- (asymptotics) <p>I'm going through an algorithms text book. One of the questions asks:</p>&#xA;<blockquote>&#xA;<p>True or false?</p>&#xA;<p><span class="math-container">$n + 2n^2 + 10n^4$</span> is <span class="math-container">$O(n^5)$</span>.</p>&#xA;</blockquote>&#xA;<p>This is...
habedi/stack-exchange-dataset
96,038
Sorting some set of number
<p>Let $U=\{1,2,3\cdots m-1\}$ and some $n$ keys from $U$. Is it possible to sort these $n$ keys in $O(n \log \log n)$ time using $O(n)$ space?</p>&#xA;&#xA;<p>Model of computation is RAM.</p>&#xA;
sorting
1
Sorting some set of number -- (sorting) <p>Let $U=\{1,2,3\cdots m-1\}$ and some $n$ keys from $U$. Is it possible to sort these $n$ keys in $O(n \log \log n)$ time using $O(n)$ space?</p>&#xA;&#xA;<p>Model of computation is RAM.</p>&#xA;
habedi/stack-exchange-dataset
96,041
Average case of simple algorithm like binary search
<p>These questions is about one of my research. As I am not a computer scientist, formal answering is difficult to me.</p>&#xA;&#xA;<p>I have a special search algorithm which the explanation here will take a lot of time. However I can explain it shortly by some notations. </p>&#xA;&#xA;<p>Assume that we have an array ...
time complexity randomized algorithms average case
1
Average case of simple algorithm like binary search -- (time complexity randomized algorithms average case) <p>These questions is about one of my research. As I am not a computer scientist, formal answering is difficult to me.</p>&#xA;&#xA;<p>I have a special search algorithm which the explanation here will take a lot...
habedi/stack-exchange-dataset
96,043
How to show that i have significant improvements over the baselines?
<p>I had review feedbacks regarding my recent publications and reviewers argued that the improvements are not significant over the baselines.</p>&#xA;&#xA;<p>I tried my classification algorithm on some image datasets such as Extended Yale, and in the literature (other papers) i noticed the same amount of improvements i...
classification performance evaluation strategies
1
How to show that i have significant improvements over the baselines? -- (classification performance evaluation strategies) <p>I had review feedbacks regarding my recent publications and reviewers argued that the improvements are not significant over the baselines.</p>&#xA;&#xA;<p>I tried my classification algorithm on ...
habedi/stack-exchange-dataset
96,045
Why do AlphaGo and AlphaGo Zero include board history in the input features
<p>Both AlphaGo and AlphaGo Zero include prior board states as input features (the "Turns Since" planes for AlphaGo, and the repeated 8-step history planes for AlphaGo Zero).</p>&#xA;&#xA;<p>What is the purpose of including this history information in the input to the neural networks?</p>&#xA;&#xA;<p>If we ignore the k...
machine learning board games features
1
Why do AlphaGo and AlphaGo Zero include board history in the input features -- (machine learning board games features) <p>Both AlphaGo and AlphaGo Zero include prior board states as input features (the "Turns Since" planes for AlphaGo, and the repeated 8-step history planes for AlphaGo Zero).</p>&#xA;&#xA;<p>What is th...
habedi/stack-exchange-dataset
96,047
Is a sum of n terms considered O(1) or O(n)?
<p>Say I have $n$ numbers in an array and I have to compute the sum of those numbers. Is the complexity considered as $O(1)$ or $O(n)$?</p>&#xA;&#xA;<p><strong>Clarification</strong></p>&#xA;&#xA;<p>Say I have 10 constants, I could precompute the total and claim that overall, the complexity is $O(1)$. Yet, if I have 10...
complexity theory asymptotics
1
Is a sum of n terms considered O(1) or O(n)? -- (complexity theory asymptotics) <p>Say I have $n$ numbers in an array and I have to compute the sum of those numbers. Is the complexity considered as $O(1)$ or $O(n)$?</p>&#xA;&#xA;<p><strong>Clarification</strong></p>&#xA;&#xA;<p>Say I have 10 constants, I could precompu...
habedi/stack-exchange-dataset
96,048
How to construct a branching program for this function?
<p>Suppose we have a formula $F(x_1,x_2,x_3) = x_1 \vee (x_2 \land x_3)$. $F$ outputs 1 when it has a satisfying assignment and 0 otherwise.</p>&#xA;&#xA;<p>How can I convert the above formula(or any formula like this in general)to a branching program(constant width)?</p>&#xA;
algorithms
1
How to construct a branching program for this function? -- (algorithms) <p>Suppose we have a formula $F(x_1,x_2,x_3) = x_1 \vee (x_2 \land x_3)$. $F$ outputs 1 when it has a satisfying assignment and 0 otherwise.</p>&#xA;&#xA;<p>How can I convert the above formula(or any formula like this in general)to a branching prog...
habedi/stack-exchange-dataset
96,049
number of random sets needed to generate subset
<p>Let $A\subseteq \{1\ldots n\}$ with $|A|=\alpha n, 0&lt;\alpha\leq1$. Now we start generating random sets $B_i \subseteq \{1\ldots n\}$ with $|B_i|=\beta n$ where $0&lt;\beta\leq\alpha$. </p>&#xA;&#xA;<p>How many $B_i$ do we have to generate, so that there exists a $j: B_j\subseteq A$ with decent probability (consta...
probability theory randomized algorithms sets
1
number of random sets needed to generate subset -- (probability theory randomized algorithms sets) <p>Let $A\subseteq \{1\ldots n\}$ with $|A|=\alpha n, 0&lt;\alpha\leq1$. Now we start generating random sets $B_i \subseteq \{1\ldots n\}$ with $|B_i|=\beta n$ where $0&lt;\beta\leq\alpha$. </p>&#xA;&#xA;<p>How many $B_i$...
habedi/stack-exchange-dataset
96,057
PCP undecidability
<p>There is a popular proof for the undecidability of the PCP (Post correspondence problem), which is outlined here:</p>&#xA;&#xA;<p><a href="https://en.wikipedia.org/wiki/Post_correspondence_problem" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Post_correspondence_problem</a></p>&#xA;&#xA;<p>I'll assume who...
reductions undecidability
1
PCP undecidability -- (reductions undecidability) <p>There is a popular proof for the undecidability of the PCP (Post correspondence problem), which is outlined here:</p>&#xA;&#xA;<p><a href="https://en.wikipedia.org/wiki/Post_correspondence_problem" rel="nofollow noreferrer">https://en.wikipedia.org/wiki/Post_correspo...
habedi/stack-exchange-dataset
96,070
Super-strongly connected components?
<p>I face a problem that is related to (strongly) connected components. Let $G=(V,E)$ be an undirected graph.</p>&#xA;&#xA;<p>I want to find subgraphs $G_1,G_2, \dots,G_n$ of $G$ such that</p>&#xA;&#xA;<ul>&#xA;<li>they do not overlap (i.e. don't share any nodes)</li>&#xA;<li>each two nodes in a subgraph are connected ...
graphs
1
Super-strongly connected components? -- (graphs) <p>I face a problem that is related to (strongly) connected components. Let $G=(V,E)$ be an undirected graph.</p>&#xA;&#xA;<p>I want to find subgraphs $G_1,G_2, \dots,G_n$ of $G$ such that</p>&#xA;&#xA;<ul>&#xA;<li>they do not overlap (i.e. don't share any nodes)</li>&#x...
habedi/stack-exchange-dataset
96,075
Merge sort worst case running time for lexicographical sorting?
<p>A list of n strings each of length n is being sorted in lexicographical order using the merge sort algorithm. Since we have to take care of comparison of each character in the strings so the merge step would be $O(n^2)$. So the recurrence should be of the form</p>&#xA;&#xA;<blockquote>&#xA; <p>$$T(n) = 2T(\frac n2)...
algorithms asymptotics sorting mergesort
1
Merge sort worst case running time for lexicographical sorting? -- (algorithms asymptotics sorting mergesort) <p>A list of n strings each of length n is being sorted in lexicographical order using the merge sort algorithm. Since we have to take care of comparison of each character in the strings so the merge step would...
habedi/stack-exchange-dataset
96,079
what is the expected number of comparisons made before the algorithm terminates?
<p>How to approach this question ? I have no idea regarding the method to be applied for solving such kinds of problems .</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/KugUK.jpg" alt="enter image description here"></p>&#xA;
algorithms
1
what is the expected number of comparisons made before the algorithm terminates? -- (algorithms) <p>How to approach this question ? I have no idea regarding the method to be applied for solving such kinds of problems .</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/KugUK.jpg" alt="enter image description here"></p...
habedi/stack-exchange-dataset
96,082
How to calculate the weight between neurons in ANN?
<p>I am currently learning Supervised ANN training using Backpropogation and I am stuck in this exercise. I calculated the δA using the equation at the bottom of the screenshot, however, I am unable to calculate δB because the weight of BD is not given. How do I find the weight of BD?</p>&#xA;&#xA;<p><a href="https://i...
machine learning neural networks
1
How to calculate the weight between neurons in ANN? -- (machine learning neural networks) <p>I am currently learning Supervised ANN training using Backpropogation and I am stuck in this exercise. I calculated the δA using the equation at the bottom of the screenshot, however, I am unable to calculate δB because the wei...
habedi/stack-exchange-dataset
96,094
Is the symmetric difference of a non regular language L and a finite language f non regular?
<p>The symmetric difference of $L_1$ and $L_2$ is defined to be: $(L_1-L_2) \cup (L_2-L_1)$.</p>&#xA;&#xA;<p><strong>Problem:</strong> I’m trying to prove that given L a non regular language and F a finite language there symmetric difference yields a non regular language.</p>&#xA;&#xA;<p>Although this looks like it sho...
formal languages regular languages automata finite automata
1
Is the symmetric difference of a non regular language L and a finite language f non regular? -- (formal languages regular languages automata finite automata) <p>The symmetric difference of $L_1$ and $L_2$ is defined to be: $(L_1-L_2) \cup (L_2-L_1)$.</p>&#xA;&#xA;<p><strong>Problem:</strong> I’m trying to prove that gi...
habedi/stack-exchange-dataset
96,106
What does `Dv` mean in $F\star$ language?
<p>In the $F\star$ <a href="https://fstar-lang.org/tutorial/" rel="nofollow noreferrer">tutorial</a> it says</p>&#xA;&#xA;<blockquote>&#xA; <p><code>Dv</code>, the effect of a computation that may diverge;</p>&#xA;</blockquote>&#xA;&#xA;<p>what does <em>diverge</em> mean here? It's not explained and it confuses me.</p...
proof assistants fstar
1
What does `Dv` mean in $F\star$ language? -- (proof assistants fstar) <p>In the $F\star$ <a href="https://fstar-lang.org/tutorial/" rel="nofollow noreferrer">tutorial</a> it says</p>&#xA;&#xA;<blockquote>&#xA; <p><code>Dv</code>, the effect of a computation that may diverge;</p>&#xA;</blockquote>&#xA;&#xA;<p>what does...
habedi/stack-exchange-dataset
96,108
What does a faster algorithm mean in theoretical computer science?
<p>If there is an algorithm running in time $O(f(n))$ for some problem A, and somebody comes up with an algorithm running in time, $O(f(n)/g(n))$, where $g(n) = o(f(n))$, is it considered an improvement over the previous algorithm?</p>&#xA;&#xA;<blockquote>&#xA; <p>Does it make sense, in the context of theoretical com...
algorithms
1
What does a faster algorithm mean in theoretical computer science? -- (algorithms) <p>If there is an algorithm running in time $O(f(n))$ for some problem A, and somebody comes up with an algorithm running in time, $O(f(n)/g(n))$, where $g(n) = o(f(n))$, is it considered an improvement over the previous algorithm?</p>&#...
habedi/stack-exchange-dataset
96,110
Split graph in two parts, such that most nodes have even number of edges
<p>We have given graph of at most $200$ nodes, we want to split the given graph in two parts, such that the number of nodes with even number of edges is maximized, note that the edges that are between nodes of different parts are destroyed and not counted.</p>&#xA;&#xA;<p>All possible splittings are allowed, even the o...
algorithms graphs graph traversal
1
Split graph in two parts, such that most nodes have even number of edges -- (algorithms graphs graph traversal) <p>We have given graph of at most $200$ nodes, we want to split the given graph in two parts, such that the number of nodes with even number of edges is maximized, note that the edges that are between nodes o...
habedi/stack-exchange-dataset
96,111
Finding the total capacity of two communication channels
<p>I have the transition matrices of two communication channels. I am able to find the capacity of each by performing an optimization calculation, however I need the total capacity of the two channels. The channels are not weakly symmetric so I don't think I am able to simply add the two capacities. I think what I need...
information theory communication protocols
1
Finding the total capacity of two communication channels -- (information theory communication protocols) <p>I have the transition matrices of two communication channels. I am able to find the capacity of each by performing an optimization calculation, however I need the total capacity of the two channels. The channels ...
habedi/stack-exchange-dataset
96,121
Algorithm to establish a global ranking given individual rankings
<p>I am looking for an algorithm(s) that can compute a global ranking (partial ordering) given individual rankings, in some kind of principled manner.</p>&#xA;&#xA;<p>I want to establish a partial-ordering of some projects, and had some users create their own partial orderings.</p>&#xA;&#xA;<p>I've looked at these algo...
partial order
1
Algorithm to establish a global ranking given individual rankings -- (partial order) <p>I am looking for an algorithm(s) that can compute a global ranking (partial ordering) given individual rankings, in some kind of principled manner.</p>&#xA;&#xA;<p>I want to establish a partial-ordering of some projects, and had som...
habedi/stack-exchange-dataset
96,131
How to collect all states of a behavior in TLA+?
<p><strong><em>Description of the problem:</em></strong></p>&#xA;&#xA;<p>I am modeling checking a distributed protocol against a global property with <a href="https://lamport.azurewebsites.net/tla/tla.html" rel="nofollow noreferrer">TLA+ developed by Leslie Lamport</a>. The global property is defined on all states of a...
formal methods model checking tlaplus
1
How to collect all states of a behavior in TLA+? -- (formal methods model checking tlaplus) <p><strong><em>Description of the problem:</em></strong></p>&#xA;&#xA;<p>I am modeling checking a distributed protocol against a global property with <a href="https://lamport.azurewebsites.net/tla/tla.html" rel="nofollow norefer...
habedi/stack-exchange-dataset
96,161
Probability that a random graph will remain planar after adding an edge
<p>According to <a href="https://math.stackexchange.com/a/735012/320116">this answer</a>, a random graph on $n$ vertices is a graph which has each of the $n\choose2$ edges independently with probability $1/2$ each. The probability of at most $3n-6$ edges (which is a necessary condition for planarity) is: $$2^{-n(n-1)/2...
graphs probability theory
1
Probability that a random graph will remain planar after adding an edge -- (graphs probability theory) <p>According to <a href="https://math.stackexchange.com/a/735012/320116">this answer</a>, a random graph on $n$ vertices is a graph which has each of the $n\choose2$ edges independently with probability $1/2$ each. Th...
habedi/stack-exchange-dataset
96,168
Proof of correctness of reversal algorithm for array rotation
<p>We are given an array A of size n and we have to rotate it in left direction by d positions. So e.g. if <code>A = {1, 2, 3, 4, 5, 6, 7}</code> then for <code>d = 2</code>, the resultant rotated array is <code>{3, 4, 5, 6, 7, 1, 2}</code>.</p>&#xA;&#xA;<p>One algorithm which does this goes as follows:</p>&#xA;&#xA;<o...
algorithms arrays
1
Proof of correctness of reversal algorithm for array rotation -- (algorithms arrays) <p>We are given an array A of size n and we have to rotate it in left direction by d positions. So e.g. if <code>A = {1, 2, 3, 4, 5, 6, 7}</code> then for <code>d = 2</code>, the resultant rotated array is <code>{3, 4, 5, 6, 7, 1, 2}</...
habedi/stack-exchange-dataset
96,172
Chernoff-like Concentration Bounds on Permutations
<p>Suppose I have $n$ balls. Among them, there are $m \leq n$ black balls and the other $n - m$ balls are white. Fix a random permutation $\pi$ over these balls and denote by $Y_i$ the number of black balls in the first $i$ positions of our permutation $\pi$. I would like to show that $Y_i$ is sharply concentrated arou...
permutations chernoff bounds
1
Chernoff-like Concentration Bounds on Permutations -- (permutations chernoff bounds) <p>Suppose I have $n$ balls. Among them, there are $m \leq n$ black balls and the other $n - m$ balls are white. Fix a random permutation $\pi$ over these balls and denote by $Y_i$ the number of black balls in the first $i$ positions o...
habedi/stack-exchange-dataset
96,177
Path in a vertex-weighted undirected graph
<p>Is it an $NP$-hard problem?</p>&#xA;&#xA;<p>You're given an undirected graph $G(V,E)$ with vertex weight $w: V \to \mathbb{N}$ and a function $\mathrm{max}$-$\mathrm{visit}: V \to \mathbb{N}$ and a number $W$.</p>&#xA;&#xA;<p>Does there exists a path in $G$ with total weight $W$ that does not visit any vertex $v$ mo...
graphs np complete reductions weighted graphs
1
Path in a vertex-weighted undirected graph -- (graphs np complete reductions weighted graphs) <p>Is it an $NP$-hard problem?</p>&#xA;&#xA;<p>You're given an undirected graph $G(V,E)$ with vertex weight $w: V \to \mathbb{N}$ and a function $\mathrm{max}$-$\mathrm{visit}: V \to \mathbb{N}$ and a number $W$.</p>&#xA;&#xA;...
habedi/stack-exchange-dataset
96,181
Path in an edge-weighted undirected graph
<p>Is it an $NP$-hard problem?</p>&#xA;&#xA;<p>You're given an undirected graph $G(V,E)$ with edge weight $w: E \to \mathbb{N}$ and a function $\mathrm{max}$-$\mathrm{visit}: V \to \mathbb{N}$ and a number $W$ in unary.</p>&#xA;&#xA;<p>Does there exist a path in $G$ with overall product of edge weights equal $W$ and th...
graphs np complete weighted graphs
1
Path in an edge-weighted undirected graph -- (graphs np complete weighted graphs) <p>Is it an $NP$-hard problem?</p>&#xA;&#xA;<p>You're given an undirected graph $G(V,E)$ with edge weight $w: E \to \mathbb{N}$ and a function $\mathrm{max}$-$\mathrm{visit}: V \to \mathbb{N}$ and a number $W$ in unary.</p>&#xA;&#xA;<p>Do...
habedi/stack-exchange-dataset
96,183
Why use logic gates in this situation? (XOR gates)
<p>I came across this circuit that swaps logical signals:</p>&#xA;&#xA;<p><img src="https://upload.wikimedia.org/wikipedia/commons/2/2e/XOR-crossover.png" alt="circuit"></p>&#xA;&#xA;<p>However I don't understand why would you need to use logic gates. Would it be possible to just connect the A on the left to the B on t...
logic
1
Why use logic gates in this situation? (XOR gates) -- (logic) <p>I came across this circuit that swaps logical signals:</p>&#xA;&#xA;<p><img src="https://upload.wikimedia.org/wikipedia/commons/2/2e/XOR-crossover.png" alt="circuit"></p>&#xA;&#xA;<p>However I don't understand why would you need to use logic gates. Would ...
habedi/stack-exchange-dataset
96,185
Randomized quicksort expected running time analysis
<p>I am following the quicksort analysis in CLRS (pp. 181-184, 3rd edition). Let me summarize the setting of the analysis.</p>&#xA;&#xA;<h3>Setting in CLRS</h3>&#xA;&#xA;<p>First let $Z = \{z_1, ..., z_n\}$ be the set of elements of the input array $A$ in sorted order. $X$ is defined as the number of comparison we make...
time complexity randomized algorithms quicksort
1
Randomized quicksort expected running time analysis -- (time complexity randomized algorithms quicksort) <p>I am following the quicksort analysis in CLRS (pp. 181-184, 3rd edition). Let me summarize the setting of the analysis.</p>&#xA;&#xA;<h3>Setting in CLRS</h3>&#xA;&#xA;<p>First let $Z = \{z_1, ..., z_n\}$ be the s...
habedi/stack-exchange-dataset
96,196
Counting Inversions with merge-sort
<p>I'm doing this course: Engineering: Algorithms1 - SELF PACED Algorithms: Design and Analysis, on Stanford's website. And the first assignment asked us to count the inversions in an array.</p>&#xA;&#xA;<p>The idea that they used was:</p>&#xA;&#xA;<ol>&#xA;<li><p>Break the original array in half.</p></li>&#xA;<li><p>C...
mergesort
1
Counting Inversions with merge-sort -- (mergesort) <p>I'm doing this course: Engineering: Algorithms1 - SELF PACED Algorithms: Design and Analysis, on Stanford's website. And the first assignment asked us to count the inversions in an array.</p>&#xA;&#xA;<p>The idea that they used was:</p>&#xA;&#xA;<ol>&#xA;<li><p>Brea...
habedi/stack-exchange-dataset
96,210
Given $k$ points in $n$-dimensions, such that $n\geq3$, is there a polytime algorithm for finding a curve that splits them into 2 sets of points?
<p>So in <a href="https://math.stackexchange.com/questions/2879778/given-k-points-in-n-dimensional-space-is-there-always-a-continuous-n-1-su">this</a> math exchange question I asked, it was proven that for $n&gt;2$ dimensions, you can <em>always</em> find a curve that separates $k$ points in $n$-dimensional space into ...
algorithms polynomial time classification
1
Given $k$ points in $n$-dimensions, such that $n\geq3$, is there a polytime algorithm for finding a curve that splits them into 2 sets of points? -- (algorithms polynomial time classification) <p>So in <a href="https://math.stackexchange.com/questions/2879778/given-k-points-in-n-dimensional-space-is-there-always-a-cont...
habedi/stack-exchange-dataset
96,215
Understanding reductions for NP-completeness
<p>Let's I have to make the following reduction:</p>&#xA;&#xA;<p>$$\text{CLIQUE}\le_p \text{VERTEX-COVER}$$</p>&#xA;&#xA;<p>The technique of building the reduction is -</p>&#xA;&#xA;<ol>&#xA;<li>Assume you can find a $\text{VERTEX-COVER}$ of size $k$, in polynomial time.</li>&#xA;<li>Building a new graph, in which I sa...
complexity theory np complete reductions
1
Understanding reductions for NP-completeness -- (complexity theory np complete reductions) <p>Let's I have to make the following reduction:</p>&#xA;&#xA;<p>$$\text{CLIQUE}\le_p \text{VERTEX-COVER}$$</p>&#xA;&#xA;<p>The technique of building the reduction is -</p>&#xA;&#xA;<ol>&#xA;<li>Assume you can find a $\text{VERTE...
habedi/stack-exchange-dataset
96,221
Permutation of words that have matched parentheses
<p>Let $L$ denote the (context-free) language of matched parentheses over the alphabet $\Sigma$. Consider the following problem:</p>&#xA;&#xA;<p>Input: words $x_1,\dots,x_n \in \Sigma^*$<br>&#xA;Question: does there exist a permutation $\sigma$ of $\{1,\dots,n\}$ such that $x_{\sigma(1)} x_{\sigma(2)} \cdots x_{\sigma...
formal languages np complete strings permutations word combinatorics
1
Permutation of words that have matched parentheses -- (formal languages np complete strings permutations word combinatorics) <p>Let $L$ denote the (context-free) language of matched parentheses over the alphabet $\Sigma$. Consider the following problem:</p>&#xA;&#xA;<p>Input: words $x_1,\dots,x_n \in \Sigma^*$<br>&#xA...
habedi/stack-exchange-dataset
96,226
Is it possible to solve maximum weight independent set in linear time for a cycle?
<p>Given a cycle of $n$ vertices and each vertices of the input graph $G$ assigned a weight. </p>&#xA;&#xA;<p>We want to find an independent set of cycle such that weight of the vertices taken in the independent set is maximum.</p>&#xA;&#xA;<p>A brute force way is consider cycle as a set of three consecutive vertices a...
algorithms
1
Is it possible to solve maximum weight independent set in linear time for a cycle? -- (algorithms) <p>Given a cycle of $n$ vertices and each vertices of the input graph $G$ assigned a weight. </p>&#xA;&#xA;<p>We want to find an independent set of cycle such that weight of the vertices taken in the independent set is ma...
habedi/stack-exchange-dataset
96,249
Optimal combination, given pairwise costs
<p>I want to pick k objects from a pool of n. Not any k objects, the optimal k objects: that which minimizes the cost of the set, defined as the sum of pairwise costs for all pairs within the set.</p>&#xA;&#xA;<p>What NP-complete/hard problem is this an instance of?</p>&#xA;&#xA;<p>What is a good (i.e. fast but finds a...
np complete np hard
1
Optimal combination, given pairwise costs -- (np complete np hard) <p>I want to pick k objects from a pool of n. Not any k objects, the optimal k objects: that which minimizes the cost of the set, defined as the sum of pairwise costs for all pairs within the set.</p>&#xA;&#xA;<p>What NP-complete/hard problem is this an...
habedi/stack-exchange-dataset
96,259
Calculate the minimum absolute difference between the maximum and minimum number from the triplet of 3 arrays
<p>Question is:</p>&#xA;&#xA;<p><em>Calculate the minimum absolute difference between the maximum and minimum number from the triplet a, b, c such that a, b, c belongs arrays A, B, C respectively.</em> </p>&#xA;&#xA;<p>There is another question: <em>Find i, j, k such that :&#xA;<code>max(abs(A[i] - B[j]), abs(B[j] - C[...
algorithms arrays
1
Calculate the minimum absolute difference between the maximum and minimum number from the triplet of 3 arrays -- (algorithms arrays) <p>Question is:</p>&#xA;&#xA;<p><em>Calculate the minimum absolute difference between the maximum and minimum number from the triplet a, b, c such that a, b, c belongs arrays A, B, C resp...
habedi/stack-exchange-dataset
96,264
Calculate the storage capacity of this disk in GB
<p>A disk pack has 12 platters ( plates) having 2048 tracks on every surface. &#xA;It can store 1024 bytes per sector ( assume each track has 512 sectors). Calculate the storage capacity of this disk in GB.</p>&#xA;
computer architecture
1
Calculate the storage capacity of this disk in GB -- (computer architecture) <p>A disk pack has 12 platters ( plates) having 2048 tracks on every surface. &#xA;It can store 1024 bytes per sector ( assume each track has 512 sectors). Calculate the storage capacity of this disk in GB.</p>&#xA;
habedi/stack-exchange-dataset
96,272
Is this problem NP-hard? Maximizing selected sets so that their union is less than k?
<p>There is an NP-hard problem called <em>Minimum k-Union</em> where we are given a set system with <span class="math-container">$n$</span> sets and are asked to select <span class="math-container">$k$</span> sets in order to minimize the size of their union.</p>&#xA;&#xA;<p>I'm currently interested in a very similar p...
complexity theory np complete reductions np hard
1
Is this problem NP-hard? Maximizing selected sets so that their union is less than k? -- (complexity theory np complete reductions np hard) <p>There is an NP-hard problem called <em>Minimum k-Union</em> where we are given a set system with <span class="math-container">$n$</span> sets and are asked to select <span class...
habedi/stack-exchange-dataset
96,275
Selecting a subtree in an array representation of a binary tree
<p>Consider a zero-indexed array representation of a binary tree (as in a <a href="https://en.wikipedia.org/wiki/Binary_heap#Extract" rel="nofollow noreferrer">binary heap</a>), where</p>&#xA;&#xA;<ul>&#xA;<li><code>0</code> is the root</li>&#xA;<li>The left child of <code>i</code> is <code>L(i) = 2*i+1</code>.</li>&#x...
data structures trees binary trees arrays
1
Selecting a subtree in an array representation of a binary tree -- (data structures trees binary trees arrays) <p>Consider a zero-indexed array representation of a binary tree (as in a <a href="https://en.wikipedia.org/wiki/Binary_heap#Extract" rel="nofollow noreferrer">binary heap</a>), where</p>&#xA;&#xA;<ul>&#xA;<li...
habedi/stack-exchange-dataset
96,276
Clarification reg. jump consistent hashing
<p>I was reading the paper on <a href="https://arxiv.org/pdf/1406.2294.pdf" rel="nofollow noreferrer">Jump consistent hashing</a>, and I'm having some trouble understanding one particular line (page 5, paragraph 2)</p>&#xA;&#xA;<p>"Since we want P(j ≥ i) = (b+1) / i, we set P(j ≥ i) iff r ≤ (b+1) / i."</p>&#xA;&#xA;<p>...
data structures hash
1
Clarification reg. jump consistent hashing -- (data structures hash) <p>I was reading the paper on <a href="https://arxiv.org/pdf/1406.2294.pdf" rel="nofollow noreferrer">Jump consistent hashing</a>, and I'm having some trouble understanding one particular line (page 5, paragraph 2)</p>&#xA;&#xA;<p>"Since we want P(j ≥...
habedi/stack-exchange-dataset
96,278
Do we always get the same set of edges after running Kruskal's algorithm on a single graph?
<p>I think it should be false because there may be more than one edge with the same weight.</p>&#xA;
graphs algorithm analysis trees minimum spanning tree
1
Do we always get the same set of edges after running Kruskal's algorithm on a single graph? -- (graphs algorithm analysis trees minimum spanning tree) <p>I think it should be false because there may be more than one edge with the same weight.</p>&#xA;
habedi/stack-exchange-dataset
96,285
Conditions for a node to be a leaf node on DFS tree
<p>Question:&#xA;Consider the DFS tree generated by a DFS on a connected graph. Write below the necessary and sufficient condition for a node v to be a leaf node on the DFS tree. The condition must be in term's of v's discovery time d[v] and finishing time f[v].</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>I honestly have no idea wha...
trees graph traversal
1
Conditions for a node to be a leaf node on DFS tree -- (trees graph traversal) <p>Question:&#xA;Consider the DFS tree generated by a DFS on a connected graph. Write below the necessary and sufficient condition for a node v to be a leaf node on the DFS tree. The condition must be in term's of v's discovery time d[v] and...
habedi/stack-exchange-dataset
96,309
AVL tree size in terms of height
<p>For AVL trees, which one of the following is possible as the tree size (expressed in term of the tree height h)? Recall that the size of a tree is the number of nodes in the tree.</p>&#xA;&#xA;<p>A. $Θ(h^{2.1})$&#xA;B. $Θ(1.1^h)$&#xA;C. $Θ(1.9^h)$&#xA;D. $Θ(2.1^h)$</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>So this question came...
balanced search trees
1
AVL tree size in terms of height -- (balanced search trees) <p>For AVL trees, which one of the following is possible as the tree size (expressed in term of the tree height h)? Recall that the size of a tree is the number of nodes in the tree.</p>&#xA;&#xA;<p>A. $Θ(h^{2.1})$&#xA;B. $Θ(1.1^h)$&#xA;C. $Θ(1.9^h)$&#xA;D. $Θ...
habedi/stack-exchange-dataset
96,313
Minimum number of nodes in AVL tree
<p>Let T be an AVL tree of height 3. What is the smallest number of entries it can store? Note that a tree with one node (only the root) has the height of zero and stores one element.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>The only method I could think of was just drawing an AVL tree and trying to minimize the number of nodes i...
trees heaps
1
Minimum number of nodes in AVL tree -- (trees heaps) <p>Let T be an AVL tree of height 3. What is the smallest number of entries it can store? Note that a tree with one node (only the root) has the height of zero and stores one element.</p>&#xA;&#xA;<hr>&#xA;&#xA;<p>The only method I could think of was just drawing an ...
habedi/stack-exchange-dataset
96,322
How can Kolmogorov complexity help me practically with measuring entropy?
<p>A comment was made to me saying the following in relation to Kolmogorov complexity:-</p>&#xA;<blockquote>&#xA;<p>You're not the first to think non-computability = impractical or even useless. But it can be useful. In particular to random, &quot;non-algorithmic&quot; data.</p>&#xA;</blockquote>&#xA;<p>I now have a ph...
kolmogorov complexity entropy
1
How can Kolmogorov complexity help me practically with measuring entropy? -- (kolmogorov complexity entropy) <p>A comment was made to me saying the following in relation to Kolmogorov complexity:-</p>&#xA;<blockquote>&#xA;<p>You're not the first to think non-computability = impractical or even useless. But it can be us...
habedi/stack-exchange-dataset
96,344
How to determine seed collision probability in a PRNG?
<p>I want to use a PRNG to generate random patterns. I would provide the PRNG with a hash value as a seed. Ideally, the seed size would be 64-bit or 128-bit and I would expect no collisions if the seeds are unique.</p>&#xA;&#xA;<p>Do PRNGs encounter 'collisions', where two different seeds produce the exact same sequenc...
algorithms algorithm analysis probability theory randomness pseudo random generators
1
How to determine seed collision probability in a PRNG? -- (algorithms algorithm analysis probability theory randomness pseudo random generators) <p>I want to use a PRNG to generate random patterns. I would provide the PRNG with a hash value as a seed. Ideally, the seed size would be 64-bit or 128-bit and I would expect...
habedi/stack-exchange-dataset
96,347
Finding a minimum weight path with certain restrictions
<p>I have a directed weighted multigraph whose vertices are sets of URLs.</p>&#xA;&#xA;<p>We add to this multigraph all edges of the form $i\to j$ where $i\subset j$ (such edges are of zero weight), where $i$, $j$ are vertices of the graph.</p>&#xA;&#xA;<p>Now having a set of source vertices and destination vertices, I...
graphs graph traversal weighted graphs python
1
Finding a minimum weight path with certain restrictions -- (graphs graph traversal weighted graphs python) <p>I have a directed weighted multigraph whose vertices are sets of URLs.</p>&#xA;&#xA;<p>We add to this multigraph all edges of the form $i\to j$ where $i\subset j$ (such edges are of zero weight), where $i$, $j$...
habedi/stack-exchange-dataset
96,352
How to prove that a string is made up of subsequences occurring some arbitrary number of times using concatenation?
<p>How to prove that a string, <code>s</code> is made up of <code>n &gt; 1</code> subsequences occurring some arbitrary number of times using concatenation and stripping first and last character?&#xA; E.g <code>s = xyzxyz</code>, subsequence is <code>xyz</code> and it occurs 2 times. The solution is to concatenate the ...
formal languages proof techniques induction
1
How to prove that a string is made up of subsequences occurring some arbitrary number of times using concatenation? -- (formal languages proof techniques induction) <p>How to prove that a string, <code>s</code> is made up of <code>n &gt; 1</code> subsequences occurring some arbitrary number of times using concatenation...
habedi/stack-exchange-dataset
96,353
Why is the complexity of factorial a function of n?
<p>When we compute the complexity of calculating factorial of a number $n$ why is it in terms of $n$ instead of the number of the number of bits occupied by the number of bits occupied by $n$ (like we do in number-theoretic algorithms like primality checking etc.)?</p>&#xA;
complexity theory time complexity primes factorial
1
Why is the complexity of factorial a function of n? -- (complexity theory time complexity primes factorial) <p>When we compute the complexity of calculating factorial of a number $n$ why is it in terms of $n$ instead of the number of the number of bits occupied by the number of bits occupied by $n$ (like we do in numbe...
habedi/stack-exchange-dataset
96,355
What kind of logarithm does $\log$ mean in Wikipedia articles?
<p>Sorry if this seems like a dumb question, but what what type of logarithm is $\log$ in Wikipedia articles? Cheers. </p>&#xA;
terminology data mining
1
What kind of logarithm does $\log$ mean in Wikipedia articles? -- (terminology data mining) <p>Sorry if this seems like a dumb question, but what what type of logarithm is $\log$ in Wikipedia articles? Cheers. </p>&#xA;
habedi/stack-exchange-dataset
96,369
Why strokes are treated differently than fills in modern graphics pipelines
<p><a href="https://mattdesl.svbtle.com/drawing-lines-is-hard" rel="nofollow noreferrer">This article</a> shows some of the issues. But basically, on the web, you have <code>fillStyle</code> and <code>strokeStyle</code>, and in WebGL you have those different ways of rendering primitive lines, but you end up needing wor...
graphics history
1
Why strokes are treated differently than fills in modern graphics pipelines -- (graphics history) <p><a href="https://mattdesl.svbtle.com/drawing-lines-is-hard" rel="nofollow noreferrer">This article</a> shows some of the issues. But basically, on the web, you have <code>fillStyle</code> and <code>strokeStyle</code>, a...
habedi/stack-exchange-dataset
96,381
Chernoff-Hoeffding bounds for the number of nonzeros in a submatrix
<p>Consider a $n \times n$ matrix $A$ with $k$ nonzero entries. Assume every row and every column of $A$ has at most $\sqrt{k}$ nonzeros. Permute uniformly at random the rows and the columns of $A$. Divide $A$ in $k$ submatrices of size $n/\sqrt{k} \times n/\sqrt{k}$ (i.e. $\sqrt{k}$ meta-rows and meta-columns). Enumer...
permutations sparse matrices chernoff bounds
1
Chernoff-Hoeffding bounds for the number of nonzeros in a submatrix -- (permutations sparse matrices chernoff bounds) <p>Consider a $n \times n$ matrix $A$ with $k$ nonzero entries. Assume every row and every column of $A$ has at most $\sqrt{k}$ nonzeros. Permute uniformly at random the rows and the columns of $A$. Div...
habedi/stack-exchange-dataset
96,383
What changes do I need to make to my algorithm to make this scene from a different angle?
<p>The code below is in F#. It creates a scene which looks like a perspective coming from the top left. I thought if I would change <code>i % j = w</code> then it would come from the top right instead, but that doesn't work. So what change do I need to make for it to be able to come from the top right, bottom left, bot...
algorithms loops
1
What changes do I need to make to my algorithm to make this scene from a different angle? -- (algorithms loops) <p>The code below is in F#. It creates a scene which looks like a perspective coming from the top left. I thought if I would change <code>i % j = w</code> then it would come from the top right instead, but th...
habedi/stack-exchange-dataset
96,384
How to express the existence of winning strategy of the starter of a game in temporal logic?
<p>Consider a two-player game. A winning strategy of a player is a strategy following which the player can always beat his opponent, no matter how his opponent responds. </p>&#xA;&#xA;<p>A game can be unfolded to a state space consisting of the possible ways of both sides of the game. How to express the existence of wi...
formal methods game theory model checking linear temporal logic computation tree logic
1
How to express the existence of winning strategy of the starter of a game in temporal logic? -- (formal methods game theory model checking linear temporal logic computation tree logic) <p>Consider a two-player game. A winning strategy of a player is a strategy following which the player can always beat his opponent, no...
habedi/stack-exchange-dataset
96,385
Inference of a measure for a decreasing chain
<p>Set <span class="math-container">$I_n = \{0,\ldots,n-1\}$</span>.</p>&#xA;<p>Given integers <span class="math-container">$v_0,\dots,v_{n-1} \in \mathbb{N}$</span>, find an integer <span class="math-container">$t&gt;0$</span>, a map <span class="math-container">$f:\mathbb{N} \times I_n \to \mathbb{N}^t$</span>, and a...
graphs functional programming order theory termination
1
Inference of a measure for a decreasing chain -- (graphs functional programming order theory termination) <p>Set <span class="math-container">$I_n = \{0,\ldots,n-1\}$</span>.</p>&#xA;<p>Given integers <span class="math-container">$v_0,\dots,v_{n-1} \in \mathbb{N}$</span>, find an integer <span class="math-container">$t...
habedi/stack-exchange-dataset
96,394
sort n numbers in the range [0,1] without multiplying or dividing
<p>Given an array with n real numbers, each in the range [0,1], I need to sort them. Moreover, the only operations that are allowed are comparisons or copying.</p>&#xA;&#xA;<p>It means I cannot multiply or divide the numbers, which prohibits me from using bucket sort.</p>&#xA;&#xA;<p>From what I learned, when you use o...
algorithms data structures sorting comparison
1
sort n numbers in the range [0,1] without multiplying or dividing -- (algorithms data structures sorting comparison) <p>Given an array with n real numbers, each in the range [0,1], I need to sort them. Moreover, the only operations that are allowed are comparisons or copying.</p>&#xA;&#xA;<p>It means I cannot multiply ...
habedi/stack-exchange-dataset
96,395
How to solve $T(n)\leq n^2+n\left[T(n-m)+T(m-1)\right]$?
<p>I am trying to find $T(n)=O(f(n))$, where $$T(n)\leq n^2+n\left[T(n-m)+T(m-1)\right],$$ where $m\in\{1,2,\ldots,n\}$.</p>&#xA;&#xA;<p>Is it possible to find $f(n)$ such that $T(n)=O(f(n))$?</p>&#xA;&#xA;<p>I started to fix $m=n/2$ (which I assume the worst scenario, isn't it?). I found $$\begin{align}T(n)&amp;\leq ...
asymptotics recurrence relation
1
How to solve $T(n)\leq n^2+n\left[T(n-m)+T(m-1)\right]$? -- (asymptotics recurrence relation) <p>I am trying to find $T(n)=O(f(n))$, where $$T(n)\leq n^2+n\left[T(n-m)+T(m-1)\right],$$ where $m\in\{1,2,\ldots,n\}$.</p>&#xA;&#xA;<p>Is it possible to find $f(n)$ such that $T(n)=O(f(n))$?</p>&#xA;&#xA;<p>I started to fix...
habedi/stack-exchange-dataset
96,407
Markov Inequality in graph theory
<p>Fix an optimal solution G∗ to k-Cycle-Free Subgraph. Partition the vertex set V of G randomly into two subsets, A and B, each of size n/2, and remove edges internal to A or B. In expectation, the fraction of edges in G∗ that remain after this process is 1/2. <strong><em>With probability at least 2/3 the fraction of ...
algorithms graphs
1
Markov Inequality in graph theory -- (algorithms graphs) <p>Fix an optimal solution G∗ to k-Cycle-Free Subgraph. Partition the vertex set V of G randomly into two subsets, A and B, each of size n/2, and remove edges internal to A or B. In expectation, the fraction of edges in G∗ that remain after this process is 1/2. <...
habedi/stack-exchange-dataset
96,424
Incremental strongly connected components
<p>For a changing directed graph, I would like to maintain information about strongly connected components. The graph operations are incremental: only vertex addition and edge addition. What data structures achieve the best known amortized complexity for these operations?</p>&#xA;&#xA;<p>If the graph was undirected, th...
graphs data structures amortized analysis
1
Incremental strongly connected components -- (graphs data structures amortized analysis) <p>For a changing directed graph, I would like to maintain information about strongly connected components. The graph operations are incremental: only vertex addition and edge addition. What data structures achieve the best known a...
habedi/stack-exchange-dataset
96,434
Minimum number of letters
<p>I have an assignment that I have to do and the question is </p>&#xA;&#xA;<blockquote>&#xA; <p>Draw a DPDA that accepts the language L = {ba(bb)^(n+1)a^(n – 1) |n > 1}.</p>&#xA;</blockquote>&#xA;&#xA;<p>Im not looking for the answer but rather some direction. I would like to understand the 'n' powers.</p>&#xA;&#xA;<...
regular languages regular expressions pushdown automata
1
Minimum number of letters -- (regular languages regular expressions pushdown automata) <p>I have an assignment that I have to do and the question is </p>&#xA;&#xA;<blockquote>&#xA; <p>Draw a DPDA that accepts the language L = {ba(bb)^(n+1)a^(n – 1) |n > 1}.</p>&#xA;</blockquote>&#xA;&#xA;<p>Im not looking for the answ...
habedi/stack-exchange-dataset
96,447
Modifying Floyd–Warshall Algorithm for Vertex Weights
<p>I was trying to modify the Floyd–Warshall's algorithm to take into account the weights over the vertices, in addition to the weight of the edges, while computing the shortest path. The length of a path from vertex A to an adjacent vertex B, Path(A,B) , is defined as:</p>&#xA;&#xA;<pre><code> Vertex_Weight(A) + E...
algorithms shortest path
1
Modifying Floyd–Warshall Algorithm for Vertex Weights -- (algorithms shortest path) <p>I was trying to modify the Floyd–Warshall's algorithm to take into account the weights over the vertices, in addition to the weight of the edges, while computing the shortest path. The length of a path from vertex A to an adjacent ve...
habedi/stack-exchange-dataset
96,453
Is there any interesting consequence of $\mathrm{DLogTime}$-uniform ${\mathrm{Mod}_6}^0=\mathrm{NP}$
<p>$\mathrm{NP}$ has not been separated from constant-depth circuits consisting of solely $\mathrm{Mod}_6$ gates. So, the question is whether current techniques are enough to deduce interestingly unintuitive consequences of that bizarre claim.</p>&#xA;
np decision problem
1
Is there any interesting consequence of $\mathrm{DLogTime}$-uniform ${\mathrm{Mod}_6}^0=\mathrm{NP}$ -- (np decision problem) <p>$\mathrm{NP}$ has not been separated from constant-depth circuits consisting of solely $\mathrm{Mod}_6$ gates. So, the question is whether current techniques are enough to deduce interestingl...
habedi/stack-exchange-dataset
96,456
What is the name of a rooted tree whose nodes may have edges to their descendants?
<p>A tree is a special kind a graph.</p>&#xA;&#xA;<p>However, I came across a data structure which is a like a rooted tree, but where nodes are authorized to have direct links to any of their descendants. Shortcuts if you will.</p>&#xA;&#xA;<p>This is not a tree anymore.</p>&#xA;&#xA;<p>This is a specialized DAG that h...
graphs data structures trees graph traversal dag
1
What is the name of a rooted tree whose nodes may have edges to their descendants? -- (graphs data structures trees graph traversal dag) <p>A tree is a special kind a graph.</p>&#xA;&#xA;<p>However, I came across a data structure which is a like a rooted tree, but where nodes are authorized to have direct links to any ...
habedi/stack-exchange-dataset
96,459
Why is the sequence "3,3,4,5,2" considered a bitonic sequence?
<p>Why do we consider the sequence <strong>"3,3,4,5,2"</strong> a <em>bitonic</em> sequence?</p>&#xA;&#xA;<p>In the sequence, "3,3,4,5,2", the sequence is</p>&#xA;&#xA;<ul>&#xA;<li>constant for "3,3",</li>&#xA;<li>increasing for "4,5", and</li>&#xA;<li>decreasing for "5,2".</li>&#xA;</ul>&#xA;
algorithms parallel computing
1
Why is the sequence "3,3,4,5,2" considered a bitonic sequence? -- (algorithms parallel computing) <p>Why do we consider the sequence <strong>"3,3,4,5,2"</strong> a <em>bitonic</em> sequence?</p>&#xA;&#xA;<p>In the sequence, "3,3,4,5,2", the sequence is</p>&#xA;&#xA;<ul>&#xA;<li>constant for "3,3",</li>&#xA;<li>increasi...
habedi/stack-exchange-dataset
96,475
Is there a generic algorithm to optimally combine elements by some arbitrary scoring method?
<p>I'm looking for a generic algorithm to optimally combine elements of a list. I'm not sure if it even exists, but I believe some kind of divide-and-conquer algorithm could exist. In my specidifc case, optimally combining the score means minimizing, but that's probably not important</p>&#xA;&#xA;<p>Formally stated:</p...
algorithms optimization greedy algorithms
1
Is there a generic algorithm to optimally combine elements by some arbitrary scoring method? -- (algorithms optimization greedy algorithms) <p>I'm looking for a generic algorithm to optimally combine elements of a list. I'm not sure if it even exists, but I believe some kind of divide-and-conquer algorithm could exist....
habedi/stack-exchange-dataset
96,476
Bottleneck in Hoare Logic unable to arrive at my {P} from {Q}
<p>{Q} = {n>0}<br>&#xA;C1 = i := 1;<br>&#xA;C2 = c := 1;<br>&#xA;C3 = p := 0;<br>&#xA;{P} = {i&lt;=n, p = fib(i-1), c = fib(i)}</p>&#xA;&#xA;<p>My lack of understanding towards the rule of consequence in hoare logic is blocking me from find the solution which i hope someone can shed some light on how can i approach thi...
hoare logic
1
Bottleneck in Hoare Logic unable to arrive at my {P} from {Q} -- (hoare logic) <p>{Q} = {n>0}<br>&#xA;C1 = i := 1;<br>&#xA;C2 = c := 1;<br>&#xA;C3 = p := 0;<br>&#xA;{P} = {i&lt;=n, p = fib(i-1), c = fib(i)}</p>&#xA;&#xA;<p>My lack of understanding towards the rule of consequence in hoare logic is blocking me from find ...
habedi/stack-exchange-dataset
96,484
Primary/Secondary On Call Rotations
<p>I'm trying to setup a primary and secondary on call schedule with 6 people. </p>&#xA;&#xA;<p>I'm trying to schedule people to be on call, so that they will be paired with everyone and they have the longest "break" between their schedules.</p>&#xA;&#xA;<p>Ex for one rotation: </p>&#xA;&#xA;<pre><code>week: 1 2 ...
algorithms combinatorics
1
Primary/Secondary On Call Rotations -- (algorithms combinatorics) <p>I'm trying to setup a primary and secondary on call schedule with 6 people. </p>&#xA;&#xA;<p>I'm trying to schedule people to be on call, so that they will be paired with everyone and they have the longest "break" between their schedules.</p>&#xA;&#xA...
habedi/stack-exchange-dataset