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 |
|---|---|---|---|---|---|---|
45,763 | Provide some help regarding the "Dining Philosophers Problem"? | <p>I have an assignment based on operating systems and the question is divided into two sub-questions. </p>

<p>The first is: Prove any seating arrangement of lefties and righties, with at least one of each avoiding deadlock. </p>

<p>The second: Prove any seating arrangement of lefties and righties wit... | operating systems synchronization deadlocks | 1 | Provide some help regarding the "Dining Philosophers Problem"? -- (operating systems synchronization deadlocks)
<p>I have an assignment based on operating systems and the question is divided into two sub-questions. </p>

<p>The first is: Prove any seating arrangement of lefties and righties, with at least one o... | habedi/stack-exchange-dataset |
45,764 | Help interpreting this deadlock question | <p>I have this assignment question but I am a bit unsure how to go about answering it. The question is as follows and accompanied by the image below: </p>

<p>Three processes are competing for six resources labelled A to F as shown
below.</p>

<p><a href="https://i.stack.imgur.com/8ilRU.jpg" rel="no... | deadlocks resource allocation | 1 | Help interpreting this deadlock question -- (deadlocks resource allocation)
<p>I have this assignment question but I am a bit unsure how to go about answering it. The question is as follows and accompanied by the image below: </p>

<p>Three processes are competing for six resources labelled A to F as shown
... | habedi/stack-exchange-dataset |
45,767 | Equivalence in finite sets of turing machines | <p>I have this exercise and I really don't know how to complete it:</p>

<pre><code>Prove that for all finite sets S of Turing Machines it is decidable
whether or not given any two Turing Machines M1 and M2 in S they
recognize the same language, that is, L(M1)=L(M2)
</code></pre>

<p>I know ... | formal languages turing machines formal grammars | 1 | Equivalence in finite sets of turing machines -- (formal languages turing machines formal grammars)
<p>I have this exercise and I really don't know how to complete it:</p>

<pre><code>Prove that for all finite sets S of Turing Machines it is decidable
whether or not given any two Turing Machines M1 and M2 i... | habedi/stack-exchange-dataset |
45,772 | Does a reentrant list for signal queue in a single-thread environment exist? | <p>I need to handle Unix signals in a single-threaded application with the following goals:</p>

