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,112 | Allocating memory via Buddy Allocation | <p>I'm trying to learn buddy allocation and whilst I think I understand the basics of it, there is one problem exercise with which I'm struggling with.
<a href="https://i.stack.imgur.com/knYja.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/knYja.png" alt="enter image description here"></a></p>&#... | memory allocation | 1 | Allocating memory via Buddy Allocation -- (memory allocation)
<p>I'm trying to learn buddy allocation and whilst I think I understand the basics of it, there is one problem exercise with which I'm struggling with.
<a href="https://i.stack.imgur.com/knYja.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | habedi/stack-exchange-dataset |
91,115 | Finding the length of the longest increasing path in a matrix | <p><strong>Problem:</strong></p>

<p>Given a matrix, find the length of the longest increasing path. We can move up, down, left, or right.</p>

<p><strong>Example:</strong></p>

<p>$$
\begin{pmatrix}
1&2&3&4\\2&2&3&4\\3&2&3&4\\4&5&6&7
\... | algorithms data structures dynamic programming | 1 | Finding the length of the longest increasing path in a matrix -- (algorithms data structures dynamic programming)
<p><strong>Problem:</strong></p>

<p>Given a matrix, find the length of the longest increasing path. We can move up, down, left, or right.</p>

<p><strong>Example:</strong></p>

<p>$... | habedi/stack-exchange-dataset |
91,118 | Why is this function computable | <p>I'm struggling to understand why this function is computable.
This is the requirement:</p>

<p>Consider the following program P, written in a pseudo-C language: </p>