<ol>
<li>Signals doesn't mask on receive (thus, the signal handler <em>must</em> be reentrant).</li>
<li>I am not allowed to lose signal data (thus, if a new signal comes before the handler of the previous r... | data structures threads deadlocks | 1 | Does a reentrant list for signal queue in a single-thread environment exist? -- (data structures threads deadlocks)
<p>I need to handle Unix signals in a single-threaded application with the following goals:</p>

<ol>
<li>Signals doesn't mask on receive (thus, the signal handler <em>must</em> be reentrant).... | habedi/stack-exchange-dataset |
45,778 | Does removal of unit production from the grammar may increase number of total production? | <p>There are m variable in a grammar. The number of productions after removal of unit productions in the worst case is ,(Assume there are no null productions)</p>

<p>(a) O(m)<br>
(b) O($m^2$)</p>

<p>(c) O($k^m$)</p>

<p>(d) O($2^m$)</p>

<hr>

<p>My attempt:</p>

<p... | context free formal grammars normal forms | 1 | Does removal of unit production from the grammar may increase number of total production? -- (context free formal grammars normal forms)
<p>There are m variable in a grammar. The number of productions after removal of unit productions in the worst case is ,(Assume there are no null productions)</p>

<p>(a) O(m)... | habedi/stack-exchange-dataset |
45,782 | Differences between SISD, SIMD and MIMD architecture (Flynn classification) | <p>I have a problem with classifying certain CPUs to the proper classes of Flynn's Taxonomy.</p>

<h1>1. Zilog Z80</h1>

<p>According to <a href="http://www.segaretro.org/Zilog_Z80" rel="nofollow noreferrer">this article on Sega Retro</a>, Z80 has limited abilities to be classified as <a href="http://ww... | computer architecture classification | 1 | Differences between SISD, SIMD and MIMD architecture (Flynn classification) -- (computer architecture classification)
<p>I have a problem with classifying certain CPUs to the proper classes of Flynn's Taxonomy.</p>

<h1>1. Zilog Z80</h1>

<p>According to <a href="http://www.segaretro.org/Zilog_Z80" rel=... | habedi/stack-exchange-dataset |
45,783 | Binary code with constraint | <p>Suppose I have an alphabet of n symbols. I can efficiently encode them with $\lceil \log_2n\rceil$-bits strings. For instance if n=8:<br>
A: 0 0 0<br>
B: 0 0 1<br>
C: 0 1 0<br>
D: 0 1 1<br>
E: 1 0 0<br>
F: 1 0 1<br>
G: 1 1 0<br>
H: 1 1 1 </p>

<p>Now I have the additional con... | coding theory | 1 | Binary code with constraint -- (coding theory)
<p>Suppose I have an alphabet of n symbols. I can efficiently encode them with $\lceil \log_2n\rceil$-bits strings. For instance if n=8:<br>
A: 0 0 0<br>
B: 0 0 1<br>
C: 0 1 0<br>
D: 0 1 1<br>
E: 1 0 0<br>
F: 1 0 1<br>
G: 1 1 0<br>
H: 1 1 1 ... | habedi/stack-exchange-dataset |
45,787 | Recurrence Relation(with Square root) | <p>I came across a very peculiar recurrence relation :</p>

<blockquote>
 <p>$\sqrt {T(n)} = \sqrt {T(n-1)} + 2 \sqrt {T(n-2)} $</p>
</blockquote>

<p>with initial values $T(0) = T(1) = 1$</p>

<p>Any helps on how to find it</p>
 | recurrence relation discrete mathematics | 1 | Recurrence Relation(with Square root) -- (recurrence relation discrete mathematics)
<p>I came across a very peculiar recurrence relation :</p>

<blockquote>
 <p>$\sqrt {T(n)} = \sqrt {T(n-1)} + 2 \sqrt {T(n-2)} $</p>
</blockquote>

<p>with initial values $T(0) = T(1) = 1$</p>

<p>Any h... | habedi/stack-exchange-dataset |
45,794 | How does a computer determine the data type of a byte? | <p>For example, if the computer has <code>10111100</code> stored on one particular byte of RAM, how does the computer know to interpret this byte as an integer, ASCII character, or something else? Is type data stored in an adjacent byte? (I don't think this would be the case as this would result in using twice the amou... | memory hardware memory access type checking | 1 | How does a computer determine the data type of a byte? -- (memory hardware memory access type checking)
<p>For example, if the computer has <code>10111100</code> stored on one particular byte of RAM, how does the computer know to interpret this byte as an integer, ASCII character, or something else? Is type data stored... | habedi/stack-exchange-dataset |
45,800 | Algorithm that finds concise representations of sets of pairs using Cartesian products | <p>I feel like there should be a known algorithm to the following problem, but I am short of ideas how to construct or search for it.</p>

<p>Suppose as an input you have a list of two-dimensional data points (x<sub>i</sub>, y<sub>i</sub>). Your goal is to "simplify" this data by providing an output that is equ... | algorithms sets | 1 | Algorithm that finds concise representations of sets of pairs using Cartesian products -- (algorithms sets)
<p>I feel like there should be a known algorithm to the following problem, but I am short of ideas how to construct or search for it.</p>

<p>Suppose as an input you have a list of two-dimensional data po... | habedi/stack-exchange-dataset |
45,804 | Understanding the one-writer, many-readers problem? | <p>I need some help understanding the implementation of the one-writer many-readers problem shown below as I am new to this concept:</p>

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

... | concurrency synchronization | 1 | Understanding the one-writer, many-readers problem? -- (concurrency synchronization)
<p>I need some help understanding the implementation of the one-writer many-readers problem shown below as I am new to this concept:</p>

<p><a href="https://i.stack.imgur.com/PStSm.jpg" rel="nofollow noreferrer"><img src="http... | habedi/stack-exchange-dataset |
45,813 | How Can we make $O(N)$ order statistic queries with Fibonacci heap in $O(N)$? | <p>We have a Fibonacci heap with $N$ unique elements we want to make $O(N)$ order statistic queries (e.g., what is the element number 7 in this collection if it was sorted). Moreover, we know that the order statistic queries would be made in order (e.g., for $O(N)$ queries: what is elements number $1,3,5,\ldots,N$) .</... | data structures | 1 | How Can we make $O(N)$ order statistic queries with Fibonacci heap in $O(N)$? -- (data structures)
<p>We have a Fibonacci heap with $N$ unique elements we want to make $O(N)$ order statistic queries (e.g., what is the element number 7 in this collection if it was sorted). Moreover, we know that the order statistic quer... | habedi/stack-exchange-dataset |
45,818 | How does a hard drive knows what bit is the beginning of of a byte/word? | <p>I'm guessing I could replace the words "hard drive" with "random access medium" but let's be more specific here. Also for the sake of this question, let's not consider SSDs. Just plain old hard-drives with heads and magnetic discs. </p>

<p>I'd guess that the hard drive doesn't care about things as bytes and... | memory hardware memory access | 1 | How does a hard drive knows what bit is the beginning of of a byte/word? -- (memory hardware memory access)
<p>I'm guessing I could replace the words "hard drive" with "random access medium" but let's be more specific here. Also for the sake of this question, let's not consider SSDs. Just plain old hard-drives with hea... | habedi/stack-exchange-dataset |
45,820 | give potential function - binary heap - extract-min in amortized const time and insert in log amortized time | <p>Consider an ordinary binary min-heap data structure with n elements supporting
the instructions INSERT and EXTRACT-MIN in O($\lg n)$ worst-case time. Give a
potential function $\Phi$ such that the amortized cost of INSERT is $O(\lg n)$ and the amortized cost of EXTRACT-MIN is $O(1)$. </p>

<p>I try... | amortized analysis | 1 | give potential function - binary heap - extract-min in amortized const time and insert in log amortized time -- (amortized analysis)
<p>Consider an ordinary binary min-heap data structure with n elements supporting
the instructions INSERT and EXTRACT-MIN in O($\lg n)$ worst-case time. Give a
potential function ... | habedi/stack-exchange-dataset |
45,823 | Minimising sum of consecutive points distances Manhattan metric | <p>I have two sets $X$ and $Y$ of 2-dimensional points. The points are floating point numbers. The objective is to sort them in such way that sum of differences in distances of consecutive sorted points is minimal.</p>

<p>I tried to solve this problem by localisation (dividing the plane by smaller grids of sor... | algorithms optimization sorting approximation | 1 | Minimising sum of consecutive points distances Manhattan metric -- (algorithms optimization sorting approximation)
<p>I have two sets $X$ and $Y$ of 2-dimensional points. The points are floating point numbers. The objective is to sort them in such way that sum of differences in distances of consecutive sorted points is... | habedi/stack-exchange-dataset |
45,826 | undecidable problem and its negation is undecidable | <p>A lot of "famous" undecidable problems are nonetheless at least semidecidable, with their complement being undecidable. One example above all can be the halting problem and its complement.</p>

<p>However, can anybody give me an example in which both a problem and its complement are undecidable and not semid... | formal languages computability turing machines undecidability semi decidability | 1 | undecidable problem and its negation is undecidable -- (formal languages computability turing machines undecidability semi decidability)
<p>A lot of "famous" undecidable problems are nonetheless at least semidecidable, with their complement being undecidable. One example above all can be the halting problem and its com... | habedi/stack-exchange-dataset |
45,833 | Difference between the two regular expression | <p>I came across a question to create a regular expression to check whether there are even number of b's in a string of language {a,b}. The expression I came up with is (a+ba*b)*. However I found the solution online to be a*(ba*ba*). Is there any difference? If any where?</p>

<p>Also I know that (a+b)* is equi... | regular languages regular expressions | 1 | Difference between the two regular expression -- (regular languages regular expressions)
<p>I came across a question to create a regular expression to check whether there are even number of b's in a string of language {a,b}. The expression I came up with is (a+ba*b)*. However I found the solution online to be a*(ba*ba*... | habedi/stack-exchange-dataset |
46,840 | Question about set-associative cache mapping | <p>I found a question:</p>

<blockquote>
 <p>Let a two-way set-associative cache of 4 memory blocks, each block containing one word.</p>
 
 <p>What is the number of misses and hits considering the following sequence of block addresses: 0, 8, 0, 6, 8 ?</p>
 
 <p>a) 4 misses and 1 hit<br>... | cpu cache | 1 | Question about set-associative cache mapping -- (cpu cache)
<p>I found a question:</p>

<blockquote>
 <p>Let a two-way set-associative cache of 4 memory blocks, each block containing one word.</p>
 
 <p>What is the number of misses and hits considering the following sequence of block addresses: 0... | habedi/stack-exchange-dataset |
46,847 | Proving equality between foldl recursive and iterative fold | <p>Hi I have two definitions of fold. I will call them foldl which is recursive and fold$_{itr}$ which is iterative. </p>

<p>I am looking for an <strong>algebraic proof</strong> that the two definitions are equal ideally through <strong>structural induction</strong>.</p>

<p><strong>Definition for fold... | functional programming correctness proof induction | 1 | Proving equality between foldl recursive and iterative fold -- (functional programming correctness proof induction)
<p>Hi I have two definitions of fold. I will call them foldl which is recursive and fold$_{itr}$ which is iterative. </p>

<p>I am looking for an <strong>algebraic proof</strong> that the two defi... | habedi/stack-exchange-dataset |
46,853 | Why is ${n \choose 2}$ a $\Theta(n^2)$ computation? | <p>In Cormen's <em>Algorithms</em> textbook, the author casually mentions that ${n \choose 2}$ is $\Theta(n^2)$.</p>

<p>Why is this so? In the calculation</p>

<p>$$
{n \choose 2} = \frac{n!}{(n-2)!2!}
$$</p>

<p>there are $n$ multiplication operations in the numerator and $n$ multiplic... | asymptotics | 1 | Why is ${n \choose 2}$ a $\Theta(n^2)$ computation? -- (asymptotics)
<p>In Cormen's <em>Algorithms</em> textbook, the author casually mentions that ${n \choose 2}$ is $\Theta(n^2)$.</p>

<p>Why is this so? In the calculation</p>

<p>$$
{n \choose 2} = \frac{n!}{(n-2)!2!}
$$</p>

<p>there... | habedi/stack-exchange-dataset |
46,855 | How to determine number of instances for resources in a resource allocation graph? | <p>I am struggling to determine the number of instances a resource will have. I have performed extensive research on this, but unfortunately have come up short. I am tasked with drawing a resource allocation graph and I have been provided with the number of processes which is 3 and the of resources which is 5. I have c... | resource allocation | 1 | How to determine number of instances for resources in a resource allocation graph? -- (resource allocation)
<p>I am struggling to determine the number of instances a resource will have. I have performed extensive research on this, but unfortunately have come up short. I am tasked with drawing a resource allocation grap... | habedi/stack-exchange-dataset |
46,866 | FPT algorithm for point line cover | <p>In the <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.152.8053&rep=rep1&type=pdf" rel="nofollow noreferrer">"Covering Things with Things" paper from Langerman and Morin</a>, they mention the BST-Dim-Set-Cover, which is a FPT algorithm for point-line-cover, at page 666.</p>

<p>The ... | algorithms algorithm analysis parameterized complexity | 1 | FPT algorithm for point line cover -- (algorithms algorithm analysis parameterized complexity)
<p>In the <a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.152.8053&rep=rep1&type=pdf" rel="nofollow noreferrer">"Covering Things with Things" paper from Langerman and Morin</a>, they mention the BST-... | habedi/stack-exchange-dataset |
46,867 | What is the difference (if any) between transition systems and finite automata? | <p>is there any difference between transition systems and finite automata? Is it that transition systems consist of both NFA (nondeterministic finite automata)
and DFA (deterministic finite automata)? </p>
 | terminology automata finite automata transition systems | 1 | What is the difference (if any) between transition systems and finite automata? -- (terminology automata finite automata transition systems)
<p>is there any difference between transition systems and finite automata? Is it that transition systems consist of both NFA (nondeterministic finite automata)
and DFA (determ... | habedi/stack-exchange-dataset |
46,874 | Can an algorithm that yields $O(n^2)$ answers run in $O(n)$ time? | <p>My question may actually be more broadly described as: can I use the fact that an algorithm is expected to return $(O(f(n))$ answers to show that it may never run better than $O(f(n))$? I would intuitively assume yes, but I am not sure. </p>

<p>Examples of what I'm talking about is algorithms to calculate a... | algorithms algorithm analysis time complexity asymptotics | 1 | Can an algorithm that yields $O(n^2)$ answers run in $O(n)$ time? -- (algorithms algorithm analysis time complexity asymptotics)
<p>My question may actually be more broadly described as: can I use the fact that an algorithm is expected to return $(O(f(n))$ answers to show that it may never run better than $O(f(n))$? I ... | habedi/stack-exchange-dataset |
46,881 | Why is least fixed point (lfp) important in program analysis | <p>I am trying to get a big picture on the importance of least fixed point (lfp) in program analysis. For instance abstract interpretation seems to use the existence of lfp. Many research papers on program analysis also focus heavily on finding least fixed point. </p>

<p>More specifically, this article in wiki... | programming languages finite model theory fixed point | 1 | Why is least fixed point (lfp) important in program analysis -- (programming languages finite model theory fixed point)
<p>I am trying to get a big picture on the importance of least fixed point (lfp) in program analysis. For instance abstract interpretation seems to use the existence of lfp. Many research papers on pr... | habedi/stack-exchange-dataset |
46,893 | Algorithm for constructing BST from post-order traversal | <p>Given a post-order traversal of Binary Search tree with $k$ nodes, find an algorithm that constructs the BST.</p>

<p><strong><em>My Algortihm</em></strong></p>

<blockquote>
 <p>Let $n$ represent the next element to be inserted.</p>
 
 <p>Let $P(y)$ represent the parent of node $y$.</... | algorithms algorithm analysis runtime analysis correctness proof | 1 | Algorithm for constructing BST from post-order traversal -- (algorithms algorithm analysis runtime analysis correctness proof)
<p>Given a post-order traversal of Binary Search tree with $k$ nodes, find an algorithm that constructs the BST.</p>

<p><strong><em>My Algortihm</em></strong></p>

<blockquote>... | habedi/stack-exchange-dataset |
46,894 | Short notation for Turing machine configurations | <p>I'm writing about Turing machines and often need to denote the tape. I'm using exponential tapes, i.e. a repetition count for each symbol.</p>

<p>I usually use something similar to
$(x_k^{e_k})_{1 \leq k \leq m} \text{ Q } (x_k^{e_k})_{m+1 \leq k \leq n}$
(latex: <code>$(x_k^{e_k})_{1 \leq k \leq m}... | turing machines notation | 1 | Short notation for Turing machine configurations -- (turing machines notation)
<p>I'm writing about Turing machines and often need to denote the tape. I'm using exponential tapes, i.e. a repetition count for each symbol.</p>

<p>I usually use something similar to
$(x_k^{e_k})_{1 \leq k \leq m} \text{ Q } (x... | habedi/stack-exchange-dataset |
46,896 | Prove: possible to construct automata accepting all strings of other automata sans 1-length strings | <p>I believe that I have a procedure for doing this, but I don't know how to approach the proof (and for that matter I'm not entirely sure the procedure is correct).</p>

<p>Here's the exact problem statement:</p>

<blockquote>
 <p>Given DFA $A = (\Sigma, Q, q_0, F, \delta)$ construct DFA $B$ from ... | automata finite automata | 1 | Prove: possible to construct automata accepting all strings of other automata sans 1-length strings -- (automata finite automata)
<p>I believe that I have a procedure for doing this, but I don't know how to approach the proof (and for that matter I'm not entirely sure the procedure is correct).</p>

<p>Here's t... | habedi/stack-exchange-dataset |
46,910 | Efficiently finding $k$ smallest elements of Cartesian product | <p>Given lists $A_1, A_2, \dots, A_n$ of non-negative numbers, I want to find the $k$ smallest elements of the Cartesian product $A_1 \times A_2 \times \dots \times A_n$ ordered by the value $x_1 + x_2 + \dots + x_n$, where $x_i\in A_i$.</p>

<p>I can't simply create all combinations in memory and sort them bec... | algorithms sorting sets | 1 | Efficiently finding $k$ smallest elements of Cartesian product -- (algorithms sorting sets)
<p>Given lists $A_1, A_2, \dots, A_n$ of non-negative numbers, I want to find the $k$ smallest elements of the Cartesian product $A_1 \times A_2 \times \dots \times A_n$ ordered by the value $x_1 + x_2 + \dots + x_n$, where $x_i... | habedi/stack-exchange-dataset |
46,920 | BSS-model Computational complexity of finding the roots of a polyomial | <p>I'm currently dealing with a problem for which I could show that an exact algorithm would imply a general algorithm for finding the real (but not complex) roots of an arbitrary univariate polynomial with real coefficients.</p>

<p>Now, what exactly are the implications for my problem?</p>

<p>It is w... | computability reference request undecidability polynomials | 1 | BSS-model Computational complexity of finding the roots of a polyomial -- (computability reference request undecidability polynomials)
<p>I'm currently dealing with a problem for which I could show that an exact algorithm would imply a general algorithm for finding the real (but not complex) roots of an arbitrary univa... | habedi/stack-exchange-dataset |
46,927 | What is the computational complexity of this problematic code we had | <p>Some of my colleagues introduced some code into our codebase that was causing some serious performance issues. The feature they were implementing involved displaying data in a hierarchical fashion, but if there were more than 20 or so nodes involved, there was a serious delay (multiple seconds) before the user could... | algorithm analysis runtime analysis | 1 | What is the computational complexity of this problematic code we had -- (algorithm analysis runtime analysis)
<p>Some of my colleagues introduced some code into our codebase that was causing some serious performance issues. The feature they were implementing involved displaying data in a hierarchical fashion, but if th... | habedi/stack-exchange-dataset |
46,935 | Is a universal assembly language for all computers possible? | <p>I would like to ask a few questions about Assembly language. My understanding is that it's very close to machine language, making it faster and more efficient. </p>

<p>Since we have different computer architectures that exist, does that mean I have to write different code in Assembly for different architect... | programming languages computer architecture | 1 | Is a universal assembly language for all computers possible? -- (programming languages computer architecture)
<p>I would like to ask a few questions about Assembly language. My understanding is that it's very close to machine language, making it faster and more efficient. </p>

<p>Since we have different comput... | habedi/stack-exchange-dataset |
46,947 | How to prove if an algorithm is reentrant? | <p>I think, maybe some formalism could exist for the task which makes it significantly easier.</p>

<p>My problem to solve is that I invented a reentrant algorithm for a task. It is relative simple (its pure logic is around 10 lines in C), but this 10 lines to construct was around 2 days to me. I am 99% sure th... | algorithms concurrency correctness proof software verification | 1 | How to prove if an algorithm is reentrant? -- (algorithms concurrency correctness proof software verification)
<p>I think, maybe some formalism could exist for the task which makes it significantly easier.</p>

<p>My problem to solve is that I invented a reentrant algorithm for a task. It is relative simple (it... | habedi/stack-exchange-dataset |
46,953 | How can I infer inputs to a function, given an output? | <p>Is there a way to generate a set of inputs, for a given output of a function? This may be a common thing in lisp/haskell world, but I'm not aware of it. Is this what mini-kanren does?</p>

<p>I understand that there may not be a general solution to this problem, since the halting problem may apply here. Say ... | programming languages logic | 1 | How can I infer inputs to a function, given an output? -- (programming languages logic)
<p>Is there a way to generate a set of inputs, for a given output of a function? This may be a common thing in lisp/haskell world, but I'm not aware of it. Is this what mini-kanren does?</p>

<p>I understand that there may n... | habedi/stack-exchange-dataset |
46,954 | counting binary, with moving position (turing machine) | <p>I'm trying to make a turing machine that will take in a binary string as input x and output the binary representation of the length of x. So M(0110) returns 100, M(1010101010) returns 1010, ect. It also has to have a runtime of O(N).</p>

<p>So I can prove that the number of "flips" (changing a 0 to a 1 or a... | turing machines counting | 1 | counting binary, with moving position (turing machine) -- (turing machines counting)
<p>I'm trying to make a turing machine that will take in a binary string as input x and output the binary representation of the length of x. So M(0110) returns 100, M(1010101010) returns 1010, ect. It also has to have a runtime of O(N)... | habedi/stack-exchange-dataset |
46,968 | Self-reducibility of Clique | <p>I am trying to understand the following algorithm for Self reducibility of Clique.</p>

<p>Here we have a "MBClique" black box algorithm, which return yes/no for parameters where G is a graph and K is a natural number. It answers the question: "Does G has a clique of K size?" - Our aim is then to use this D... | algorithms search algorithms | 1 | Self-reducibility of Clique -- (algorithms search algorithms)
<p>I am trying to understand the following algorithm for Self reducibility of Clique.</p>

<p>Here we have a "MBClique" black box algorithm, which return yes/no for parameters where G is a graph and K is a natural number. It answers the question: "D... | habedi/stack-exchange-dataset |
46,982 | How to determine approximability of a problem when we don't know how good a solution is? | <p>As far as I have learned, an approximation algorithm for an optimization problem </p>

<ol>
<li>Runs in polynomial time, and</li>
<li>Whose cost can be bounded by a function of input in terms of distance from the optimal cost.</li>
</ol>

<p>If we consider the optimization version of subs... | algorithm analysis proof techniques approximation | 1 | How to determine approximability of a problem when we don't know how good a solution is? -- (algorithm analysis proof techniques approximation)
<p>As far as I have learned, an approximation algorithm for an optimization problem </p>

<ol>
<li>Runs in polynomial time, and</li>
<li>Whose cost can be bound... | habedi/stack-exchange-dataset |
46,984 | Creating arrays of object of abstract class in statically-typed object-oriented languages | <p>In statically-typed object-oriented languages (like Java, C++, C#, ...), suppose I declare an abstract class:</p>

<pre><code>public abstract class myclass1 {
 .................
}
</code></pre>

<p>Most of these languages (like Java) wouldn't allow us to create an Object of an Abstract cl... | programming languages compilers type checking object oriented | 1 | Creating arrays of object of abstract class in statically-typed object-oriented languages -- (programming languages compilers type checking object oriented)
<p>In statically-typed object-oriented languages (like Java, C++, C#, ...), suppose I declare an abstract class:</p>

<pre><code>public abstract class mycl... | habedi/stack-exchange-dataset |
46,997 | Given regular expression construct regex for the complement language | <p><strong>Disclamer:</strong> this is my uni assignment, which is rated comparatively low, thus I assume that the answer should be simple. Hints are appreciated (as opposed to direct answers).</p>

<blockquote>
 <p>Write an algorithm which accepts a regular expression $r$ and produces a language $\overli... | formal languages regular languages automata regular expressions | 1 | Given regular expression construct regex for the complement language -- (formal languages regular languages automata regular expressions)
<p><strong>Disclamer:</strong> this is my uni assignment, which is rated comparatively low, thus I assume that the answer should be simple. Hints are appreciated (as opposed to dire... | habedi/stack-exchange-dataset |
46,998 | Will ternary computers be faster than binary? | <p>If we had a computer in <strong>base 3</strong> which used the characters <strong><code>{0, 1, 2}</code></strong> instead of just <strong><code>{0, 1}</code></strong> (and we implemented a ternary logic on the hardware), will this computer be faster than computer using binary?
Why or why not?</p>

<p>If ... | computer architecture | 1 | Will ternary computers be faster than binary? -- (computer architecture)
<p>If we had a computer in <strong>base 3</strong> which used the characters <strong><code>{0, 1, 2}</code></strong> instead of just <strong><code>{0, 1}</code></strong> (and we implemented a ternary logic on the hardware), will this computer be f... | habedi/stack-exchange-dataset |
46,999 | Do recursive algorithms generally perform better than their for-loop counterpart? | <p>I'm sure this is not a challenge for you but it remains an open question for me:</p>

<p><strong>Is it wise to prefer a recursive algorithm over its for-loop counterpart?</strong></p>

<p>E.g. take the <a href="http://www.jstor.org/stable/2686591" rel="nofollow">evaluation of the natural logarithm</a... | algorithms recursion performance loops numerical algorithms | 1 | Do recursive algorithms generally perform better than their for-loop counterpart? -- (algorithms recursion performance loops numerical algorithms)
<p>I'm sure this is not a challenge for you but it remains an open question for me:</p>

<p><strong>Is it wise to prefer a recursive algorithm over its for-loop coun... | habedi/stack-exchange-dataset |
47,009 | What if block sizes are not equal among caches? | <p>In all the books, packets of slides and similar I read, cache miss is always explained by assuming that blocks of different caches (or cache and RAM) are always of the same size. It's pretty clear how it's works in this case but the question is: what if block dimensions are not equal among caches?</p>

<p>Fo... | computer architecture cpu cache memory hardware | 1 | What if block sizes are not equal among caches? -- (computer architecture cpu cache memory hardware)
<p>In all the books, packets of slides and similar I read, cache miss is always explained by assuming that blocks of different caches (or cache and RAM) are always of the same size. It's pretty clear how it's works in t... | habedi/stack-exchange-dataset |
47,029 | Converge to unknown number with oracle | <p>I'm playing a game where I'm trying to estimate an unknown real number $x$.</p>

<p>An oracle exists that will answer the question of "Is a number $y$ greater than or equal to $x$?", to which the oracle will reply either <strong>yes</strong> or <strong>no</strong>. The question may be asked an $t$ number of ... | algorithms optimization machine learning numerical analysis | 1 | Converge to unknown number with oracle -- (algorithms optimization machine learning numerical analysis)
<p>I'm playing a game where I'm trying to estimate an unknown real number $x$.</p>

<p>An oracle exists that will answer the question of "Is a number $y$ greater than or equal to $x$?", to which the oracle wi... | habedi/stack-exchange-dataset |
47,035 | How many words are in this sets? | <p>I have problems to determine the size of the following sets in dependancy of the parameters $m, n>0$:
$$M_{m,n}=\{a^iwa^{m-i}\mid 0\le i \le m,\;w\in\{a,b\}^n\}$$
It is easy to see that $|M_{m,n}|\le (m+1)\cdot 2^n$ since there are $m+1$ possibilities for $i$ and $2^n$ possibilities for $w$. If the sets w... | formal languages combinatorics word combinatorics finite sets | 1 | How many words are in this sets? -- (formal languages combinatorics word combinatorics finite sets)
<p>I have problems to determine the size of the following sets in dependancy of the parameters $m, n>0$:
$$M_{m,n}=\{a^iwa^{m-i}\mid 0\le i \le m,\;w\in\{a,b\}^n\}$$
It is easy to see that $|M_{m,n}|\le (m+1)\... | habedi/stack-exchange-dataset |
47,040 | Regular expression: b|b equal to b? | <p>I am solving some example exercises in preparation of a Computational Theory examination.</p>

<p>In Exercise 2, I am tasked with building an NFA and DFA of the regular expression: $(b|bba)^*a$</p>

<p>My question is: Can I simplify $b|bba$ inside the parentheses to $bba$? Are they indeed equivalent ... | finite automata regular expressions | 1 | Regular expression: b|b equal to b? -- (finite automata regular expressions)
<p>I am solving some example exercises in preparation of a Computational Theory examination.</p>

<p>In Exercise 2, I am tasked with building an NFA and DFA of the regular expression: $(b|bba)^*a$</p>

<p>My question is: Can I ... | habedi/stack-exchange-dataset |
47,041 | If the speed of electrical charge hasn't changed, how have computers become faster? | <p>Everyone knows computing speed has drastically increased since their invention, and it looks set to continue. But one thing is puzzling me: if you ran an electrical current through a material today, it would travel at the same speed as if you did it with the same material 50 years ago.</p>

<p>With that in m... | computer architecture | 1 | If the speed of electrical charge hasn't changed, how have computers become faster? -- (computer architecture)
<p>Everyone knows computing speed has drastically increased since their invention, and it looks set to continue. But one thing is puzzling me: if you ran an electrical current through a material today, it woul... | habedi/stack-exchange-dataset |
47,044 | Origin of the terms "safety" and "liveness" for concurrent algorithm properties? | <p>Properties of concurrent algorithms are usually divided into two categories:</p>

<ol>
<li><p><strong>Safety</strong> - something <em>must not</em> happen.</p>

<p>Properties in this category are for example partial correctness and sometimes deadlock-freedom (the latter depending on the author).<... | terminology reference request concurrency | 1 | Origin of the terms "safety" and "liveness" for concurrent algorithm properties? -- (terminology reference request concurrency)
<p>Properties of concurrent algorithms are usually divided into two categories:</p>

<ol>
<li><p><strong>Safety</strong> - something <em>must not</em> happen.</p>

<p>Prope... | habedi/stack-exchange-dataset |
47,046 | What does this mean $[X]_1^T$? | <p>I found this in information theory <a href="http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=5508636&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D5508636" rel="nofollow noreferrer">paper, P.3883</a>*</p>
<p>the authors states the following</p>
<blockquote>
<p>Most e... | information theory network flow notation | 1 | What does this mean $[X]_1^T$? -- (information theory network flow notation)
<p>I found this in information theory <a href="http://ieeexplore.ieee.org/xpl/login.jsp?tp=&arnumber=5508636&url=http%3A%2F%2Fieeexplore.ieee.org%2Fxpls%2Fabs_all.jsp%3Farnumber%3D5508636" rel="nofollow noreferrer">paper, P.3883</a>*</... | habedi/stack-exchange-dataset |
47,061 | Help with understanding Hopcroft's algorithm | <p>So I wrote an implementation of Hopcroft's algorithm. While testing, I discovered that it would sometimes produce an automaton that wasn't equivalent to the original. At first, I figured it must be a bug in my code, but after going over the algorithm by hand with a small example, it seems to be a bug in my understan... | algorithms optimization finite automata | 1 | Help with understanding Hopcroft's algorithm -- (algorithms optimization finite automata)
<p>So I wrote an implementation of Hopcroft's algorithm. While testing, I discovered that it would sometimes produce an automaton that wasn't equivalent to the original. At first, I figured it must be a bug in my code, but after g... | habedi/stack-exchange-dataset |
47,063 | Table-Driven Agent Program | <p>I have two questions regarding a paragraph about table-driven agent programs from Modern Approach to Artificial Intelligence 3rd Edition.</p>

<ol>
<li>"Let $\mathbb{P}$ be the set of possible percepts and let <em>T</em> be the lifetime of the agent (the total number of percepts it will receive). The loo... | artificial intelligence | 1 | Table-Driven Agent Program -- (artificial intelligence)
<p>I have two questions regarding a paragraph about table-driven agent programs from Modern Approach to Artificial Intelligence 3rd Edition.</p>

<ol>
<li>"Let $\mathbb{P}$ be the set of possible percepts and let <em>T</em> be the lifetime of the agent... | habedi/stack-exchange-dataset |
47,077 | Is there a way of objectively measuring the efficiency or quality of software or code design? | <p>I've been thinking about ways of measuring code, and, quite frankly, I can't think of truly objective, semi-universal ways of evaluating the quality or "strength" of code to say, "Yes, this is better than that based on X, Y, and Z metrics" that are popular or exist. I've looked at SonarQube, and although I think the... | programming languages software engineering design patterns | 1 | Is there a way of objectively measuring the efficiency or quality of software or code design? -- (programming languages software engineering design patterns)
<p>I've been thinking about ways of measuring code, and, quite frankly, I can't think of truly objective, semi-universal ways of evaluating the quality or "streng... | habedi/stack-exchange-dataset |
47,092 | graph theory analogue of rectangular matrix | <p>Graphs are usually defined as a set of vertices $V$ together with a set of edges $E$ consisting of elements $V \times V$. I'm interested in a slight generalization of this, where instead one has two sets $V$, $W$ and the edges are taken from $V \times W$. The adjacency matrix of such an object would be rectangular, ... | graphs | 1 | graph theory analogue of rectangular matrix -- (graphs)
<p>Graphs are usually defined as a set of vertices $V$ together with a set of edges $E$ consisting of elements $V \times V$. I'm interested in a slight generalization of this, where instead one has two sets $V$, $W$ and the edges are taken from $V \times W$. The a... | habedi/stack-exchange-dataset |
47,101 | Maximum independent nodes subset algorithm with strong constraint | <p>I've a tree with weighed nodes, the problem is to flag a subset of nodes with the following constraints:</p>

<ul>
<li>The selected nodes must be the optimal solution (maximal sum of weight).</li>
<li>If one node is flagged no adjacent nodes can be flagged.</li>
<li>If a node is flagged it will b... | algorithms graphs optimization trees dynamic programming | 1 | Maximum independent nodes subset algorithm with strong constraint -- (algorithms graphs optimization trees dynamic programming)
<p>I've a tree with weighed nodes, the problem is to flag a subset of nodes with the following constraints:</p>

<ul>
<li>The selected nodes must be the optimal solution (maximal s... | habedi/stack-exchange-dataset |
47,108 | Is multiple equation 0/1 linear integer programming with bounded integer weights NP-hard? | <p>Suppose we forget about optimizing and just want to find a feasible solution to a set of equations:</p>

<p>$$\sum_i w_{ij} x_i = W_j.$$</p>

<p>Here we are given $w_{ij}$ and $W_j$, and want to solve for $x_i$. Also $x_i$ are restricted to be 0/1 and we're promised that $w_{ij}$ and $W_j$ will be n... | complexity theory np complete | 1 | Is multiple equation 0/1 linear integer programming with bounded integer weights NP-hard? -- (complexity theory np complete)
<p>Suppose we forget about optimizing and just want to find a feasible solution to a set of equations:</p>

<p>$$\sum_i w_{ij} x_i = W_j.$$</p>

<p>Here we are given $w_{ij}$ and ... | habedi/stack-exchange-dataset |
47,116 | Finding the kth smallest element of an array using DAC | <p>I'm trying to find the $k^{th}$ smallest element of an array by using <code>Randomized Quicksort</code>, But below code giving erroneous result can anybody help.</p>

<pre><code>from random import randint

lst=[1,3,5,2,4,6]
k=6
n=6

def swap(i,j):
 t=lst[i]
 lst[i]=lst[j... | randomized algorithms | 1 | Finding the kth smallest element of an array using DAC -- (randomized algorithms)
<p>I'm trying to find the $k^{th}$ smallest element of an array by using <code>Randomized Quicksort</code>, But below code giving erroneous result can anybody help.</p>

<pre><code>from random import randint

lst=[1,3,5,2,... | habedi/stack-exchange-dataset |
47,125 | rationale behind multi-layer networks | <p>I recently read that a feed forward neural network with a single hidden layer can represent any continuous function to great precision (<a href="https://en.wikipedia.org/wiki/Universal_approximation_theorem" rel="nofollow">ref.</a>).
Then how can we justify adding more that one hidden layer to our network ?</p>&... | machine learning neural networks | 1 | rationale behind multi-layer networks -- (machine learning neural networks)
<p>I recently read that a feed forward neural network with a single hidden layer can represent any continuous function to great precision (<a href="https://en.wikipedia.org/wiki/Universal_approximation_theorem" rel="nofollow">ref.</a>).
The... | habedi/stack-exchange-dataset |
47,127 | What is meant by polynomially smaller | <p>I'm reading CLRS <em>Section-4.5: The Master method for solving recurrences</em>. There is a line saying</p>

<blockquote>
 <p>$f(n)$ must be polynomially smaller than $n^{\log_b a}$.</p>
</blockquote>

<p>What is meant by polynomially smaller? Can anybody explain it to me with an example?</... | asymptotics | 1 | What is meant by polynomially smaller -- (asymptotics)
<p>I'm reading CLRS <em>Section-4.5: The Master method for solving recurrences</em>. There is a line saying</p>

<blockquote>
 <p>$f(n)$ must be polynomially smaller than $n^{\log_b a}$.</p>
</blockquote>

<p>What is meant by polynomially s... | habedi/stack-exchange-dataset |
47,129 | Understanding Master Method's Case 2 | <p>Whats the intuition behind multiplying the factor $\log n$</p>

<blockquote>
 <p>Master Method Case 2 (CLRS Section 4.5)</p>
 
 <p>If $f(n) = \theta(n^{\log_b a})$, then $T(n)= \theta(n^{\log_b a} \log n)$</p>
</blockquote>

<p>In generalized form sometime it can be written as</p>&... | master theorem | 1 | Understanding Master Method's Case 2 -- (master theorem)
<p>Whats the intuition behind multiplying the factor $\log n$</p>

<blockquote>
 <p>Master Method Case 2 (CLRS Section 4.5)</p>
 
 <p>If $f(n) = \theta(n^{\log_b a})$, then $T(n)= \theta(n^{\log_b a} \log n)$</p>
</blockquote>

... | habedi/stack-exchange-dataset |
47,132 | Non-computability and Undecidability? | <p>Is there a difference between a non computable problem and an undecidable problem? Or is one included in the other?</p>
 | terminology computability undecidability | 1 | Non-computability and Undecidability? -- (terminology computability undecidability)
<p>Is there a difference between a non computable problem and an undecidable problem? Or is one included in the other?</p>
 | habedi/stack-exchange-dataset |
47,136 | many one reduable | <p>I A many one reducable to B and given A is decidable then is B decidable ?</p>

<p>preparing for an exam and please let me know if this holds</p>

<p>I understood how if B is decidable then A is decidable</p>

<p>and if A is not decidable then B is not decidable</p>
 | turing machines reductions | 1 | many one reduable -- (turing machines reductions)
<p>I A many one reducable to B and given A is decidable then is B decidable ?</p>

<p>preparing for an exam and please let me know if this holds</p>

<p>I understood how if B is decidable then A is decidable</p>

<p>and if A is not decidable then... | habedi/stack-exchange-dataset |
47,137 | Context-free grammar for $L = \{a^{2^k}, k \in\mathbb{N}\}$ | <p>In an exercise, I am asked to find a context free grammar for language $L = \{a^{2^k}, k \in \mathbb{N}\}$.</p>

<p>I have been trying to use a "doubling" variable. If $a^{2n} \in L, n\in\mathbb{N}$ then use this variable to double the $a$'s that have been produced by the other language rules.</p>

<... | context free formal grammars computational linguistics | 1 | Context-free grammar for $L = \{a^{2^k}, k \in\mathbb{N}\}$ -- (context free formal grammars computational linguistics)
<p>In an exercise, I am asked to find a context free grammar for language $L = \{a^{2^k}, k \in \mathbb{N}\}$.</p>

<p>I have been trying to use a "doubling" variable. If $a^{2n} \in L, n\in\m... | habedi/stack-exchange-dataset |
47,144 | intractable problem example? | <p>I have been doing some research into the limits of computation and I have come across the terms intractable and undecidable. Are these two terms the same thing?</p>

<p>What does intractable mean and what is an example of an intractable and undecidable problem?</p>
 | complexity theory computability | 1 | intractable problem example? -- (complexity theory computability)
<p>I have been doing some research into the limits of computation and I have come across the terms intractable and undecidable. Are these two terms the same thing?</p>

<p>What does intractable mean and what is an example of an intractable and un... | habedi/stack-exchange-dataset |
47,151 | Distribution of the number of bits changed during generation of all binary tuples | <p><a href="https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming" rel="nofollow">Knuth's TAOCP</a> chapter 7.2.1 discusses generating all the $n$-bit binary strings.
I am interested in the total number of bits that change during this process.</p>

<p>During generation we store an $n$-bit string and... | combinatorics enumeration | 1 | Distribution of the number of bits changed during generation of all binary tuples -- (combinatorics enumeration)
<p><a href="https://en.wikipedia.org/wiki/The_Art_of_Computer_Programming" rel="nofollow">Knuth's TAOCP</a> chapter 7.2.1 discusses generating all the $n$-bit binary strings.
I am interested in the total... | habedi/stack-exchange-dataset |
47,153 | Infinite calculations in finite time | <p>This is probably a silly thought, but suppose we have a computer that's programmed to perform an infinite sequence of calculations and suppose the $i^\text{th}$ calculation takes $1/2^i$ seconds to complete. Then this computer can do an infinite number of calculations in a finite amount of time.</p>

<p>Why... | computability computation models | 1 | Infinite calculations in finite time -- (computability computation models)
<p>This is probably a silly thought, but suppose we have a computer that's programmed to perform an infinite sequence of calculations and suppose the $i^\text{th}$ calculation takes $1/2^i$ seconds to complete. Then this computer can do an infi... | habedi/stack-exchange-dataset |
47,162 | Corner cases in the Interleave Lower Bound for BSTs | <p>The <a href="https://en.wikipedia.org/wiki/Interleave_lower_bound" rel="nofollow">Interleave lower bound</a> is a lower bound for the amount of operations any Binary Search Tree needs to make for a sequence of accesses. It is used in the construction of <a href="https://en.wikipedia.org/wiki/Tango_tree" rel="nofollo... | data structures search trees lower bounds | 1 | Corner cases in the Interleave Lower Bound for BSTs -- (data structures search trees lower bounds)
<p>The <a href="https://en.wikipedia.org/wiki/Interleave_lower_bound" rel="nofollow">Interleave lower bound</a> is a lower bound for the amount of operations any Binary Search Tree needs to make for a sequence of accesses... | habedi/stack-exchange-dataset |
47,165 | Monetary computations theory (manual/textbook) | <p>My problem is due to the fact that I am manipulating a set of amounts that span over some intervals of time (start date/end date) and that are rounded to cents. I have to multiply each of them by some fraction (percentage), and I have to round the results to cents. Then I have to match the sum of what I calculated t... | algorithms numerical algorithms error estimation | 1 | Monetary computations theory (manual/textbook) -- (algorithms numerical algorithms error estimation)
<p>My problem is due to the fact that I am manipulating a set of amounts that span over some intervals of time (start date/end date) and that are rounded to cents. I have to multiply each of them by some fraction (perce... | habedi/stack-exchange-dataset |
47,173 | Cormen. Red-black trees. Why do we need to rotate the tree after fixing its properties? | <p>I am reading about red-black trees in <em>Introduction to Algorithms, Second Edition</em> by Cormen. Pages 316, 317.</p>

<p>I don't understand why we need to rotate the given tree. See (c) and (d) in the attached picture.</p>

<p><a href="https://i.stack.imgur.com/SCkh0.png" rel="nofollow noreferrer... | algorithms trees | 1 | Cormen. Red-black trees. Why do we need to rotate the tree after fixing its properties? -- (algorithms trees)
<p>I am reading about red-black trees in <em>Introduction to Algorithms, Second Edition</em> by Cormen. Pages 316, 317.</p>

<p>I don't understand why we need to rotate the given tree. See (c) and (d) i... | habedi/stack-exchange-dataset |
47,175 | AVL Trees Height-Balance Property | <p>An AVL tree is one that satisfies the <em>height-balance property</em> which states that: For every position p of T, the heights of the children of p differ by at most 1.</p>

<p>Below is an example AVL tree. However, I've highlighted a node whose child's height would imply that their difference is not at mo... | data structures binary trees | 1 | AVL Trees Height-Balance Property -- (data structures binary trees)
<p>An AVL tree is one that satisfies the <em>height-balance property</em> which states that: For every position p of T, the heights of the children of p differ by at most 1.</p>

<p>Below is an example AVL tree. However, I've highlighted a node... | habedi/stack-exchange-dataset |
47,183 | Can the memory cache hold instructions? | <p>My teacher told us that when the ram runs out of space it will push a program in the cache, i argued that the program should go to the swap space in the hard drive, plus the memory cache cannot hold instructions because instructions and data have different access patterns, it can only hold data frequently accessed.&... | computer architecture operating systems | 1 | Can the memory cache hold instructions? -- (computer architecture operating systems)
<p>My teacher told us that when the ram runs out of space it will push a program in the cache, i argued that the program should go to the swap space in the hard drive, plus the memory cache cannot hold instructions because instructions... | habedi/stack-exchange-dataset |
47,188 | Is an irregular language concatenated with a language with which it has no common symbols irregular? | <p>Here's an example of what I'm talking about. Suppose I have a languages<br>
$$
L_{1} = \{a^ib^i \mid i>0\},\\
L_{2} = \{c^i \mid i>0\}
$$</p>

<p>and
$$
L_{1}L_{2} = \{a^ib^ic^i \mid i>0\}
$$</p>

<p>Is it true that if $L_{1}$ is irregular and $L_{1}$ has no comm... | formal languages regular languages closure properties | 1 | Is an irregular language concatenated with a language with which it has no common symbols irregular? -- (formal languages regular languages closure properties)
<p>Here's an example of what I'm talking about. Suppose I have a languages<br>
$$
L_{1} = \{a^ib^i \mid i>0\},\\
L_{2} = \{c^i \mid i>0\}
... | habedi/stack-exchange-dataset |
47,190 | How to deal with $n\sqrt n$ in master theorem? | <p>In classifying the following formula's asymptotic complexity using master theorem, I have $a = 8$, $b = 4$, and $d = ?$</p>

<p>$T(n) = 8T(n/4) + n\sqrt n$</p>

<p>How do I handle $n\sqrt n$ in this case to get $d$ ?</p>
 | recurrence relation master theorem | 1 | How to deal with $n\sqrt n$ in master theorem? -- (recurrence relation master theorem)
<p>In classifying the following formula's asymptotic complexity using master theorem, I have $a = 8$, $b = 4$, and $d = ?$</p>

<p>$T(n) = 8T(n/4) + n\sqrt n$</p>

<p>How do I handle $n\sqrt n$ in this case to get $d$... | habedi/stack-exchange-dataset |
47,203 | Finding Second large element from a set of 4 element | <p>Is there any special algorithm of lowest complexity for finding 2nd largest element from a set of 4 elements?</p>
 | complexity theory | 1 | Finding Second large element from a set of 4 element -- (complexity theory)
<p>Is there any special algorithm of lowest complexity for finding 2nd largest element from a set of 4 elements?</p>
 | habedi/stack-exchange-dataset |
47,208 | Alternative Method for Computing Two's Complement Binary -> Decimal | <p>I proposed this method of converting a two's complement binary number to decimal to my professor and he said it was wrong. Some older guy in the class just shook his head at me and gave me a condescending stare. I'm willing to admit I'm wrong when I'm wrong but I can't find a case where it doesn't work.</p>

... | arithmetic | 1 | Alternative Method for Computing Two's Complement Binary -> Decimal -- (arithmetic)
<p>I proposed this method of converting a two's complement binary number to decimal to my professor and he said it was wrong. Some older guy in the class just shook his head at me and gave me a condescending stare. I'm willing to admit ... | habedi/stack-exchange-dataset |
47,211 | Sequence of total languages whose limit is turing complete | <p>First let me clarify what I mean by a number of things.
A language is a decidable set of natural numbers which encode functions from natural numbers to natural numbers $ \mathbb{N} \to \mathbb{N}$. A language is said to be total if it only encodes total functions from naturals to naturals. A language is turing c... | computability reference request | 1 | Sequence of total languages whose limit is turing complete -- (computability reference request)
<p>First let me clarify what I mean by a number of things.
A language is a decidable set of natural numbers which encode functions from natural numbers to natural numbers $ \mathbb{N} \to \mathbb{N}$. A language is said ... | habedi/stack-exchange-dataset |
47,214 | Proving that a language is not Recursive | <p>I have the following language: </p>

<p>T = {M | there exists w such that M accepts w within |w| steps}</p>

<p>I am trying to prove that this language is not recursive and that it is recursive-enumerable. To prove that it is NOT recursive I considered the following steps: </p>

<p>1) Assume ... | computability turing machines proof techniques undecidability | 1 | Proving that a language is not Recursive -- (computability turing machines proof techniques undecidability)
<p>I have the following language: </p>

<p>T = {M | there exists w such that M accepts w within |w| steps}</p>

<p>I am trying to prove that this language is not recursive and that it is recursive... | habedi/stack-exchange-dataset |
47,216 | What is dynamic programming about? | <p>Sorry in advance if this question sounds dumb...</p>

<p>As far as I know, building an algorithm using dynamic programming works this way:</p>

<ol>
<li>express the problem as a recurrence relation;</li>
<li>implement the recurrence relation either via memoization or via a bottom up approach.... | algorithms dynamic programming algorithm design | 1 | What is dynamic programming about? -- (algorithms dynamic programming algorithm design)
<p>Sorry in advance if this question sounds dumb...</p>

<p>As far as I know, building an algorithm using dynamic programming works this way:</p>

<ol>
<li>express the problem as a recurrence relation;</li>
<... | habedi/stack-exchange-dataset |
47,222 | Given RSA, why do we not know if public-key cryptography is possible? | <p>I was on wikipedia on list of unsolved computer science problems and found this:
Is public-key cryptography possible?</p>

<p>I thought RSA encryption was a form of public-key cryptography? Why is this a problem?</p>
 | cryptography | 1 | Given RSA, why do we not know if public-key cryptography is possible? -- (cryptography)
<p>I was on wikipedia on list of unsolved computer science problems and found this:
Is public-key cryptography possible?</p>

<p>I thought RSA encryption was a form of public-key cryptography? Why is this a problem?</p>&... | habedi/stack-exchange-dataset |
47,225 | Find the shortest OPEN path connecting a set of 2D points (special case) | <p>I want to trace the shortest path between a set of points on 2D space. The points have integer coordinates and visually appear to follow a well-defined unique path, though they're disordered.</p>

<p>The precondition is very simple: For each point there's always a set of nearby points within a narrow arc, an... | algorithms computational geometry shortest path | 1 | Find the shortest OPEN path connecting a set of 2D points (special case) -- (algorithms computational geometry shortest path)
<p>I want to trace the shortest path between a set of points on 2D space. The points have integer coordinates and visually appear to follow a well-defined unique path, though they're disordered.... | habedi/stack-exchange-dataset |
47,237 | Are Strings Scalar? | <p>I have always considered strings scalar and the main reason for that is that in programming we treat string values a lot like primitive values. But <a href="https://en.wikipedia.org/wiki/Scalar_(mathematics)" rel="noreferrer">this</a> and <a href="https://en.wikipedia.org/wiki/Variable_(computer_science)" rel="noref... | programming languages strings | 1 | Are Strings Scalar? -- (programming languages strings)
<p>I have always considered strings scalar and the main reason for that is that in programming we treat string values a lot like primitive values. But <a href="https://en.wikipedia.org/wiki/Scalar_(mathematics)" rel="noreferrer">this</a> and <a href="https://en.wik... | habedi/stack-exchange-dataset |
47,239 | Can I Use Machine Learning to Predict the Likelihood of an Order Being Shipped? | <p>Let's say I have a database of freight orders. The job is to match freight carriers with customers who need their freight moved. I have the customer's information, the freight carrier's information, and all details related to the freight orders including date ordered, date shipped, the amount of money it took to h... | machine learning | 1 | Can I Use Machine Learning to Predict the Likelihood of an Order Being Shipped? -- (machine learning)
<p>Let's say I have a database of freight orders. The job is to match freight carriers with customers who need their freight moved. I have the customer's information, the freight carrier's information, and all detail... | habedi/stack-exchange-dataset |
47,244 | Term rewriting; Compute critical pairs | <p>I have tried to solve the following exercise but I got stuck while trying to find all the <a href="https://en.wikipedia.org/wiki/Critical_pair_(logic)" rel="nofollow noreferrer">critical pairs</a>.</p>

<p>I have the following questions:</p>

<ol>
<li>How do I know which critical pair produced a ... | logic first order logic | 1 | Term rewriting; Compute critical pairs -- (logic first order logic)
<p>I have tried to solve the following exercise but I got stuck while trying to find all the <a href="https://en.wikipedia.org/wiki/Critical_pair_(logic)" rel="nofollow noreferrer">critical pairs</a>.</p>

<p>I have the following questions:</p>... | habedi/stack-exchange-dataset |
47,249 | How much complexity difference can there be between finding a solution to a Sudoku puzzle and PROVING that the solution is the unique solution? | <p>So usually Sudoku is $9 \times 9$, but this question extends to $n^2 \times n^2$ puzzles with $n > 3$ as well. There are many polynomial time deduction rules that can make progress in finding a solution to a Sudoku puzzle. But then sometimes guessing values and following chains of conclusions might be required to... | complexity theory sudoku | 1 | How much complexity difference can there be between finding a solution to a Sudoku puzzle and PROVING that the solution is the unique solution? -- (complexity theory sudoku)
<p>So usually Sudoku is $9 \times 9$, but this question extends to $n^2 \times n^2$ puzzles with $n > 3$ as well. There are many polynomial tim... | habedi/stack-exchange-dataset |
47,251 | Party optimization: maximum weight independent set in a tree/graph | <p>From <a href="http://www.cs.cornell.edu/courses/cs3110/2011sp/lectures/lec22-memoization/memo.htm" rel="nofollow">Cornell</a> </p>

<blockquote>
 <p>Suppose we want to throw a party for a company whose organization
 chart is a binary tree. Each employee has an associated fun value, and
 we wan... | graphs | 1 | Party optimization: maximum weight independent set in a tree/graph -- (graphs)
<p>From <a href="http://www.cs.cornell.edu/courses/cs3110/2011sp/lectures/lec22-memoization/memo.htm" rel="nofollow">Cornell</a> </p>

<blockquote>
 <p>Suppose we want to throw a party for a company whose organization
 char... | habedi/stack-exchange-dataset |
47,258 | Every graph with $\delta(G) \ge 2$ has a cycle of length at least $\delta(G)+1$? | <p>I'm reading up on graph theory using <a href="http://diestel-graph-theory.com/" rel="nofollow noreferrer">Diestel's book</a>. Right on the outset I got confused though over proposition 1.3.1 on page 8 which reads:</p>

<blockquote>
 <p><strong>Proposition 1.3.1.</strong> Every graph G contains a path of... | graphs | 1 | Every graph with $\delta(G) \ge 2$ has a cycle of length at least $\delta(G)+1$? -- (graphs)
<p>I'm reading up on graph theory using <a href="http://diestel-graph-theory.com/" rel="nofollow noreferrer">Diestel's book</a>. Right on the outset I got confused though over proposition 1.3.1 on page 8 which reads:</p>
&#... | habedi/stack-exchange-dataset |
47,262 | Google Deep Dream has these understandings? | <p>From both my own exploration of Google Deep Dream using Dreamify for IOS, and from Google Image results on the topic. I've come to 3 conclusions about the networks understanding of images that seem too common to be coincidences.</p>

<p>I would like to know if these are recognised as consequences of the appr... | terminology machine learning neural networks | 1 | Google Deep Dream has these understandings? -- (terminology machine learning neural networks)
<p>From both my own exploration of Google Deep Dream using Dreamify for IOS, and from Google Image results on the topic. I've come to 3 conclusions about the networks understanding of images that seem too common to be coincide... | habedi/stack-exchange-dataset |
47,269 | What kind of Neural Network (if any) could fit two sets of data points? | <p>I have two datasets, one of animal migration patterns (collected over the course of a couple years) that consists of many points on an x, y plane (latitude, longitude), and the other of ocean surface temperatures (also a set of lat, long points). What kind of neural network can be used, if any, to see some pattern, ... | artificial intelligence neural networks classification | 1 | What kind of Neural Network (if any) could fit two sets of data points? -- (artificial intelligence neural networks classification)
<p>I have two datasets, one of animal migration patterns (collected over the course of a couple years) that consists of many points on an x, y plane (latitude, longitude), and the other of... | habedi/stack-exchange-dataset |
47,271 | Show that the complements of NP-languages with one word per length are in NP as well | <blockquote>
 <p>Let L be a language over Σ i.e., $L\subseteq Σ^∗$. Suppose L satisfies the > two conditions given below.</p>
 
 <ol>
 <li>L is in NP and</li>
 <li>for every n, there is exactly one string of length n that belongs to
 L. Let $L^c$ be the complement of L over $Σ^∗$. </li>&#x... | complexity theory closure properties np | 1 | Show that the complements of NP-languages with one word per length are in NP as well -- (complexity theory closure properties np)
<blockquote>
 <p>Let L be a language over Σ i.e., $L\subseteq Σ^∗$. Suppose L satisfies the > two conditions given below.</p>
 
 <ol>
 <li>L is in NP and</li>
 <li>f... | habedi/stack-exchange-dataset |
47,273 | BIT: range updates, point queries; true meaning of tree[x] | <p>for the past few days I've been studying Binary Indexed Tree (aka. Fenwick tree) data structure.</p>

<p>I understand the basic form of BIT (<em>point update, range query</em>), and I see the intuition behind it, but when it comes to <em>range update - point query</em> BIT I don't see the intuition behind it... | algorithms data structures | 1 | BIT: range updates, point queries; true meaning of tree[x] -- (algorithms data structures)
<p>for the past few days I've been studying Binary Indexed Tree (aka. Fenwick tree) data structure.</p>

<p>I understand the basic form of BIT (<em>point update, range query</em>), and I see the intuition behind it, but w... | habedi/stack-exchange-dataset |
47,274 | What is the complexity of finding a regular expression equivalent to a given DFA? | <p>I had taken a course long ago on complexity theory. I only remember basic things,
so I am reading "Introduction to the Theory of Computation by Michael Sipser". The book in its first chapter introduces DFA and NFA. </p>

<p>If we are given a DFA $D$ where $\sum=\{0,1\}$ ( the alphabets ), then how diffic... | complexity theory finite automata regular expressions search problem | 1 | What is the complexity of finding a regular expression equivalent to a given DFA? -- (complexity theory finite automata regular expressions search problem)
<p>I had taken a course long ago on complexity theory. I only remember basic things,
so I am reading "Introduction to the Theory of Computation by Michael Sipse... | habedi/stack-exchange-dataset |
47,275 | What's the real difference between throughput and capacity of a network cable? | <p>I was preparing a presentation in work on <a href="https://en.wikipedia.org/wiki/Passive_optical_network" rel="nofollow">GPON & other optical network technologies</a> using documentation provided by a supplier, and the claim it made was "GPON networks have a capacity of up to 100Tbps".</p>

<p>Instantly ... | terminology computer networks | 1 | What's the real difference between throughput and capacity of a network cable? -- (terminology computer networks)
<p>I was preparing a presentation in work on <a href="https://en.wikipedia.org/wiki/Passive_optical_network" rel="nofollow">GPON & other optical network technologies</a> using documentation provided by ... | habedi/stack-exchange-dataset |
47,277 | How can there be 10 steps in the binary search algorithm for the phone book search problem? | <p>The following example was given in an online lecture I was watching. </p>

<p>A phone directory is 1000 pages long, and we have to find the name "Zurich Smith". The algorithm is as follows:</p>

<ol>
<li><p>Split the phone directory into half. If the name is in the first
half, get rid of the ... | algorithms search algorithms binary search | 1 | How can there be 10 steps in the binary search algorithm for the phone book search problem? -- (algorithms search algorithms binary search)
<p>The following example was given in an online lecture I was watching. </p>

<p>A phone directory is 1000 pages long, and we have to find the name "Zurich Smith". The algo... | habedi/stack-exchange-dataset |
47,278 | Product Matching problem in pattern matching | <p>The <strong>Product Matching</strong> problem is defined as follows: <br>
<strong>Input</strong>: Text T=t<sub>0</sub>,...,t<sub>n</sub> and pattern P=p<sub>0</sub>,...,p<sub>m</sub> over alphabet Σ=N .</p>

<p><strong>Output</strong> : All of the i places in the text where exists c<sub>i</sub> which hol... | algorithms | 1 | Product Matching problem in pattern matching -- (algorithms)
<p>The <strong>Product Matching</strong> problem is defined as follows: <br>
<strong>Input</strong>: Text T=t<sub>0</sub>,...,t<sub>n</sub> and pattern P=p<sub>0</sub>,...,p<sub>m</sub> over alphabet Σ=N .</p>

<p><strong>Output</strong> : All of ... | habedi/stack-exchange-dataset |
47,286 | Converting regular language to regular expression by replacing commas with union | <p>I know that regular languages are those that can be described by regular expressions. For the language <code>{0,1}*</code>, is the corresponding regular expression <code>(0∪1)*</code> ? If so, does replacing braces with parentheses and commas with union always work when converting from regular language to regular ex... | formal languages regular languages regular expressions | 1 | Converting regular language to regular expression by replacing commas with union -- (formal languages regular languages regular expressions)
<p>I know that regular languages are those that can be described by regular expressions. For the language <code>{0,1}*</code>, is the corresponding regular expression <code>(0∪1)*... | habedi/stack-exchange-dataset |
47,292 | Average depth of a Binary Search Tree and AVL Tree | <p>My professor recently mentioned that the average depth of the nodes in a binary search tree will be $O(log(n))$ where $n$ is the amount of nodes in the tree. I ended up drawing out a bunch of binary search trees and I don't think I am understanding the concept correctly. For example, if $n=4$ the tree is either goin... | algorithm analysis data structures search trees average case balanced search trees | 1 | Average depth of a Binary Search Tree and AVL Tree -- (algorithm analysis data structures search trees average case balanced search trees)
<p>My professor recently mentioned that the average depth of the nodes in a binary search tree will be $O(log(n))$ where $n$ is the amount of nodes in the tree. I ended up drawing o... | habedi/stack-exchange-dataset |
47,295 | Notation: $L_R = \{w\#y\space|\space R(w,y)\}$? | <p>What is the set
$$L_R = \{w\#y\space|\space R(w,y)\}$$</p>

<p>Specifically what kind of conditional is $R(w,y)$?<br>
Also what's the purpose of $\#$?</p>

<p>This comes from page 2 of the Clay paper on <strong>P vs NP:</strong>
<a href="http://www.claymath.org/sites/default/files/pvsnp.p... | formal languages notation | 1 | Notation: $L_R = \{w\#y\space|\space R(w,y)\}$? -- (formal languages notation)
<p>What is the set
$$L_R = \{w\#y\space|\space R(w,y)\}$$</p>

<p>Specifically what kind of conditional is $R(w,y)$?<br>
Also what's the purpose of $\#$?</p>

<p>This comes from page 2 of the Clay paper on <strong>P v... | habedi/stack-exchange-dataset |
47,298 | Is the reverse postorder of a digraph's reverse the same as the postorder of the digraph? | <p>I've been reading Sedgewick's intro to algorithms book, and he says that <em>the reverse postorder of a digraph's reverse</em> is not the same as <em>the postorder of the digraph</em>, however in both cases it seems that we get the reverse of topological order, so at first I thought that it's the same, but then I lo... | algorithms graphs discrete mathematics graph traversal | 1 | Is the reverse postorder of a digraph's reverse the same as the postorder of the digraph? -- (algorithms graphs discrete mathematics graph traversal)
<p>I've been reading Sedgewick's intro to algorithms book, and he says that <em>the reverse postorder of a digraph's reverse</em> is not the same as <em>the postorder of ... | habedi/stack-exchange-dataset |
47,307 | The theory behind backpropogation, gradient calculation | <p>I am reading a book about Neural Networks, that explains the backpropagation algorithm. It explains that the error function is the sum of error of all inputs, and that the algorithm minimizes this sum, which makes perfect sense to me, but than in goes on stating that to achieve that the gradient is calculated for ea... | algorithms machine learning neural networks | 1 | The theory behind backpropogation, gradient calculation -- (algorithms machine learning neural networks)
<p>I am reading a book about Neural Networks, that explains the backpropagation algorithm. It explains that the error function is the sum of error of all inputs, and that the algorithm minimizes this sum, which make... | habedi/stack-exchange-dataset |
47,331 | Recursive definition of the set of strings over an alphabet | <p>The problem is the following:
Write the recursive definition for the set of all Strings Q over the alphabet {a, b} (i.e. the set of strings consisting of a's and b', for example a, baba, abbbabababba...)</p>

<p>I somewhat get the gist of what recursion definitions consist of, but this one has gotten me ... | recursion | 1 | Recursive definition of the set of strings over an alphabet -- (recursion)
<p>The problem is the following:
Write the recursive definition for the set of all Strings Q over the alphabet {a, b} (i.e. the set of strings consisting of a's and b', for example a, baba, abbbabababba...)</p>

<p>I somewhat get the... | habedi/stack-exchange-dataset |
47,338 | What's a uniform shuffle? | <p>What does it mean exactly a "uniform shuffle" algorithm ?</p>

<p>Is this method considered a uniform shuffle ?</p>

<pre><code>public void shuffle(Comparable[] a) {
 int n = a.length;
 int k, j;
 for (int i = 0; i < n; i++) {
 k = StdRandom.uniform(n); // k in [0, ... | algorithms terminology permutations sampling randomness | 1 | What's a uniform shuffle? -- (algorithms terminology permutations sampling randomness)
<p>What does it mean exactly a "uniform shuffle" algorithm ?</p>

<p>Is this method considered a uniform shuffle ?</p>

<pre><code>public void shuffle(Comparable[] a) {
 int n = a.length;
 int k, j;
... | habedi/stack-exchange-dataset |
47,347 | Why do we use stacks and not queues on system-level? | <p>From low OS-level function calls, to memory allocated to an application, all will primarily take a stack to perform LIFO operations.</p>

<p>Why don't we use queues and FIFO operations? It's just a matter of moving pointers anyway.</p>
 | operating systems stacks | 1 | Why do we use stacks and not queues on system-level? -- (operating systems stacks)
<p>From low OS-level function calls, to memory allocated to an application, all will primarily take a stack to perform LIFO operations.</p>

<p>Why don't we use queues and FIFO operations? It's just a matter of moving pointers an... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.