<pre><code>P: 
{ 
 int x, y, z; 
 read (x, y, z); 
 while (x != y) 
 { 
 x = x - y; &... | computability | 1 | Why is this function computable -- (computability)
<p>I'm struggling to understand why this function is computable.
This is the requirement:</p>

<p>Consider the following program P, written in a pseudo-C language: </p>

<pre><code>P: 
{ 
 int x, y, z; 
 read (x, y, z); 
 ... | habedi/stack-exchange-dataset |
91,128 | How do computers synchronize their clocks with the standard time | <p>I'd like to know how clock synchronization is done on computers, I've read <a href="https://en.wikipedia.org/wiki/Clock_synchronization" rel="nofollow noreferrer">this</a> wikipedia article however it didn't give me exactly what I was looking for, I'll outline the problem I'd like answered:</p>

<p>My comput... | clocks | 1 | How do computers synchronize their clocks with the standard time -- (clocks)
<p>I'd like to know how clock synchronization is done on computers, I've read <a href="https://en.wikipedia.org/wiki/Clock_synchronization" rel="nofollow noreferrer">this</a> wikipedia article however it didn't give me exactly what I was looki... | habedi/stack-exchange-dataset |
91,136 | Optimal data structure for sorted list | <p>Most of the resources on the web I have encountered say that "sorted arrays and other sorted data structures are implemented with binary search trees (BSTs)".</p>

<p>Even though B-trees are a generalization of BSTs, I have not seen much of anything say they are used to create ordered data structures. Wonder... | data structures trees search trees | 1 | Optimal data structure for sorted list -- (data structures trees search trees)
<p>Most of the resources on the web I have encountered say that "sorted arrays and other sorted data structures are implemented with binary search trees (BSTs)".</p>

<p>Even though B-trees are a generalization of BSTs, I have not se... | habedi/stack-exchange-dataset |
91,153 | BinaryTree minimum possible height | <p>I have one question for which I don't know any good solution (and my solution doesn't satisfy constraints). Namely, on one of the interviews i got problem like this: </p>

<blockquote>
 <p>Determine the minimum possible height of the binary tree, if you could
 remove <code>numNodes</code> leaf node... | algorithms binary trees | 1 | BinaryTree minimum possible height -- (algorithms binary trees)
<p>I have one question for which I don't know any good solution (and my solution doesn't satisfy constraints). Namely, on one of the interviews i got problem like this: </p>

<blockquote>
 <p>Determine the minimum possible height of the binary... | habedi/stack-exchange-dataset |
91,156 | Is It Possible For a Data Structure to Have Constant Time Access/Insertion/Deletion? | <p>I'm trying to come up with a data structure that could access, insert, and delete <strong>any</strong> element in constant time. I know that's pretty difficult, but I'm just doing it to invoke thought and understanding about computer science. However, I'm starting to question whether it is even possible. </p>
&#... | data structures constant time | 1 | Is It Possible For a Data Structure to Have Constant Time Access/Insertion/Deletion? -- (data structures constant time)
<p>I'm trying to come up with a data structure that could access, insert, and delete <strong>any</strong> element in constant time. I know that's pretty difficult, but I'm just doing it to invoke thou... | habedi/stack-exchange-dataset |
91,174 | What does Arora mean by 'computational history'? | <p>In <a href="https://www.cs.princeton.edu/~arora/pubs/stocsurvey.ps" rel="nofollow noreferrer">Arora's paper</a>, he wrote,</p>

<blockquote>
 <p>Papadimitriou and Yannakakis also noted that the classical style of reduction (Cook-Levin-Karp [41, 99, 85]) relies on representing a computational history by ... | complexity theory reductions approximation | 1 | What does Arora mean by 'computational history'? -- (complexity theory reductions approximation)
<p>In <a href="https://www.cs.princeton.edu/~arora/pubs/stocsurvey.ps" rel="nofollow noreferrer">Arora's paper</a>, he wrote,</p>

<blockquote>
 <p>Papadimitriou and Yannakakis also noted that the classical sty... | habedi/stack-exchange-dataset |
91,183 | Setting a cutoff for string distance filtering with different length strings | <p>I'm working to filter a table of pairwise names (1.1 M rows) based on string distance algorithms. Most are names, though some are businesses.</p>

<p>Edit-based algorithms seem to be best, however in attempting to set a cutoff value for match vs. non-match, there is an issue with the length of the string. I... | string matching | 1 | Setting a cutoff for string distance filtering with different length strings -- (string matching)
<p>I'm working to filter a table of pairwise names (1.1 M rows) based on string distance algorithms. Most are names, though some are businesses.</p>

<p>Edit-based algorithms seem to be best, however in attempting ... | habedi/stack-exchange-dataset |
91,185 | Compute e^x given starting approximation | <p>I have been looking for an algorithm to calculate $e^x$ to arbitrary precision (millions of digits). The best way I know is to use Taylor polynomials. However, the Taylor polynomial algorithm seems to have no way to enhance the precision of already existing estimates of $e^x$.</p>

<p>For example:</p>
... | approximation mathematical programming | 1 | Compute e^x given starting approximation -- (approximation mathematical programming)
<p>I have been looking for an algorithm to calculate $e^x$ to arbitrary precision (millions of digits). The best way I know is to use Taylor polynomials. However, the Taylor polynomial algorithm seems to have no way to enhance the pr... | habedi/stack-exchange-dataset |
91,187 | How can the binary OR function be computed by a MOD3 gate of constant fan-in? | <p>I've been working on a problem and in order to prove the bigger picture, I need to understand how a binary OR function can be computed by a constant fan-in MOD3 gate. I would seem that the output would need to depend on every input bit as just looking at some of them would leave out the possibility that those that w... | arithmetic circuits binary | 1 | How can the binary OR function be computed by a MOD3 gate of constant fan-in? -- (arithmetic circuits binary)
<p>I've been working on a problem and in order to prove the bigger picture, I need to understand how a binary OR function can be computed by a constant fan-in MOD3 gate. I would seem that the output would need ... | habedi/stack-exchange-dataset |
91,193 | What is a monotone dataset and monotone classification? | <p>Classification algorithms, such as k-Nearest Neighbors, are well known in machine learning area, but I faced this new expression <strong>Monotone classification</strong> and I wonder what does it stand for.</p>

<p>I guess that it has something to do with some peculiar characteristic of the dataset, e.g. if ... | machine learning classification | 1 | What is a monotone dataset and monotone classification? -- (machine learning classification)
<p>Classification algorithms, such as k-Nearest Neighbors, are well known in machine learning area, but I faced this new expression <strong>Monotone classification</strong> and I wonder what does it stand for.</p>

<p>I... | habedi/stack-exchange-dataset |
91,197 | Can a perfect matching always be found by a picking sequence? | <p>There are $n$ people and $n$ items. For each person, there is a set of items he likes. Our goal is to give to each person a single item that he likes, i.e, find a perfect matching in the preference graph (encoding the "like" relation).</p>

<p>In some cases, this may be done using a <a href="https://en.wikip... | graphs discrete mathematics matching bipartite matching | 1 | Can a perfect matching always be found by a picking sequence? -- (graphs discrete mathematics matching bipartite matching)
<p>There are $n$ people and $n$ items. For each person, there is a set of items he likes. Our goal is to give to each person a single item that he likes, i.e, find a perfect matching in the prefere... | habedi/stack-exchange-dataset |
91,202 | Why is the complete state of a turing machine representable by a finite word? | <p>At the moment I'm just reading through this article on the word problem for groups (<a href="https://projecteuclid.org/euclid.bams/1183548590" rel="nofollow noreferrer">https://projecteuclid.org/euclid.bams/1183548590</a>), and I'm wondering about a certain snippet.</p>
<p>On page 40 the article describes a word... | turing machines | 1 | Why is the complete state of a turing machine representable by a finite word? -- (turing machines)
<p>At the moment I'm just reading through this article on the word problem for groups (<a href="https://projecteuclid.org/euclid.bams/1183548590" rel="nofollow noreferrer">https://projecteuclid.org/euclid.bams/1183548590<... | habedi/stack-exchange-dataset |
91,214 | Concurrency and fairness | <p>I'm studying the concurrency in programming and the atomic instructions.
What i have not understood is the concept of "fairness" applied to this matter.
Can you give me an hint ?</p>
 | programming languages concurrency multi tasking | 1 | Concurrency and fairness -- (programming languages concurrency multi tasking)
<p>I'm studying the concurrency in programming and the atomic instructions.
What i have not understood is the concept of "fairness" applied to this matter.
Can you give me an hint ?</p>
 | habedi/stack-exchange-dataset |
91,215 | Sort already sorted array - after changing several elements | <p><strong>Problem</strong>:</p>

<p>Given $S$ — a sorted array where some of the elements were randomly changed, assuming that you're provided with an $S_1$ — an array of indexes of changed elements. Design an algorithm that will sort the array in $O(n)$ time.</p>

<p>Additionally, we know ... | algorithms data structures sorting arrays | 1 | Sort already sorted array - after changing several elements -- (algorithms data structures sorting arrays)
<p><strong>Problem</strong>:</p>

<p>Given $S$ — a sorted array where some of the elements were randomly changed, assuming that you're provided with an $S_1$ — an array of indexes of changed el... | habedi/stack-exchange-dataset |
91,218 | Is there a variant of Dijkstra’s algorithm for partial recalculation? | <p>Suppose the following:</p>

<ul>
<li>We use Dijkstra’s algorithm to find the shortest route to our destination.</li>
<li>The start node (current vehicle position) keeps changing, i.e. moving towards the destination along the calculated shortest path. For this reason we use the inverted form, where th... | algorithms graphs shortest path | 1 | Is there a variant of Dijkstra’s algorithm for partial recalculation? -- (algorithms graphs shortest path)
<p>Suppose the following:</p>

<ul>
<li>We use Dijkstra’s algorithm to find the shortest route to our destination.</li>
<li>The start node (current vehicle position) keeps changing, i.e. moving tow... | habedi/stack-exchange-dataset |
91,228 | What is the relationship/difference between best/worse/expected case and big O/omega/theta? | <p>In the big O section of Cracking the Coding Interview 6th edition, I read the following.</p>

<p><code>"Best, worse, and expected case describe the big O for expected inputs and scenarios."</code></p>

<p><code>"Big O, big omega, big theta describe the upper, lower and tighter bounds for the run-time... | algorithm analysis asymptotics | 1 | What is the relationship/difference between best/worse/expected case and big O/omega/theta? -- (algorithm analysis asymptotics)
<p>In the big O section of Cracking the Coding Interview 6th edition, I read the following.</p>

<p><code>"Best, worse, and expected case describe the big O for expected inputs and sce... | habedi/stack-exchange-dataset |
91,239 | Average-case analysis of linear search given that the desired element appears $k$ times | <p>The problem below is adapted from CLRS Problem 5-2 "Searching an unsorted array":</p>

<blockquote>
 <p>Consider a deterministic linear search algorithm which searches an array $A$ for $x$ in order, say $A[1], A[2], \ldots, A[n]$, until either it finds $A[i] = x$ or it reaches the end of the array. Assu... | algorithms algorithm analysis search algorithms probability theory average case | 1 | Average-case analysis of linear search given that the desired element appears $k$ times -- (algorithms algorithm analysis search algorithms probability theory average case)
<p>The problem below is adapted from CLRS Problem 5-2 "Searching an unsorted array":</p>

<blockquote>
 <p>Consider a deterministic li... | habedi/stack-exchange-dataset |
91,241 | What is the connection between combinatorial circuits and finite state automata? | <p>The diagram on the Wikipedia page of <a href="https://en.wikipedia.org/wiki/Finite-state_machine" rel="nofollow noreferrer">FSA</a> shows the hierarchy of the computational devices, in that diagram it is denoted that the finite state machines are superior to the combinatorial circuits.</p>

<p>Combinatorial ... | automata finite automata propositional logic | 1 | What is the connection between combinatorial circuits and finite state automata? -- (automata finite automata propositional logic)
<p>The diagram on the Wikipedia page of <a href="https://en.wikipedia.org/wiki/Finite-state_machine" rel="nofollow noreferrer">FSA</a> shows the hierarchy of the computational devices, in t... | habedi/stack-exchange-dataset |
91,244 | Resolution Algorithm - No new clauses | <p><a href="https://i.stack.imgur.com/qeEaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qeEaf.png" alt="Resolution algorithm from AIMA pg 255"></a></p>

<p>The standard resolution algorithm returns false if <em>no new clauses are added</em>. </p>

<p>I know that if $KB \land \neg ... | logic artificial intelligence propositional logic | 1 | Resolution Algorithm - No new clauses -- (logic artificial intelligence propositional logic)
<p><a href="https://i.stack.imgur.com/qeEaf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qeEaf.png" alt="Resolution algorithm from AIMA pg 255"></a></p>

<p>The standard resolution algorithm return... | habedi/stack-exchange-dataset |
91,248 | Dynamic All Pairs Shortest Paths algorithm | <p>I heard about the following problem in a competitive programming camp:</p>

<p>Given an undirected weighted graph $G$ with one vertex initially.</p>

<p>Suppose you are given two types of queries:</p>

<ol>
<li><p>Add a new vertex to $G$ with some undirected weighted edges between this ve... | algorithms graphs shortest path | 1 | Dynamic All Pairs Shortest Paths algorithm -- (algorithms graphs shortest path)
<p>I heard about the following problem in a competitive programming camp:</p>

<p>Given an undirected weighted graph $G$ with one vertex initially.</p>

<p>Suppose you are given two types of queries:</p>

<ol>
<l... | habedi/stack-exchange-dataset |
91,261 | Approximation factor for graph problems | <p>I am attempting to figure out how to use approximation factors to determine the answers an algorithm can return for graph problems.</p>

<p>For example, if a graph G actually has a maximum clique with 13 vertices, and we use a 1.5-approximation algorithm to approximate the maximum clique - what is the minimu... | graphs approximation | 1 | Approximation factor for graph problems -- (graphs approximation)
<p>I am attempting to figure out how to use approximation factors to determine the answers an algorithm can return for graph problems.</p>

<p>For example, if a graph G actually has a maximum clique with 13 vertices, and we use a 1.5-approximatio... | habedi/stack-exchange-dataset |
91,264 | Is a set of acyclic |V| - 1 light edges always a Minimum Spanning Tree? | <p>I am trying to prove the algorithm for Question 5 in <a href="https://www.cs.cmu.edu/afs/cs/academic/class/15210-f15/www/exams/exam2-practice-sol.pdf" rel="nofollow noreferrer">this practice exam</a>.</p>
<p>I am trying to prove this algorithm with the following three claims:</p>
<ol>
<li><p>Suppose we h... | graphs correctness proof minimum spanning tree | 1 | Is a set of acyclic |V| - 1 light edges always a Minimum Spanning Tree? -- (graphs correctness proof minimum spanning tree)
<p>I am trying to prove the algorithm for Question 5 in <a href="https://www.cs.cmu.edu/afs/cs/academic/class/15210-f15/www/exams/exam2-practice-sol.pdf" rel="nofollow noreferrer">this practice ex... | habedi/stack-exchange-dataset |
91,266 | What is the relationship between minimum vertex cover and minimum clique cover | <p><strong>Question: 
 What is the relationship between minimum vertex cover of a graph G and minimum clique cover of conflict graph of G?</strong></p>

<p><strong>Thanks!</strong></p>

<p>I believe the minimum vertex cover of G is equivalent to minimum clique cover of the conflict graph of G, or th... | graphs | 1 | What is the relationship between minimum vertex cover and minimum clique cover -- (graphs)
<p><strong>Question: 
 What is the relationship between minimum vertex cover of a graph G and minimum clique cover of conflict graph of G?</strong></p>

<p><strong>Thanks!</strong></p>

<p>I believe the minimu... | habedi/stack-exchange-dataset |
91,267 | Simulate $n$-PDA with $n-1$-PDA | <p>I've heard that every $n$-PDA when $n > 2$ is as powerful as $2$-PDA. Unfortunately every proof I'm able to find uses references to Turing Machines, which I haven't learned about yet. I'm sure there must exist an alternative proof, supposedly one that converts $n$-PDA to $n-1$-PDA, and then proceeds by induction,... | formal languages pushdown automata | 1 | Simulate $n$-PDA with $n-1$-PDA -- (formal languages pushdown automata)
<p>I've heard that every $n$-PDA when $n > 2$ is as powerful as $2$-PDA. Unfortunately every proof I'm able to find uses references to Turing Machines, which I haven't learned about yet. I'm sure there must exist an alternative proof, supposedly... | habedi/stack-exchange-dataset |
91,278 | Big Oh notation for a function with two inputs of linear growth | <p>I'm quite new to time-complexity analysis so I might have misunderstood some basic concepts but lets say we have the following function:</p>

<pre><code> function(int x, int y)
 for (int i = 0; i < x; i++)
 {} 

 for(int i = 0; i < y; i++)
 {}
</code></pre>... | algorithm analysis asymptotics runtime analysis loops | 1 | Big Oh notation for a function with two inputs of linear growth -- (algorithm analysis asymptotics runtime analysis loops)
<p>I'm quite new to time-complexity analysis so I might have misunderstood some basic concepts but lets say we have the following function:</p>

<pre><code> function(int x, int y)
 ... | habedi/stack-exchange-dataset |
91,281 | Maximal Win Score Distribution | <p>For the problem I'm considering, I'm looking at a sport (it's baseball) where:</p>

<ul>
<li>Two teams play a game against each other, head to head.</li>
<li>Each team has a finite, integer score (called "Runs") at the end of the game; this value is >= 0.</li>
<li>Games <strong>cannot</strong> en... | algorithms algorithm analysis | 1 | Maximal Win Score Distribution -- (algorithms algorithm analysis)
<p>For the problem I'm considering, I'm looking at a sport (it's baseball) where:</p>

<ul>
<li>Two teams play a game against each other, head to head.</li>
<li>Each team has a finite, integer score (called "Runs") at the end of the game;... | habedi/stack-exchange-dataset |
91,291 | Is there a formal difference between $f:X \to X$ and $f\in X \to X$? | <p>We can denote by $X\to X$ the set of all functions from $X$ to $X$. 
Therefore, we can use the following statement to say that $f$ is a function from $X$ to $X$:
$$f\in X\to X$$</p>

<p>But we usually state instead </p>

<p>$$f:X \to X$$</p>

<p>In fact, we could say that $X\to X$ is ... | type theory sets notation | 1 | Is there a formal difference between $f:X \to X$ and $f\in X \to X$? -- (type theory sets notation)
<p>We can denote by $X\to X$ the set of all functions from $X$ to $X$. 
Therefore, we can use the following statement to say that $f$ is a function from $X$ to $X$:
$$f\in X\to X$$</p>

<p>But we usually ... | habedi/stack-exchange-dataset |
91,297 | Recurrence relation T(n) = 3T(n-1) + n | <p>I'm trying to solve the recurrence relation T(n) = 3T(n-1) + n and I think the answer is O(n^3) because each new node spawns three child nodes in the recurrence tree. Is this correct? And, in terms of the recurrence tree, is there a more mathematical way to approach it?</p>
 | recurrence relation | 1 | Recurrence relation T(n) = 3T(n-1) + n -- (recurrence relation)
<p>I'm trying to solve the recurrence relation T(n) = 3T(n-1) + n and I think the answer is O(n^3) because each new node spawns three child nodes in the recurrence tree. Is this correct? And, in terms of the recurrence tree, is there a more mathematical wa... | habedi/stack-exchange-dataset |
91,300 | Complexity of Verification for Clique with Adjacency Matrix | <p>I am having trouble getting my head around what the complexity of the verification step for the CLIQUE problem would be -- specifically if an adjacency matrix is used. I know in general the complexity for this problem would be <code>O(k^2) * edges in G.</code></p>

<p>This is the specific question I am attem... | complexity theory graphs | 1 | Complexity of Verification for Clique with Adjacency Matrix -- (complexity theory graphs)
<p>I am having trouble getting my head around what the complexity of the verification step for the CLIQUE problem would be -- specifically if an adjacency matrix is used. I know in general the complexity for this problem would be ... | habedi/stack-exchange-dataset |
91,305 | If L is a regular language then also is the language $L1 = \{ w \in L | w \in L^R \}$? | <p>I am confused interpreting the statement of this question:</p>

<p>"If L is a regular language then also is the language $L1 = \{ w \in L | w \in L^R \}$?"</p>

<p>Should the symbol "|" (such as) be understood as an logical and?</p>

<p>The language L1, so, would be $ L \cap L^R $ - a subset... | formal languages regular languages | 1 | If L is a regular language then also is the language $L1 = \{ w \in L | w \in L^R \}$? -- (formal languages regular languages)
<p>I am confused interpreting the statement of this question:</p>

<p>"If L is a regular language then also is the language $L1 = \{ w \in L | w \in L^R \}$?"</p>

<p>Should the... | habedi/stack-exchange-dataset |
91,309 | Has the problem of finding the most profitable transactions given a set of discrete time series been well-studied? | <h1>Overview and Problem Description</h1>
<p>Suppose I have a set of <em>N</em> discrete time-series (represented as a map from time-interval-index to value/utility), and I would like to identify a sequence of actions in a particular time interval that would yield the highest profit at the end of the interval (assu... | algorithms optimization hash tables | 1 | Has the problem of finding the most profitable transactions given a set of discrete time series been well-studied? -- (algorithms optimization hash tables)
<h1>Overview and Problem Description</h1>
<p>Suppose I have a set of <em>N</em> discrete time-series (represented as a map from time-interval-index to value/uti... | habedi/stack-exchange-dataset |
91,318 | Why use a CFG instead of a DFG | <p>I just realized a Control-Flow Graph (CFG) is composed of <em>basic blocks</em>, which is a <em>set</em> of instructions. It is mentioned that you can still do stuff like dead code elimination and whatnot, with the CFG, but that seems like you'd be reaching into the basic block to figure that out. At that point you ... | compilers data flow analysis | 1 | Why use a CFG instead of a DFG -- (compilers data flow analysis)
<p>I just realized a Control-Flow Graph (CFG) is composed of <em>basic blocks</em>, which is a <em>set</em> of instructions. It is mentioned that you can still do stuff like dead code elimination and whatnot, with the CFG, but that seems like you'd be rea... | habedi/stack-exchange-dataset |
91,324 | How to Construct a Lattice from Program Statements | <p>In order to optimize a program, I am trying to figure out how the idea of a <em>lattice</em> applies to data-flow graphs, as introduced by <a href="https://www.google.com/search?q=piazza+dataflow+analysis+and+lattices" rel="nofollow noreferrer">this presentation</a> (first diagram below). The lattice seems to take a... | lattices data flow analysis | 1 | How to Construct a Lattice from Program Statements -- (lattices data flow analysis)
<p>In order to optimize a program, I am trying to figure out how the idea of a <em>lattice</em> applies to data-flow graphs, as introduced by <a href="https://www.google.com/search?q=piazza+dataflow+analysis+and+lattices" rel="nofollow ... | habedi/stack-exchange-dataset |
91,330 | What exactly is the semantic difference between set and type? | <p>EDIT: I've now asked a <a href="https://cs.stackexchange.com/questions/91357/what-exactly-is-the-semantic-difference-between-category-and-set">similar question about the difference between categories and sets.</a></p>

<p>Every time I read about type theory (which admittedly is rather informal), I can't real... | type theory sets | 1 | What exactly is the semantic difference between set and type? -- (type theory sets)
<p>EDIT: I've now asked a <a href="https://cs.stackexchange.com/questions/91357/what-exactly-is-the-semantic-difference-between-category-and-set">similar question about the difference between categories and sets.</a></p>

<p>Eve... | habedi/stack-exchange-dataset |
91,332 | Was my Huffman coding solution wrong? | <p>I finished my exam a moment ago and one of the question was to calculate Huffman coding for given probabilities:</p>

<pre><code>A: 0.15
B: 0.2
C: 0.55
D: 0.1
</code></pre>

<p>I encoded them as follows:</p>

<pre><code>A: 110
B: 10
C: 0
D: 111
</code></pre>&#x... | data compression huffman coding | 1 | Was my Huffman coding solution wrong? -- (data compression huffman coding)
<p>I finished my exam a moment ago and one of the question was to calculate Huffman coding for given probabilities:</p>

<pre><code>A: 0.15
B: 0.2
C: 0.55
D: 0.1
</code></pre>

<p>I encoded them as follows:</p>&#x... | habedi/stack-exchange-dataset |
91,335 | How to get initial flow for TSP with missing edges | <p>I need to solve a version of the traveling salesman problem with missing edges. I've decided to use simulated annealing.</p>

<p>How do I generate a valid initial path effectively?</p>

<p>I would use a greedy algorithm, but I can't be sure it will result in a valid path. I could still use it and hop... | graphs graph traversal heuristics traveling salesman | 1 | How to get initial flow for TSP with missing edges -- (graphs graph traversal heuristics traveling salesman)
<p>I need to solve a version of the traveling salesman problem with missing edges. I've decided to use simulated annealing.</p>

<p>How do I generate a valid initial path effectively?</p>

<p>I w... | habedi/stack-exchange-dataset |
91,336 | Problem with the mapping reduction from $A_{TM}$ to $HALT_{TM}$ | <p>Sipser provided the following proof to prove the mapping reduction from $A_{TM}$ to $HALT_{TM}$, it in fact tried to build a mapping function:</p>

<p><a href="https://i.stack.imgur.com/Tvaq2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tvaq2.jpg" alt="enter image description here"></a>... | turing machines computability reductions | 1 | Problem with the mapping reduction from $A_{TM}$ to $HALT_{TM}$ -- (turing machines computability reductions)
<p>Sipser provided the following proof to prove the mapping reduction from $A_{TM}$ to $HALT_{TM}$, it in fact tried to build a mapping function:</p>

<p><a href="https://i.stack.imgur.com/Tvaq2.jpg" re... | habedi/stack-exchange-dataset |
91,346 | Narrowing the field of a combitorial game | <p>I'm doing a challenge and it has posed a problem I am unfamiliar with. It goes like this, You start with two numbers, 1 and 1. You can combine the numbers in either direction, in this case makes 2,1 and 1,2 or in the case of 3,2 it would produce 5,2 or 3,5. Always starting from 1,1 my challenge is to try to find... | algorithms | 1 | Narrowing the field of a combitorial game -- (algorithms)
<p>I'm doing a challenge and it has posed a problem I am unfamiliar with. It goes like this, You start with two numbers, 1 and 1. You can combine the numbers in either direction, in this case makes 2,1 and 1,2 or in the case of 3,2 it would produce 5,2 or 3,5... | habedi/stack-exchange-dataset |
91,360 | Interval Scheduling Confusion | <p>I am reading some notes about interval scheduling. I gives the following diagram:
<a href="https://i.stack.imgur.com/wVEBM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wVEBM.png" alt="enter image description here"></a></p>

<p>and states that:</p>

<p>r2 is compatible with r... | greedy algorithms intervals | 1 | Interval Scheduling Confusion -- (greedy algorithms intervals)
<p>I am reading some notes about interval scheduling. I gives the following diagram:
<a href="https://i.stack.imgur.com/wVEBM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wVEBM.png" alt="enter image description here"></a></p>
&... | habedi/stack-exchange-dataset |
91,362 | Meaning of the notation Typ := TVar | (Typ → Typ) | <p>In the paper "introduction to type theory" by Herman Geuvers, it states the following definition for the type theory of propositional logic (I've added "convention 2" just for reference):</p>

<blockquote>
 <p><a href="https://i.stack.imgur.com/WlCVL.png" rel="nofollow noreferrer"><img src="https://i.st... | type theory notation | 1 | Meaning of the notation Typ := TVar | (Typ → Typ) -- (type theory notation)
<p>In the paper "introduction to type theory" by Herman Geuvers, it states the following definition for the type theory of propositional logic (I've added "convention 2" just for reference):</p>

<blockquote>
 <p><a href="https://i... | habedi/stack-exchange-dataset |
91,426 | Why does $W[1] = A[1]$ hold? | <p>By definition, a parameterized problem $(Q, \kappa)$ is in $W[1]$ if it can be transformed into a combinatorial circuit $\varphi$ in polynomial time, such that the weft of $\varphi$ is 1.</p>

<p>On the other hand, $(Q, \kappa) \in A[1]$, if it can be transformed into a parameterized model checking problem $... | complexity theory parameterized complexity | 1 | Why does $W[1] = A[1]$ hold? -- (complexity theory parameterized complexity)
<p>By definition, a parameterized problem $(Q, \kappa)$ is in $W[1]$ if it can be transformed into a combinatorial circuit $\varphi$ in polynomial time, such that the weft of $\varphi$ is 1.</p>

<p>On the other hand, $(Q, \kappa) \in ... | habedi/stack-exchange-dataset |
91,430 | What are the primal and dual planes in the context of the point-line duality? | <p>In computational geometry, we can define a duality between points and lines. The line is the primal (or dual) object of a point, or a point is the primal (or dual) object of a line. However, the exact definition of the primal and dual planes is often not given in the literature. It's a little bit confusing which one... | terminology computational geometry | 1 | What are the primal and dual planes in the context of the point-line duality? -- (terminology computational geometry)
<p>In computational geometry, we can define a duality between points and lines. The line is the primal (or dual) object of a point, or a point is the primal (or dual) object of a line. However, the exac... | habedi/stack-exchange-dataset |
91,434 | Can we use Operator precedence parsing with this grammar? | <p>This Grammar: </p>

<p>A-->Bbab|aa</p>

<p>B-->b</p>

<p>I think we can't because basically there is no relation between terminals? like no relation between a and b! or am i missing something? and the language of this grammar has only 2 members !</p>

<p>can we using Operator preceden... | formal languages automata compilers parsers | 1 | Can we use Operator precedence parsing with this grammar? -- (formal languages automata compilers parsers)
<p>This Grammar: </p>

<p>A-->Bbab|aa</p>

<p>B-->b</p>

<p>I think we can't because basically there is no relation between terminals? like no relation between a and b! or am i missing some... | habedi/stack-exchange-dataset |
91,438 | How to Compute the Fixed Point on a DataFlow Lattice | <p>Wondering the general overview of how to compute the fixed point on a program's dataflow lattice.</p>

<p>A fixed point of a function $f(x)$ is one where the output of the function equals the input, so:</p>

<p>$$f(x) = x$$</p>

<p>Given $f$ is an order preserving (monotonic) function
$x ... | lattices data flow analysis | 1 | How to Compute the Fixed Point on a DataFlow Lattice -- (lattices data flow analysis)
<p>Wondering the general overview of how to compute the fixed point on a program's dataflow lattice.</p>

<p>A fixed point of a function $f(x)$ is one where the output of the function equals the input, so:</p>

<p>$$f(... | habedi/stack-exchange-dataset |
91,442 | Correct term for a priority queue with unique elements | <p>Is there a standard term for a priority queue which can only hold a single occurrence of any element? This would be a priority queue for which operations such as "raise the priority of element <code>x</code> to the new value <code>p</code>" would make sense.</p>

<p>In this kind of an abstract container, if... | data structures terminology priority queues | 1 | Correct term for a priority queue with unique elements -- (data structures terminology priority queues)
<p>Is there a standard term for a priority queue which can only hold a single occurrence of any element? This would be a priority queue for which operations such as "raise the priority of element <code>x</code> to t... | habedi/stack-exchange-dataset |
91,448 | Class P is closed under concatenation | <p>Proving that Class P is closed under concatenation.</p>

<p>The answer is given below:</p>

<p><a href="https://i.stack.imgur.com/AkCdY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AkCdY.png" alt="enter image description here"></a></p>

<p>But I do not know why stage 2 i... | complexity theory closure properties polynomial time | 1 | Class P is closed under concatenation -- (complexity theory closure properties polynomial time)
<p>Proving that Class P is closed under concatenation.</p>

<p>The answer is given below:</p>

<p><a href="https://i.stack.imgur.com/AkCdY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ak... | habedi/stack-exchange-dataset |
91,460 | Proof of Lower Bound for Deterministic Distinct Elements Algorithm | <p>There is a proof in this document (page 8, Section 4, Lemma 3: <a href="https://inst.eecs.berkeley.edu/%7Ecs170/fa16/lecture-11-29.pdf" rel="nofollow noreferrer">https://inst.eecs.berkeley.edu/~cs170/fa16/lecture-11-29.pdf</a>) that mirrors a proof my professor gave in my algorithms class. The lemma states:</p>
... | algorithms information theory lower bounds streaming algorithm | 1 | Proof of Lower Bound for Deterministic Distinct Elements Algorithm -- (algorithms information theory lower bounds streaming algorithm)
<p>There is a proof in this document (page 8, Section 4, Lemma 3: <a href="https://inst.eecs.berkeley.edu/%7Ecs170/fa16/lecture-11-29.pdf" rel="nofollow noreferrer">https://inst.eecs.be... | habedi/stack-exchange-dataset |
91,462 | How come Datagram Packets between same source-destination pair may take different routes? | <p>This might be a rookie question, but I wanted to understand the following line.</p>

<p>My book says, each time a host wants to send a packet, it places the address of the destination host in the packet's header. Okay, I understand this. </p>

<p>Also, packets forwarded using destination address have... | computer networks | 1 | How come Datagram Packets between same source-destination pair may take different routes? -- (computer networks)
<p>This might be a rookie question, but I wanted to understand the following line.</p>

<p>My book says, each time a host wants to send a packet, it places the address of the destination host in the ... | habedi/stack-exchange-dataset |
91,463 | Term rewrite system for terms of lambda calculus? | <p>Are there term rewrite systems, that can rewrite complex lambda term (with nested function application) into some other lambda terms, I.e. reorde function application and, possibly, introduce new variables and add some additional functions into the final term? Google is no help here, because it says, that lamda calc... | lambda calculus term rewriting | 1 | Term rewrite system for terms of lambda calculus? -- (lambda calculus term rewriting)
<p>Are there term rewrite systems, that can rewrite complex lambda term (with nested function application) into some other lambda terms, I.e. reorde function application and, possibly, introduce new variables and add some additional f... | habedi/stack-exchange-dataset |
91,473 | Fractional vertex cover number may not be feasible? Very confusing! | <p>For my project, I try to use <strong>minimum fractional vertex cover number (MFVC)</strong>. (Please find below definition details) MFVC can be formulated as optimal solution of a linear program relaxation.</p>

<p>However I find that every linear program relaxation is either infeasible, unbounded, or has an... | graphs linear programming | 1 | Fractional vertex cover number may not be feasible? Very confusing! -- (graphs linear programming)
<p>For my project, I try to use <strong>minimum fractional vertex cover number (MFVC)</strong>. (Please find below definition details) MFVC can be formulated as optimal solution of a linear program relaxation.</p>
&#x... | habedi/stack-exchange-dataset |
91,474 | Adding edges to a graph that satisfy logical expressions | <p>Easy question. I have a homework problem with its answer that i am unable to interpret. </p>

<p><a href="https://i.stack.imgur.com/dpMDh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dpMDh.jpg" alt="enter image description here"></a></p>

<p>An explanation on how to arrive at ... | graphs colorings | 1 | Adding edges to a graph that satisfy logical expressions -- (graphs colorings)
<p>Easy question. I have a homework problem with its answer that i am unable to interpret. </p>

<p><a href="https://i.stack.imgur.com/dpMDh.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dpMDh.jpg" alt="enter i... | habedi/stack-exchange-dataset |
91,478 | Is there a difference between computational graphs and neural networks? | <p>According to <a href="http://www.deepideas.net/deep-learning-from-scratch-i-computational-graphs/" rel="nofollow noreferrer">this post</a>, "neural networks are a special form [of a computational graph]". I think that one can infer from that that all neural networks are computational graphs.</p>

<p>My quest... | graphs neural networks | 1 | Is there a difference between computational graphs and neural networks? -- (graphs neural networks)
<p>According to <a href="http://www.deepideas.net/deep-learning-from-scratch-i-computational-graphs/" rel="nofollow noreferrer">this post</a>, "neural networks are a special form [of a computational graph]". I think that... | habedi/stack-exchange-dataset |
91,498 | Analysing the algorithm of a language called CONNECTED in Sipser to show that it belongs to class P | <p>The question and its answer is given in the following picture:</p>

<p><a href="https://i.stack.imgur.com/W5lJk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W5lJk.png" alt="enter image description here"></a></p>

<p>But I do not understand why stage 2 causes at most $n+1$ repeti... | complexity theory turing machines computability time complexity p vs np | 1 | Analysing the algorithm of a language called CONNECTED in Sipser to show that it belongs to class P -- (complexity theory turing machines computability time complexity p vs np)
<p>The question and its answer is given in the following picture:</p>

<p><a href="https://i.stack.imgur.com/W5lJk.png" rel="nofollow n... | habedi/stack-exchange-dataset |
91,501 | Are there any optimization problems in P whose decision version is hard? | <p>Normally to show that an optimization problem is hard, we show the corresponding decision version of the problem is hard. However, is this sufficient to support the conclusion? Does there exist any optimization problem which is easy but its decision version is hard?</p>
 | complexity theory optimization np hard decision problem search problem | 1 | Are there any optimization problems in P whose decision version is hard? -- (complexity theory optimization np hard decision problem search problem)
<p>Normally to show that an optimization problem is hard, we show the corresponding decision version of the problem is hard. However, is this sufficient to support the con... | habedi/stack-exchange-dataset |
91,502 | Find the maximizing row-column matches in a matrix | <p>I have a set of R x C matrices similar to the following (can be much longer):</p>

<pre>
 C1 C2 C3 C4 C5 C6
R1 0.32 0.81 NA NA NA NA
R2 0.90 -0.44 0.95 NA NA NA
R3 NA 0.93 0.86 0.24 NA NA
R4 NA ... | combinatorics matrices | 1 | Find the maximizing row-column matches in a matrix -- (combinatorics matrices)
<p>I have a set of R x C matrices similar to the following (can be much longer):</p>

<pre>
 C1 C2 C3 C4 C5 C6
R1 0.32 0.81 NA NA NA NA
R2 0.90 -0.44 0.95 NA ... | habedi/stack-exchange-dataset |
91,519 | Could a directed graph be bipartite? | <p>I check for the symmetric directed graph and it's impossible to be bipartite , because we can't divide the vertices into two sets since all will have in - and out arrow 
but in general it could be right ?
 if I draw a graph with one direction </p>
 | algorithms graphs | 1 | Could a directed graph be bipartite? -- (algorithms graphs)
<p>I check for the symmetric directed graph and it's impossible to be bipartite , because we can't divide the vertices into two sets since all will have in - and out arrow 
but in general it could be right ?
 if I draw a graph with one direction </p>&#... | habedi/stack-exchange-dataset |
91,539 | Are all MST minimum spanning trees reachable by Kruskal and Prim? | <p>I believe this is true but have not been able to get a formal proof for either. But is it true that any minimum spanning tree is reachable by applying Kruskal's algorithm? Similarly, is this true for Prim's algorithm?</p>

<p>EDIT: To be more precise, I want to know if given an MST for a connected, undirecte... | algorithms graphs minimum spanning tree | 1 | Are all MST minimum spanning trees reachable by Kruskal and Prim? -- (algorithms graphs minimum spanning tree)
<p>I believe this is true but have not been able to get a formal proof for either. But is it true that any minimum spanning tree is reachable by applying Kruskal's algorithm? Similarly, is this true for Prim's... | habedi/stack-exchange-dataset |
91,549 | The equational theory of regular languages has no finite set of axioms for general alphabets | <p>According to <a href="http://umj.imath.kiev.ua/archiv/1964/01/umj_1964_01_10002_20139.pdf" rel="nofollow noreferrer">Redko</a> the equational theory of regular languages with operations $+, \cdot, *$ over a single letter has no finite set of axioms. </p>

<blockquote>
 <p>Why does this imply that it has... | formal languages regular languages finite automata first order logic | 1 | The equational theory of regular languages has no finite set of axioms for general alphabets -- (formal languages regular languages finite automata first order logic)
<p>According to <a href="http://umj.imath.kiev.ua/archiv/1964/01/umj_1964_01_10002_20139.pdf" rel="nofollow noreferrer">Redko</a> the equational theory o... | habedi/stack-exchange-dataset |
91,560 | Suppose G is simple graph with n vertices. Prove that G has twice as many edges as vertices only if $n\geq 5$ | <p>I just didn't understand the second part of the prove</p>

<p><strong>"G has twice as many edges as vertices only "</strong>... what do I actually have to prove ?</p>

<p>I understand it like $n=2e$ , is it right ?</p>

<p>then isn't it's just similar to the degree equation ??</p>
 | algorithms graphs | 1 | Suppose G is simple graph with n vertices. Prove that G has twice as many edges as vertices only if $n\geq 5$ -- (algorithms graphs)
<p>I just didn't understand the second part of the prove</p>

<p><strong>"G has twice as many edges as vertices only "</strong>... what do I actually have to prove ?</p>

... | habedi/stack-exchange-dataset |
91,563 | Is every problem in NP? | <p>My friend and I were studying NP-hard problems and NP-completeness. I don't think we have understood the concept very well so I thought I would come here to solve our doubt. </p>

<p>To show that a given problem is in NP, we have to verify a solution to a given instance of the problem can be solved in polyno... | complexity theory np hard np p vs np | 1 | Is every problem in NP? -- (complexity theory np hard np p vs np)
<p>My friend and I were studying NP-hard problems and NP-completeness. I don't think we have understood the concept very well so I thought I would come here to solve our doubt. </p>

<p>To show that a given problem is in NP, we have to verify a s... | habedi/stack-exchange-dataset |
91,574 | Counting solutions of a particular type in HORN SAT | <p>I am interested in counting the number of solutions of a particular type (say #) in HORN SAT. I have 2 questions concerning the same.</p>

<ol>
<li>Suppose we have a HORN SAT -: $(x_1) \land (x_2 \implies x_1)$, then the solutions are $(1, 0)$ and $(1,1)$. For solutions of type #, I would like to elimina... | satisfiability counting sat solvers | 1 | Counting solutions of a particular type in HORN SAT -- (satisfiability counting sat solvers)
<p>I am interested in counting the number of solutions of a particular type (say #) in HORN SAT. I have 2 questions concerning the same.</p>

<ol>
<li>Suppose we have a HORN SAT -: $(x_1) \land (x_2 \implies x_1)$, ... | habedi/stack-exchange-dataset |
91,579 | How is memory address applied to address pins in RAM chips | <p>I'm reading this book about assembly however I got stuck on one part, I can't seem to comprehend how memory address is 'applied' to the address pins</p>

<p>This is the image from the book</p>

<p><a href="https://i.stack.imgur.com/dudp5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.... | computer architecture | 1 | How is memory address applied to address pins in RAM chips -- (computer architecture)
<p>I'm reading this book about assembly however I got stuck on one part, I can't seem to comprehend how memory address is 'applied' to the address pins</p>

<p>This is the image from the book</p>

<p><a href="https://i... | habedi/stack-exchange-dataset |
91,584 | Proving that if L is regular. Then L′ = {ww : w ∈ L} is regular | <p>I believe this statement to be true. And here's my reasoning: </p>

<blockquote>
 <p>Based on regular languages properties, the concatenation of two regular languages is regular. And since L′ = L · L, it follows that L′ must also be regular.</p>
</blockquote>

<p>Do you think my reasoning is... | formal languages regular languages closure properties | 1 | Proving that if L is regular. Then L′ = {ww : w ∈ L} is regular -- (formal languages regular languages closure properties)
<p>I believe this statement to be true. And here's my reasoning: </p>

<blockquote>
 <p>Based on regular languages properties, the concatenation of two regular languages is regular. An... | habedi/stack-exchange-dataset |
91,585 | Interpreting camera matrix | <p>I'm having some trouble interpreting the camera matrix $K = \begin{bmatrix} f_x & s & x_0 \\ 0 & f_y & y_0 \\ 0 & 0 & 1 \end{bmatrix}$ after it multiplies some 3D vector.</p>

<p>Assume that $f_x = f_y = f$ and $s = 1$</p>

<p>$\begin{bmatrix} f & 1 & x_0 \\ 0 & f ... | computer vision image processing linear algebra | 1 | Interpreting camera matrix -- (computer vision image processing linear algebra)
<p>I'm having some trouble interpreting the camera matrix $K = \begin{bmatrix} f_x & s & x_0 \\ 0 & f_y & y_0 \\ 0 & 0 & 1 \end{bmatrix}$ after it multiplies some 3D vector.</p>

<p>Assume that $f_x = f_y = f... | habedi/stack-exchange-dataset |
91,597 | Is a perfect matching's weight less than MST of a metric graph? | <p>This is part of a bigger proof I'm trying to solve, which eventually came down to one thing:</p>

<p>Let $G=(V,E)$ an un-directed, complete, <strong>metric</strong> graph (maintains the triangle inequality) with an even number of vertices. Let $PM$ denote a <em>minimum-weight</em>-perfect matching on $E$ and... | graphs matching minimum spanning tree | 1 | Is a perfect matching's weight less than MST of a metric graph? -- (graphs matching minimum spanning tree)
<p>This is part of a bigger proof I'm trying to solve, which eventually came down to one thing:</p>

<p>Let $G=(V,E)$ an un-directed, complete, <strong>metric</strong> graph (maintains the triangle inequal... | habedi/stack-exchange-dataset |
91,603 | Find all substrings that fit the mask with asterisks | <p>There is a problem.</p>

<p>Given string $text$ containing only letters and string $mask$ containing letters and asterisks (*), where asterisk means substitution of zero or more letters, find all substrings of $text$ that fit $mask$.</p>

<p>There is an example: let's $text=cabccbacbacab$, $mask=\tex... | algorithms strings substrings string matching | 1 | Find all substrings that fit the mask with asterisks -- (algorithms strings substrings string matching)
<p>There is a problem.</p>

<p>Given string $text$ containing only letters and string $mask$ containing letters and asterisks (*), where asterisk means substitution of zero or more letters, find all substring... | habedi/stack-exchange-dataset |
91,607 | Construct initial marking for marked graph so that the graph is live and safe | <p>I am learning something about P/T petri nets from the book from Wolfgang-Reisig authors and on the seventh chapter's end there is an exercise I can not really work out.</p>

<p>It asks me to construct initial marking such that the following marked graph is live and safe. Note that yellow highlighted place is... | petri nets | 1 | Construct initial marking for marked graph so that the graph is live and safe -- (petri nets)
<p>I am learning something about P/T petri nets from the book from Wolfgang-Reisig authors and on the seventh chapter's end there is an exercise I can not really work out.</p>

<p>It asks me to construct initial markin... | habedi/stack-exchange-dataset |
91,608 | Can Turing machines simulate the unbounded minization operator applied to a partial function? | <p>I am a little bit confused with the unbounded minimization ($\mu$ operator of the $\mu$ recursive functions).</p>

<p>The $\mu$ operator is $\mu(f)(x) = \min(n | f(x, n) > 0)$ and the operator is said <em>safe</em> if we only apply it to functions such that for every $x$, $f(x, n) > 0$ for some $n$. In... | turing machines mu recursion | 1 | Can Turing machines simulate the unbounded minization operator applied to a partial function? -- (turing machines mu recursion)
<p>I am a little bit confused with the unbounded minimization ($\mu$ operator of the $\mu$ recursive functions).</p>

<p>The $\mu$ operator is $\mu(f)(x) = \min(n | f(x, n) > 0)$ an... | habedi/stack-exchange-dataset |
91,614 | Write a grammar for a language $L=\{ba^{2^n}b |n\ge 1\}$ | <p>Write a grammar for a language $$L=\{ba^{2^n}b | n\ge 1\}.$$ It's not even context-free as I think. I just can't produce it, although I've tried a lot.
Now my best attempt is: 
\begin{aligned}
S &\to RLM \\
M &\to AM | A \\
LA &\to aa \\
aA &\to Aaa \\
RA &\to \varepsi... | formal languages formal grammars | 1 | Write a grammar for a language $L=\{ba^{2^n}b |n\ge 1\}$ -- (formal languages formal grammars)
<p>Write a grammar for a language $$L=\{ba^{2^n}b | n\ge 1\}.$$ It's not even context-free as I think. I just can't produce it, although I've tried a lot.
Now my best attempt is: 
\begin{aligned}
S &\to RLM \\... | habedi/stack-exchange-dataset |
91,616 | Restriction and re-labeling on CCS | <p>In a process like
$$
R \stackrel{def}=((a.\bar{b}.0)\setminus\{b\})[a\to b]\mid(\bar{b}.b.0)+\bar{b}.c.0
$$</p>

<p>$b$ is restricted to perform on the inner process of RHS $(a.\bar{b}.0)\setminus\{b\}$, thereafter the $a$ is relabeled to $b$. 
What I am confused is in drawing the LTS of it, ... | process algebras transition systems ccs | 1 | Restriction and re-labeling on CCS -- (process algebras transition systems ccs)
<p>In a process like
$$
R \stackrel{def}=((a.\bar{b}.0)\setminus\{b\})[a\to b]\mid(\bar{b}.b.0)+\bar{b}.c.0
$$</p>

<p>$b$ is restricted to perform on the inner process of RHS $(a.\bar{b}.0)\setminus\{b\}$, thereafter th... | habedi/stack-exchange-dataset |
91,627 | Does graph G with all vertices of degree 3 have a cut vertex? | <p>I'm asked to draw a simple connected graph, if possible, in which every vertex has degree 3 and has a cut vertex. I tried drawing a cycle graph, in which all the degrees are 2, and it seems there is no cut vertex there. I know, so far, that, by the handshaking theorem, the number of vertices have to be even and they... | graphs discrete mathematics max cut | 1 | Does graph G with all vertices of degree 3 have a cut vertex? -- (graphs discrete mathematics max cut)
<p>I'm asked to draw a simple connected graph, if possible, in which every vertex has degree 3 and has a cut vertex. I tried drawing a cycle graph, in which all the degrees are 2, and it seems there is no cut vertex t... | habedi/stack-exchange-dataset |
91,640 | O(n*log(n)) Turing Machine with exactly 1 tape for “equal number of a's and b's in a given word”? | <p>I need to build a TM with exactly 1 tape for the language L = {w| w is a word with same number of a's and b's in it, for example: abba, aababb}</p>

<p>The TM has to have ONLY 1 tape and it has to run in O(nlog(n)) time. I understand how to do it in O(n^2) but i have no idea how to make it nlog(n).</p>
&... | algorithms turing machines time complexity | 1 | O(n*log(n)) Turing Machine with exactly 1 tape for “equal number of a's and b's in a given word”? -- (algorithms turing machines time complexity)
<p>I need to build a TM with exactly 1 tape for the language L = {w| w is a word with same number of a's and b's in it, for example: abba, aababb}</p>

<p>The TM has ... | habedi/stack-exchange-dataset |
91,642 | clustering with uncertain number of clusters | <p>I detect a unmanned aerial vehicle(UAV) in a picture using template matching. The template library only contains targets with different scales, rotations and other differences.I want to simplify the template library using clustering. I learned the k-means and Gaussian mixture model(GMM)but they all need determine th... | clustering | 1 | clustering with uncertain number of clusters -- (clustering)
<p>I detect a unmanned aerial vehicle(UAV) in a picture using template matching. The template library only contains targets with different scales, rotations and other differences.I want to simplify the template library using clustering. I learned the k-means ... | habedi/stack-exchange-dataset |
91,653 | Assuming that P=NP - Finding an optimal algorithm for 3SAT | <p>Let assume that P=NP so we have both search and decision algorithms for 3SAT at polynomial time.<br>
Can you help me to find an optimal algorithm for optimize 3SAT, i.e.: to find the maximum number of clauses in $\varphi$ that can be satisfied. </p>

<p>Thank you!</p>

<p>P.S.<br>
You can as... | algorithms optimization 3 sat | 1 | Assuming that P=NP - Finding an optimal algorithm for 3SAT -- (algorithms optimization 3 sat)
<p>Let assume that P=NP so we have both search and decision algorithms for 3SAT at polynomial time.<br>
Can you help me to find an optimal algorithm for optimize 3SAT, i.e.: to find the maximum number of clauses in $\varph... | habedi/stack-exchange-dataset |
91,654 | A Question about what it means to Compare two Vectors | <p>Please consider the following question:
Given an integer m by n matrix A and an integer m-vector b, the 0-1 integer programming problem asks whether there exists an integer n-vector x with elements in the set ${ 0, 1 }$ such that $Ax \leq b$. Prove that 0-1 integer programming is
NP-complete.</p>

<p... | complexity theory terminology | 1 | A Question about what it means to Compare two Vectors -- (complexity theory terminology)
<p>Please consider the following question:
Given an integer m by n matrix A and an integer m-vector b, the 0-1 integer programming problem asks whether there exists an integer n-vector x with elements in the set ${ 0, 1 }$ such... | habedi/stack-exchange-dataset |
91,658 | Is this language NP Hard? | <p>$L=\{$$($$m$,$w$,$n$$)$| $m$ is an encoding of a non-deterministic Turing machine, $w$ is any word/string in the closure of alphabet, i.e. $w\in\Sigma^*$, $n$ is any positive integer, i.e. $n\in\Bbb{Z}$ and $n>0$, and $m$ accepts $w$ for a maximum of $n$ moves/steps/operations $\}$</p>

<p>Alphabet is $\S... | complexity theory turing machines np hard np nondeterminism | 1 | Is this language NP Hard? -- (complexity theory turing machines np hard np nondeterminism)
<p>$L=\{$$($$m$,$w$,$n$$)$| $m$ is an encoding of a non-deterministic Turing machine, $w$ is any word/string in the closure of alphabet, i.e. $w\in\Sigma^*$, $n$ is any positive integer, i.e. $n\in\Bbb{Z}$ and $n>0$, and $m$ a... | habedi/stack-exchange-dataset |
91,667 | When using resolution variable elimination to simplify a cnf, does that change the truth values of the other variables? | <p>When you use resolution <a href="https://www.msoos.org/2014/04/why-its-hard-to-eliminate-variables/" rel="nofollow noreferrer">variable elimination</a> to preprocess/simplify a formula in cnf form the resulting formula is equisatisfiable. </p>

<p>What I wonder about is if I can use this technique to remove ... | satisfiability boolean algebra | 1 | When using resolution variable elimination to simplify a cnf, does that change the truth values of the other variables? -- (satisfiability boolean algebra)
<p>When you use resolution <a href="https://www.msoos.org/2014/04/why-its-hard-to-eliminate-variables/" rel="nofollow noreferrer">variable elimination</a> to prepro... | habedi/stack-exchange-dataset |
91,675 | What is the asymptotic time complexity of the following 2 recurrences? | <p>$$T(n) = (\log n) \cdot T(n/\log n) + \Theta(n^i \cdot (\log n)^k)$$</p>

<p>and</p>

<p>$$T(n) = (n\log n) \cdot T(n/\log n) + \Theta(n^i \cdot (\log n)^k)$$</p>

<p>for any given $i$ and $k$.</p>

<p>I think it helps to know that for $0<j\leq 1$</p>

<p>\begin{equation}&#... | complexity theory algorithm analysis time complexity asymptotics runtime analysis | 1 | What is the asymptotic time complexity of the following 2 recurrences? -- (complexity theory algorithm analysis time complexity asymptotics runtime analysis)
<p>$$T(n) = (\log n) \cdot T(n/\log n) + \Theta(n^i \cdot (\log n)^k)$$</p>

<p>and</p>

<p>$$T(n) = (n\log n) \cdot T(n/\log n) + \Theta(n^i \cdo... | habedi/stack-exchange-dataset |
91,702 | Any mathematical tools for analyzing mutable memory | <p>Wondering if there are any documents, theories, or methodologies for dealing with mutable memory mathematically. Basically a formal algebraic model of how computers manipulate memory. Along the lines of, say I want to model an <code>add</code> operation at a low level, and it writes its output to a register. Then we... | formal methods category theory | 1 | Any mathematical tools for analyzing mutable memory -- (formal methods category theory)
<p>Wondering if there are any documents, theories, or methodologies for dealing with mutable memory mathematically. Basically a formal algebraic model of how computers manipulate memory. Along the lines of, say I want to model an <c... | habedi/stack-exchange-dataset |
91,712 | Upper bound derivation of expected time for finding a large cut | <p>Given an undirected graph $G$ with $n$ vertices and $m$ edges, we build a cut as following. Initially sets (of vertices) $A$ and $B$ are empty. For each vertex $v$ we flip a fair coin and according to outcome we put $v$ either in $A$ or $B$. </p>

<p>Let $X$ be a r.v. denoting the cut size, i.e. the number o... | probability theory | 1 | Upper bound derivation of expected time for finding a large cut -- (probability theory)
<p>Given an undirected graph $G$ with $n$ vertices and $m$ edges, we build a cut as following. Initially sets (of vertices) $A$ and $B$ are empty. For each vertex $v$ we flip a fair coin and according to outcome we put $v$ either in... | habedi/stack-exchange-dataset |
91,720 | Is it possible to detect a simple negative-weight cycle of weight $N$ in polynomial time? | <p>Given a directed graph and an integer $N$, is it possible to detect a simple negative-weight cycle whose edges sum to $N$ in polynomial time? I thought about modifying the Floyd-Warshall algorithm to check if the diagonals equal $N$ as they get set, but I realized this wouldn't work if a vertex appeared in multiple ... | graphs graph traversal | 1 | Is it possible to detect a simple negative-weight cycle of weight $N$ in polynomial time? -- (graphs graph traversal)
<p>Given a directed graph and an integer $N$, is it possible to detect a simple negative-weight cycle whose edges sum to $N$ in polynomial time? I thought about modifying the Floyd-Warshall algorithm to... | habedi/stack-exchange-dataset |
91,724 | The line-covering step in the Hungarian algorithm | <p>I am trying to understand the Hungarian algorithm for the assignment problem.</p>

<p>I found <a href="http://www.math.harvard.edu/archive/20_spring_05/handouts/assignment_overheads.pdf" rel="nofollow noreferrer">this presentation</a> which gives an excellent explanation about the algorithm. However, there ... | algorithms matrices | 1 | The line-covering step in the Hungarian algorithm -- (algorithms matrices)
<p>I am trying to understand the Hungarian algorithm for the assignment problem.</p>

<p>I found <a href="http://www.math.harvard.edu/archive/20_spring_05/handouts/assignment_overheads.pdf" rel="nofollow noreferrer">this presentation</a>... | habedi/stack-exchange-dataset |
91,728 | How are boolean circuits used for solving P vs NP? | <p>In the paper <a href="https://web.stanford.edu/~gavish/documents/sipser-pvsnp.pdf" rel="nofollow noreferrer">https://web.stanford.edu/~gavish/documents/sipser-pvsnp.pdf</a> , it is mentioned under the Status section that boolean circuits have been used to try and solve P vs NP. Can anyone explain to me in simple ter... | complexity theory p vs np | 1 | How are boolean circuits used for solving P vs NP? -- (complexity theory p vs np)
<p>In the paper <a href="https://web.stanford.edu/~gavish/documents/sipser-pvsnp.pdf" rel="nofollow noreferrer">https://web.stanford.edu/~gavish/documents/sipser-pvsnp.pdf</a> , it is mentioned under the Status section that boolean circui... | habedi/stack-exchange-dataset |
91,737 | Equivalent Colorings of Graphs | <p>Call two proper graph colorings equivalent if one can be obtained from the other by a permutation of the colors.
In other words, they are the "same" coloring.</p>

<p>I'm interested in finding proper non-equivalent colorings.
Of course, the decision problem of determining whether or not there is such... | graphs approximation colorings | 1 | Equivalent Colorings of Graphs -- (graphs approximation colorings)
<p>Call two proper graph colorings equivalent if one can be obtained from the other by a permutation of the colors.
In other words, they are the "same" coloring.</p>

<p>I'm interested in finding proper non-equivalent colorings.
Of cours... | habedi/stack-exchange-dataset |
91,748 | Symmetry of IP complexity class | <p>Wikipedia defines the <a href="https://en.wikipedia.org/wiki/IP_(complexity)" rel="noreferrer">IP complexity class</a> as follows:</p>

<blockquote>
 <p>A language $L$ belongs to IP if there exists $V,P$ such that for all
 $Q$, $w$,
 $$w\in L\Rightarrow Pr[V\leftrightarrow P\text{ accepts }w]\... | interactive proof systems | 1 | Symmetry of IP complexity class -- (interactive proof systems)
<p>Wikipedia defines the <a href="https://en.wikipedia.org/wiki/IP_(complexity)" rel="noreferrer">IP complexity class</a> as follows:</p>

<blockquote>
 <p>A language $L$ belongs to IP if there exists $V,P$ such that for all
 $Q$, $w$,
... | habedi/stack-exchange-dataset |
91,750 | Find the sum of the first K subsets of integer array | <p>We have given a multiset of $N$ integer, both positive or negative. Consider all $2^N$ subsets, sorted by their sum (the empty subset has sum 0). We want an algorithm that outputs only the first $K$ sums.</p>

<p>The problem is that $N$ can be very big number (up to 100000), so we cannot generate all subset... | algorithms optimization sets | 1 | Find the sum of the first K subsets of integer array -- (algorithms optimization sets)
<p>We have given a multiset of $N$ integer, both positive or negative. Consider all $2^N$ subsets, sorted by their sum (the empty subset has sum 0). We want an algorithm that outputs only the first $K$ sums.</p>

<p>The prob... | habedi/stack-exchange-dataset |
91,759 | How to model conditionals with first-class functions? | <p>Since languages with recursible first-class functions are Turing-complete, they should be able to express anything expressible in any other programming language. Therefore, it should be possible to model conditional expressions (i.e. if-statements) with first-class functions. Could someone illustrate how to do this?... | haskell lambda calculus | 1 | How to model conditionals with first-class functions? -- (haskell lambda calculus)
<p>Since languages with recursible first-class functions are Turing-complete, they should be able to express anything expressible in any other programming language. Therefore, it should be possible to model conditional expressions (i.e. ... | habedi/stack-exchange-dataset |
91,761 | What is the meaning of idiosyncratic when refering to multiprocess abstractions? | <p>I am currently reading <a href="https://dl.acm.org/citation.cfm?id=2592812" rel="nofollow noreferrer">this paper</a> on library operating systems, more specific on Graphene. I stumbled over the following sentence:</p>

<p><em>"Because multiprocess abstractions, such as signals or System V IPC, tend to be idi... | operating systems | 1 | What is the meaning of idiosyncratic when refering to multiprocess abstractions? -- (operating systems)
<p>I am currently reading <a href="https://dl.acm.org/citation.cfm?id=2592812" rel="nofollow noreferrer">this paper</a> on library operating systems, more specific on Graphene. I stumbled over the following sentence:... | habedi/stack-exchange-dataset |
91,762 | Can anyone find a mapping from the set of all possible string to the natural numbers? | <p><strong>Can anyone find a map(injection) $h$ from the set of all possible strings $S^*$ to the natural numbers $\mathbb{N}$</strong>?</p>

<p>$$h : S^* \rightarrow \mathbb{N} $$</p>

<p>Assume $S$ is finite. I would prefer an efficient map.</p>

<p>There should be nice applications of this qu... | formal languages discrete mathematics hash cryptography | 1 | Can anyone find a mapping from the set of all possible string to the natural numbers? -- (formal languages discrete mathematics hash cryptography)
<p><strong>Can anyone find a map(injection) $h$ from the set of all possible strings $S^*$ to the natural numbers $\mathbb{N}$</strong>?</p>

<p>$$h : S^* \rightarro... | habedi/stack-exchange-dataset |
91,764 | Doubt on declaring an array in pseudocode | <p>So here's the code:-</p>

<p>DECLARE number as INTEGER</p>

<p>PRINT "Enter a number"</p>

<p>INPUT number</p>

<p>DECLARE randomarray [1:number] AS INTEGER</p>

<p>Is this possible? i.e whilst declaring arrays, can we use variables?</p>

<p>Note:The question is strict... | arrays pseudocode | 1 | Doubt on declaring an array in pseudocode -- (arrays pseudocode)
<p>So here's the code:-</p>

<p>DECLARE number as INTEGER</p>

<p>PRINT "Enter a number"</p>

<p>INPUT number</p>

<p>DECLARE randomarray [1:number] AS INTEGER</p>

<p>Is this possible? i.e whilst declaring arrays, ... | habedi/stack-exchange-dataset |
91,766 | Are hash onions inherently sequential? | <p>An open problem in complexity theory is whether <a href="https://en.wikipedia.org/wiki/NC_(complexity)" rel="nofollow noreferrer">NC equals P</a>.</p>

<p>I'm somewhat confused because I would have thought that it's obvious that NC != P because of hash onions. A hash onion is when you start with some input $... | complexity theory | 1 | Are hash onions inherently sequential? -- (complexity theory)
<p>An open problem in complexity theory is whether <a href="https://en.wikipedia.org/wiki/NC_(complexity)" rel="nofollow noreferrer">NC equals P</a>.</p>

<p>I'm somewhat confused because I would have thought that it's obvious that NC != P because of... | habedi/stack-exchange-dataset |
91,769 | Closure of context-free languages under regular quotient | <p>Knowing that $C$ is a context-free language and $R$ is a regular language, how to prove that
$C / R = \{w| \exists x \in R: wx \in C\}$
is also a context-free language?</p>
 | regular languages automata context free finite automata | 1 | Closure of context-free languages under regular quotient -- (regular languages automata context free finite automata)
<p>Knowing that $C$ is a context-free language and $R$ is a regular language, how to prove that
$C / R = \{w| \exists x \in R: wx \in C\}$
is also a context-free language?</p>
 | habedi/stack-exchange-dataset |
91,773 | Why is the Turing Machine a popular model of computation? | <p>I am a CS undergraduate. I understand how Turing came up with his abstract machine (modeling a person doing a computation), but it seems to me to be an awkward, inelegant abstraction. Why do we consider a "tape", and a machine head writing symbols, changing state, shifting the tape back and forth? </p>

<p>W... | turing machines computation models | 1 | Why is the Turing Machine a popular model of computation? -- (turing machines computation models)
<p>I am a CS undergraduate. I understand how Turing came up with his abstract machine (modeling a person doing a computation), but it seems to me to be an awkward, inelegant abstraction. Why do we consider a "tape", and a ... | habedi/stack-exchange-dataset |
91,782 | Is it NP complete to decide whether a graph has $k$ disjoint triangles? | <p>I'm trying to prove that $$k\text{-Matching}\le_p k\text{-Disjoint-Triangles}$$
but I was told that the $k\text{-Matching}$ (decide whether a graph has a matching of size $k$ ) can be solve in polynomial time. Then I'm stuck here.</p>

<p>Could anyone help me out here?</p>
 | complexity theory np complete reductions np hard decision problem | 1 | Is it NP complete to decide whether a graph has $k$ disjoint triangles? -- (complexity theory np complete reductions np hard decision problem)
<p>I'm trying to prove that $$k\text{-Matching}\le_p k\text{-Disjoint-Triangles}$$
but I was told that the $k\text{-Matching}$ (decide whether a graph has a matching of size... | habedi/stack-exchange-dataset |
91,783 | What sort of code is this? | <p>Here is a question I encountered:-</p>

<p>Read this section of program code that inputs 10 positive numbers and then outputs the smallest number input. Identify three changes you would need to make to find the largest number input instead of the smallest number.</p>

<pre><code> Small = 1000
... | programming languages pseudocode | 1 | What sort of code is this? -- (programming languages pseudocode)
<p>Here is a question I encountered:-</p>

<p>Read this section of program code that inputs 10 positive numbers and then outputs the smallest number input. Identify three changes you would need to make to find the largest number input instead of t... | habedi/stack-exchange-dataset |
91,803 | Explaination for Variation of Boyer-Moore Majority voting algorithm | <p><a href="https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority_vote_algorithm" rel="noreferrer">Boyer-Moore's majority vote algorithms</a> can be used to determine the majority element in a linear time and constant space. </p>

<p>The intuition behind finding the majority element is understandable as it... | algorithms algorithm analysis | 1 | Explaination for Variation of Boyer-Moore Majority voting algorithm -- (algorithms algorithm analysis)
<p><a href="https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_majority_vote_algorithm" rel="noreferrer">Boyer-Moore's majority vote algorithms</a> can be used to determine the majority element in a linear time and con... | habedi/stack-exchange-dataset |
91,815 | Understanding truncation and rounding error in IEEE floating point system? | <p>I'm trying to understand the theory behind finding the optimal $h$ value for differentiation in this definition:</p>

<p>$$ \frac{f(x+h) - f(x)}{h}$$</p>

<p>as $h$ tends to 0.</p>

<p>Here is my understanding:</p>

<ol>
<li>Truncation error comes from say approximating the value ... | floating point numerical algorithms numerical analysis | 1 | Understanding truncation and rounding error in IEEE floating point system? -- (floating point numerical algorithms numerical analysis)
<p>I'm trying to understand the theory behind finding the optimal $h$ value for differentiation in this definition:</p>

<p>$$ \frac{f(x+h) - f(x)}{h}$$</p>

<p>as $h$ t... | habedi/stack-exchange-dataset |
91,816 | $O(n\log n)$- algorithm for finding tree root | <p>All numbers from $1$ to $n = 2^k-1$ are written in unknown way in a full binary tree of height $k$. We say that a number $t$ lies between $i$ and $j$ if after removing $t$ from the tree we obtain that $i$ and $j$ are in different connectivity components. Propose an algorithm for determining a number in the root of ... | algorithms algorithm analysis data structures trees binary trees | 1 | $O(n\log n)$- algorithm for finding tree root -- (algorithms algorithm analysis data structures trees binary trees)
<p>All numbers from $1$ to $n = 2^k-1$ are written in unknown way in a full binary tree of height $k$. We say that a number $t$ lies between $i$ and $j$ if after removing $t$ from the tree we obtain that... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.