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
86,045
How can i design this function using only NAND and XOR gates?
<p>I have this initial function \begin{split}(\overline{A}+\overline{B})(\overline{D}+\overline{C})+AB\overline{(\overline{C}+\overline{D})}\end{split}&#xA;Which i reduced to \begin{split}{\overline{AB}*\overline{CD}}+ABCD \end{split}&#xA;The first part is easy to do with NAND but the OR ABCD part i have no ideia how t...
boolean algebra
1
How can i design this function using only NAND and XOR gates? -- (boolean algebra) <p>I have this initial function \begin{split}(\overline{A}+\overline{B})(\overline{D}+\overline{C})+AB\overline{(\overline{C}+\overline{D})}\end{split}&#xA;Which i reduced to \begin{split}{\overline{AB}*\overline{CD}}+ABCD \end{split}&#x...
habedi/stack-exchange-dataset
86,047
Camera position w.r.t. basketball court
<p>I am new in Computer Vision. Suppose you have 8 points (players in a basketball court) in a 2D image (png photo), that is we know the pixel coordinates of each. I would like to compute camera position w.r.t. the field. We have the actual dimensions of the field. Also, I can write the equations of two or three transv...
computer vision
1
Camera position w.r.t. basketball court -- (computer vision) <p>I am new in Computer Vision. Suppose you have 8 points (players in a basketball court) in a 2D image (png photo), that is we know the pixel coordinates of each. I would like to compute camera position w.r.t. the field. We have the actual dimensions of the ...
habedi/stack-exchange-dataset
86,056
Polynomial time problems with provably high degree time complexity?
<p>For any integer $k$, does there exist a decision problem in $\textbf P$ that can be proven to require $\Omega(n^k)$ steps?</p>&#xA;
complexity theory time complexity polynomial time
1
Polynomial time problems with provably high degree time complexity? -- (complexity theory time complexity polynomial time) <p>For any integer $k$, does there exist a decision problem in $\textbf P$ that can be proven to require $\Omega(n^k)$ steps?</p>&#xA;
habedi/stack-exchange-dataset
86,062
Remove elements that appear m times
<p>I need to come up with an algorithm that iterates through an array and if any element appears m times, then the array needs to be modified so that it only appears min(2, m) times. For example, if A = [2, 2, 2, 3, 4, 4, 5, 5, 5] and m = 3, A = [2, 2, 3, 4, 4, 5, 5]. It is easy to do with extra space or nonlinear time...
algorithms
1
Remove elements that appear m times -- (algorithms) <p>I need to come up with an algorithm that iterates through an array and if any element appears m times, then the array needs to be modified so that it only appears min(2, m) times. For example, if A = [2, 2, 2, 3, 4, 4, 5, 5, 5] and m = 3, A = [2, 2, 3, 4, 4, 5, 5]....
habedi/stack-exchange-dataset
86,069
Finding lower bounds for data structures with non-standard interfaces
<p>Consider the <a href="https://leetcode.com/problems/min-stack/description/" rel="nofollow noreferrer">problem</a> of designing a data structure that provides the interface functions $\rm{pop}, \rm{push}, \rm{findmin}$, all running in constant time. This problem may be solved by (e.g.) having the $\rm{push}$ method ...
complexity theory data structures
1
Finding lower bounds for data structures with non-standard interfaces -- (complexity theory data structures) <p>Consider the <a href="https://leetcode.com/problems/min-stack/description/" rel="nofollow noreferrer">problem</a> of designing a data structure that provides the interface functions $\rm{pop}, \rm{push}, \rm...
habedi/stack-exchange-dataset
86,075
FA for w when length of w is even or divisible by 3
<p>I want to construct a FA for the language</p>&#xA;&#xA;<p>$\{w \in \{a,b\} | $length of w is either even or divisible by 3$\}$.</p>&#xA;&#xA;<p>I've been playing around with some FAs, but I can't seem to create one that does the job. I can easily create one that accepts words with even length, and also one that acce...
finite automata
1
FA for w when length of w is even or divisible by 3 -- (finite automata) <p>I want to construct a FA for the language</p>&#xA;&#xA;<p>$\{w \in \{a,b\} | $length of w is either even or divisible by 3$\}$.</p>&#xA;&#xA;<p>I've been playing around with some FAs, but I can't seem to create one that does the job. I can easi...
habedi/stack-exchange-dataset
86,083
Find minimum set of vertices that are reachable from all other vertices
<p>I have a DAG and I wish to find the minimal set of vertices that have a path to all other vertices.</p>&#xA;&#xA;<p>My solution was to simply find all the vertices that their incoming degree is 0.&#xA;However, if there are two vertices in the DAG that have an indegree of 0 and that point to a common vertex then one ...
graphs dag
1
Find minimum set of vertices that are reachable from all other vertices -- (graphs dag) <p>I have a DAG and I wish to find the minimal set of vertices that have a path to all other vertices.</p>&#xA;&#xA;<p>My solution was to simply find all the vertices that their incoming degree is 0.&#xA;However, if there are two ve...
habedi/stack-exchange-dataset
86,092
Which number representation takes the largest amount of memory?
<p>Options are:</p>&#xA;<ol>&#xA;<li>Signed magnitude</li>&#xA;<li>One's complement</li>&#xA;<li>Two's complement</li>&#xA;<li>Excess notation</li>&#xA;</ol>&#xA;<p>This is the question from an 'example of a previous exam' I've been given at university. Answers were not provided.&#xA;As far as I understand only one ans...
arithmetic numeral representations
1
Which number representation takes the largest amount of memory? -- (arithmetic numeral representations) <p>Options are:</p>&#xA;<ol>&#xA;<li>Signed magnitude</li>&#xA;<li>One's complement</li>&#xA;<li>Two's complement</li>&#xA;<li>Excess notation</li>&#xA;</ol>&#xA;<p>This is the question from an 'example of a previous...
habedi/stack-exchange-dataset
86,098
Are time complexity of followng codes equivalent?
<p>Implemented is done in C++.</p>&#xA;&#xA;<p>Supposing we have defined a class <code>T</code> with no restrictions and three functions <code>cond</code>, <code>next</code> and <code>f</code> returning <code>bool</code>, <code>void</code> and anything respectively, are</p>&#xA;&#xA;<pre><code>for(T k = T(); cond(); ne...
algorithms
1
Are time complexity of followng codes equivalent? -- (algorithms) <p>Implemented is done in C++.</p>&#xA;&#xA;<p>Supposing we have defined a class <code>T</code> with no restrictions and three functions <code>cond</code>, <code>next</code> and <code>f</code> returning <code>bool</code>, <code>void</code> and anything r...
habedi/stack-exchange-dataset
86,107
INOI 2017 Problem 2 - Training
<p>INOI 2017, Problem 2, Training<br>&#xA;Ash and his Pokemon Pikachu are going on a journey. Ash has planned his route for the journey so that it&#xA;passes through N cities, numbered 1, 2, …, N, and in this order. </p>&#xA;&#xA;<p>When they set out, Pikachu has an initial strength of Sin as well as an experience val...
algorithms optimization dynamic programming
1
INOI 2017 Problem 2 - Training -- (algorithms optimization dynamic programming) <p>INOI 2017, Problem 2, Training<br>&#xA;Ash and his Pokemon Pikachu are going on a journey. Ash has planned his route for the journey so that it&#xA;passes through N cities, numbered 1, 2, …, N, and in this order. </p>&#xA;&#xA;<p>When t...
habedi/stack-exchange-dataset
86,115
Proving that a class of languages is a subset of RE for Rice Theorem
<blockquote>&#xA; <p>Consider language $L = \{&lt;M&gt; |L(M) \subseteq L(0(0\cup1)^*) \}$&#xA; where $&lt;M&gt;$ is a valid encoding of a turing machine.</p>&#xA;</blockquote>&#xA;&#xA;<p>I know that the language is applicable for Rice Theorem.&#xA;Now, I understand that in this case the language group in $RE$ is:</...
turing machines computability rice theorem
1
Proving that a class of languages is a subset of RE for Rice Theorem -- (turing machines computability rice theorem) <blockquote>&#xA; <p>Consider language $L = \{&lt;M&gt; |L(M) \subseteq L(0(0\cup1)^*) \}$&#xA; where $&lt;M&gt;$ is a valid encoding of a turing machine.</p>&#xA;</blockquote>&#xA;&#xA;<p>I know that ...
habedi/stack-exchange-dataset
86,118
Why doesn't this put $BPP$ in $NP$?
<p>From Sipser Gacs we know <span class="math-container">$x\in L(M)$</span> for a machine <span class="math-container">$M\in BPP$</span> <span class="math-container">$\iff$</span> <span class="math-container">$$\exists t_1,\dots,t_{|r|}\forall r\in\{0,1\}^{|r|}\vee_{i\in\{1,\dots,|r|\}}M(x,r\oplus t_i)=1.$$</span></p>&...
complexity theory logic complexity classes randomized algorithms randomness
1
Why doesn't this put $BPP$ in $NP$? -- (complexity theory logic complexity classes randomized algorithms randomness) <p>From Sipser Gacs we know <span class="math-container">$x\in L(M)$</span> for a machine <span class="math-container">$M\in BPP$</span> <span class="math-container">$\iff$</span> <span class="math-conta...
habedi/stack-exchange-dataset
86,125
Not getting the clear picture of Goto actions , reduce and shift actions in SLR Parsing
<p>I am going through the following lecture notes on LR parsing :</p>&#xA;&#xA;<p><a href="https://www3.nd.edu/~dthain/courses/cse40243/fall2016/chapter4b.pdf" rel="nofollow noreferrer">https://www3.nd.edu/~dthain/courses/cse40243/fall2016/chapter4b.pdf</a> </p>&#xA;&#xA;<p>For the following grammar :</p>&#xA;&#xA;<p><...
compilers parsers
1
Not getting the clear picture of Goto actions , reduce and shift actions in SLR Parsing -- (compilers parsers) <p>I am going through the following lecture notes on LR parsing :</p>&#xA;&#xA;<p><a href="https://www3.nd.edu/~dthain/courses/cse40243/fall2016/chapter4b.pdf" rel="nofollow noreferrer">https://www3.nd.edu/~dt...
habedi/stack-exchange-dataset
86,136
The recursive solution to the all-pairs shortest-paths of Floyd-Warshall algorithm
<p>In the Floyd-Warshall algorithm we have:</p>&#xA;&#xA;<p>Let $d_{ij}^{(k)}$ be the weight of a shortest path from vertex $i$ to $j$ for which all intermediate vertices are in the set $\{1, 2, \cdots, k\}$ then</p>&#xA;&#xA;<p>\begin{align*}&#xA;&amp;d_{ij}^{(k)}= \begin{cases}&#xA;w_{ij} &amp; \text{ if } k = 0 \\&#...
algorithms graphs shortest path
1
The recursive solution to the all-pairs shortest-paths of Floyd-Warshall algorithm -- (algorithms graphs shortest path) <p>In the Floyd-Warshall algorithm we have:</p>&#xA;&#xA;<p>Let $d_{ij}^{(k)}$ be the weight of a shortest path from vertex $i$ to $j$ for which all intermediate vertices are in the set $\{1, 2, \cdot...
habedi/stack-exchange-dataset
86,140
Regular expression for the language containing neither aa nor bb
<p>I want to create a regular expression for the language</p>&#xA;&#xA;<p>$L=\{ w \in \{a,b\} |$ w has neither aa nor bb as a subword$\}$.</p>&#xA;&#xA;<p>I've tried various things, but I can't seem to get the correct regular expression. </p>&#xA;
regular languages regular expressions
1
Regular expression for the language containing neither aa nor bb -- (regular languages regular expressions) <p>I want to create a regular expression for the language</p>&#xA;&#xA;<p>$L=\{ w \in \{a,b\} |$ w has neither aa nor bb as a subword$\}$.</p>&#xA;&#xA;<p>I've tried various things, but I can't seem to get the co...
habedi/stack-exchange-dataset
86,143
Is there any difference between these two languages?
<p>If I have the following two languages:</p>&#xA;&#xA;<p>$L_1= \{ w \in \{a,b\} |$ $w$ has neither $ab$ nor $ba$ as a subword$\}$</p>&#xA;&#xA;<p>$L_2= \{ w \in \{a,b\}^* |$ $w$ has neither $ab$ nor $ba$ as a subword$\}$.</p>&#xA;&#xA;<p>Is there any difference between $L_1$ and $L_2$? I understand the impact of the K...
formal languages regular languages finite automata
1
Is there any difference between these two languages? -- (formal languages regular languages finite automata) <p>If I have the following two languages:</p>&#xA;&#xA;<p>$L_1= \{ w \in \{a,b\} |$ $w$ has neither $ab$ nor $ba$ as a subword$\}$</p>&#xA;&#xA;<p>$L_2= \{ w \in \{a,b\}^* |$ $w$ has neither $ab$ nor $ba$ as a s...
habedi/stack-exchange-dataset
86,149
how to bound the probability that quicksort takes greater than n lg n time?
<p>I am working on exercise 12.4-5 of CLRS (Cormen et al, Intro to Algorithms 3rd ed)</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider RANDOMIZED-QUICKSORT operating on a sequence of <em>n</em> distinct input numbers. Prove that for any constant <em>k</em> > 0, all but <em>O</em>(1/<em>nᵏ</em>) of the <em>n</em>! input perm...
algorithms sorting probability theory randomized algorithms quicksort
1
how to bound the probability that quicksort takes greater than n lg n time? -- (algorithms sorting probability theory randomized algorithms quicksort) <p>I am working on exercise 12.4-5 of CLRS (Cormen et al, Intro to Algorithms 3rd ed)</p>&#xA;&#xA;<blockquote>&#xA; <p>Consider RANDOMIZED-QUICKSORT operating on a seq...
habedi/stack-exchange-dataset
86,156
Is there an analog of "regular" for infinite strings?
<p>Consider the sequence $s_1 = (1, 0, 1, 0,\dots)$. It seems "regular" in a way that, e.g. $s_2 = (1, 2, 3, 4,\dots)$ is not.</p>&#xA;&#xA;<p>I'm not sure how to formalize this intuition though. One thing which jumps out at me is that $L =\{(0 1)^n\}$ is a regular language, and $s_1$ is in some sense the limit of the...
formal languages regular languages
1
Is there an analog of "regular" for infinite strings? -- (formal languages regular languages) <p>Consider the sequence $s_1 = (1, 0, 1, 0,\dots)$. It seems "regular" in a way that, e.g. $s_2 = (1, 2, 3, 4,\dots)$ is not.</p>&#xA;&#xA;<p>I'm not sure how to formalize this intuition though. One thing which jumps out at ...
habedi/stack-exchange-dataset
86,160
Are all turing complete languages interchangeable
<p>Note, while I know how to program, I'm quite a beginner at CS theory.</p>&#xA;&#xA;<p>According to <a href="https://cs.stackexchange.com/a/63978">this answer</a> </p>&#xA;&#xA;<blockquote>&#xA; <p>Turing completeness is an abstract concept of computability. If a language is Turing complete, then it is capable of do...
computability programming languages turing completeness
1
Are all turing complete languages interchangeable -- (computability programming languages turing completeness) <p>Note, while I know how to program, I'm quite a beginner at CS theory.</p>&#xA;&#xA;<p>According to <a href="https://cs.stackexchange.com/a/63978">this answer</a> </p>&#xA;&#xA;<blockquote>&#xA; <p>Turing c...
habedi/stack-exchange-dataset
86,161
What does 'buffering' mean?
<p>I read the lecture 4 of CS162 (UC Berkeley: <a href="https://inst.eecs.berkeley.edu/~cs162/sp17/static/lectures/4.pdf" rel="nofollow noreferrer">https://inst.eecs.berkeley.edu/~cs162/sp17/static/lectures/4.pdf</a>), but I got little bit confused about the meaning of the keyword "buffered" they used when mentioning t...
operating systems streaming algorithm
1
What does 'buffering' mean? -- (operating systems streaming algorithm) <p>I read the lecture 4 of CS162 (UC Berkeley: <a href="https://inst.eecs.berkeley.edu/~cs162/sp17/static/lectures/4.pdf" rel="nofollow noreferrer">https://inst.eecs.berkeley.edu/~cs162/sp17/static/lectures/4.pdf</a>), but I got little bit confused ...
habedi/stack-exchange-dataset
86,170
Connected components of the graph on $[n]$ in which $i,j$ are connected if $\mathrm{gcd}(i,j) > g$
<p>I recently got asked the following question:</p>&#xA;<blockquote>&#xA;<p>A set of <span class="math-container">$n$</span> cities are numbered from 1 to <span class="math-container">$n$</span>. Given a positive integer <span class="math-container">$g$</span>, two cities are connected if their greatest common divisor ...
algorithms graphs connected
1
Connected components of the graph on $[n]$ in which $i,j$ are connected if $\mathrm{gcd}(i,j) > g$ -- (algorithms graphs connected) <p>I recently got asked the following question:</p>&#xA;<blockquote>&#xA;<p>A set of <span class="math-container">$n$</span> cities are numbered from 1 to <span class="math-container">$n$<...
habedi/stack-exchange-dataset
86,187
Integer log2 as a catamorphism?
<p>Recursion schemes are structured methods for expressing recursive functions, of increasing interest due to their ubiquity in functional programming. For example, catamorphisms (familiar in the guise of 'fold' on lists) can be defined for all inductively-defined (i.e. algebraic) data types and in the particular case ...
recursion
1
Integer log2 as a catamorphism? -- (recursion) <p>Recursion schemes are structured methods for expressing recursive functions, of increasing interest due to their ubiquity in functional programming. For example, catamorphisms (familiar in the guise of 'fold' on lists) can be defined for all inductively-defined (i.e. al...
habedi/stack-exchange-dataset
86,191
Buying as many items for as much money
<p>I cant find a way to implement a certain solution. Let me flesh out the problem.</p>&#xA;&#xA;<p>Somebody gives you X amount of money and sends you to the shop to buy Y amount of items. You must spend as much money as you can and buy as many items as you can. You cant have more money they X. You cant buy more than Y...
optimization
1
Buying as many items for as much money -- (optimization) <p>I cant find a way to implement a certain solution. Let me flesh out the problem.</p>&#xA;&#xA;<p>Somebody gives you X amount of money and sends you to the shop to buy Y amount of items. You must spend as much money as you can and buy as many items as you can. ...
habedi/stack-exchange-dataset
86,196
Paint the balls: what patterns can be painted?
<p>You are given a number $k$ which specifies the number of consecutive balls you can paint in a go. You are given a string $S$ of length $l$. $l$ is the number of balls and each character in the string specifies the color of the $i^{th}$ ball. I want to know whether it is possible to color all the balls in the given p...
algorithms strings
1
Paint the balls: what patterns can be painted? -- (algorithms strings) <p>You are given a number $k$ which specifies the number of consecutive balls you can paint in a go. You are given a string $S$ of length $l$. $l$ is the number of balls and each character in the string specifies the color of the $i^{th}$ ball. I wa...
habedi/stack-exchange-dataset
86,203
Difference between NFA and NBA
<p>NFA (nondeterministic finite automata) accepts only finite words while a NBA (nondeterministic Büchi automata) accepts infinite words (and hence <span class="math-container">$\omega-$</span>regular languages).</p>&#xA;<p>I think the example automata accepts finite word like <span class="math-container">$A,B,A,B$</sp...
regular languages regular expressions
1
Difference between NFA and NBA -- (regular languages regular expressions) <p>NFA (nondeterministic finite automata) accepts only finite words while a NBA (nondeterministic Büchi automata) accepts infinite words (and hence <span class="math-container">$\omega-$</span>regular languages).</p>&#xA;<p>I think the example au...
habedi/stack-exchange-dataset
86,212
Iterative DFS space complexity O(|E|)? Same vertex appears multiple times in stack?
<p>I'm referring to a question already asked on stackoverflow: <a href="https://stackoverflow.com/questions/25988965/does-depth-first-search-create-redundancy" title="Does depth first search create redundancy">https://stackoverflow.com/questions/25988965/does-depth-first-search-create-redundancy</a></p>&#xA;&#xA;<p>How...
algorithms graphs algorithm analysis graph traversal space analysis
1
Iterative DFS space complexity O(|E|)? Same vertex appears multiple times in stack? -- (algorithms graphs algorithm analysis graph traversal space analysis) <p>I'm referring to a question already asked on stackoverflow: <a href="https://stackoverflow.com/questions/25988965/does-depth-first-search-create-redundancy" tit...
habedi/stack-exchange-dataset
86,214
Number of conflict serializable schedules
<blockquote>&#xA;<p>Two transactions <span class="math-container">$T_1$</span> and <span class="math-container">$T_2$</span> are given as:</p>&#xA;<p><span class="math-container">$$T_1: r_1(X)w_1(X)r_1(Y)w_1(Y)$$</span></p>&#xA;<p><span class="math-container">$$T_2: r_2(Y)w_2(Y)r_2(Z)w_2(Z)$$</span></p>&#xA;<p>where <s...
concurrency database theory
1
Number of conflict serializable schedules -- (concurrency database theory) <blockquote>&#xA;<p>Two transactions <span class="math-container">$T_1$</span> and <span class="math-container">$T_2$</span> are given as:</p>&#xA;<p><span class="math-container">$$T_1: r_1(X)w_1(X)r_1(Y)w_1(Y)$$</span></p>&#xA;<p><span class="m...
habedi/stack-exchange-dataset
86,216
How to calculate the complexity of a TM?
<p>I have the language </p>&#xA;&#xA;<p>$\{ w \mid w \text{ contains an equal amount of symbols } a \text{ and } b\}$.</p>&#xA;&#xA;<p>I want to show that the language is in the class $\textsf{P}$. To do this, I must give an implementation level description of the relevant Turing machine. I'm not very knowledgeable on ...
complexity theory turing machines
1
How to calculate the complexity of a TM? -- (complexity theory turing machines) <p>I have the language </p>&#xA;&#xA;<p>$\{ w \mid w \text{ contains an equal amount of symbols } a \text{ and } b\}$.</p>&#xA;&#xA;<p>I want to show that the language is in the class $\textsf{P}$. To do this, I must give an implementation ...
habedi/stack-exchange-dataset
86,222
Origins of the numerical notation for types in type theory
<p>In several papers on type theory it's possible to see some sort of numerical notation for types based on the number of possible constructors for the type. For example, the unit type is usually written as $1$, as there's only one possible constructor for it; similarly, they use $2$ for booleans, $x + y$ for disjoint ...
type theory
1
Origins of the numerical notation for types in type theory -- (type theory) <p>In several papers on type theory it's possible to see some sort of numerical notation for types based on the number of possible constructors for the type. For example, the unit type is usually written as $1$, as there's only one possible con...
habedi/stack-exchange-dataset
86,226
Algorithm to calculate numbers of 10^x smaller than given one
<p>I am struggling to create a smart algorithm. Currently I have produced one which is super-ugly and not efficient because I am casting <code>numerics</code> to <code>strings</code> back and forth, not really useful to share it here.</p>&#xA;&#xA;<p>The point of algorithm is to get a number <code>10^x</code> which is ...
algorithms
1
Algorithm to calculate numbers of 10^x smaller than given one -- (algorithms) <p>I am struggling to create a smart algorithm. Currently I have produced one which is super-ugly and not efficient because I am casting <code>numerics</code> to <code>strings</code> back and forth, not really useful to share it here.</p>&#xA...
habedi/stack-exchange-dataset
86,240
Inequality over the entropy of an integer-valued random variable
<p>I stumbled upon this inequality over a course on Information Theory :</p>&#xA;&#xA;<blockquote>&#xA; <p>If $Z\in\mathbb{N}​$ with finite mean, then $H(Z) \leq E(Z)\times h(\frac 1 {E(Z)})​$ where $h$ is the binary entropy function</p>&#xA;</blockquote>&#xA;&#xA;<p>I have been trying to prove it using the log-sum in...
discrete mathematics information theory statistics
1
Inequality over the entropy of an integer-valued random variable -- (discrete mathematics information theory statistics) <p>I stumbled upon this inequality over a course on Information Theory :</p>&#xA;&#xA;<blockquote>&#xA; <p>If $Z\in\mathbb{N}​$ with finite mean, then $H(Z) \leq E(Z)\times h(\frac 1 {E(Z)})​$ where...
habedi/stack-exchange-dataset
86,252
What does "map" mean?
<p>I have encountered the term many times, in various CS education materials:</p>&#xA;&#xA;<ol>&#xA;<li><p>L2 CS162 (UC Berkeley):</p>&#xA;&#xA;<blockquote>&#xA; <p>Memory-mapped I/O</p>&#xA;</blockquote></li>&#xA;<li><p>L4 CS162 (UC Berkeley):</p>&#xA;&#xA;<blockquote>&#xA; <p>Memory mapped files</p>&#xA;</blockquot...
data structures operating systems memory management
1
What does "map" mean? -- (data structures operating systems memory management) <p>I have encountered the term many times, in various CS education materials:</p>&#xA;&#xA;<ol>&#xA;<li><p>L2 CS162 (UC Berkeley):</p>&#xA;&#xA;<blockquote>&#xA; <p>Memory-mapped I/O</p>&#xA;</blockquote></li>&#xA;<li><p>L4 CS162 (UC Berkel...
habedi/stack-exchange-dataset
86,256
Time complexity of this nested loop should be $O(n^{48})$ instead of $O(n^6)$
<p>I was asked to solve this code on piece of paper while having a debate in the class. We are all new to DataStrct/Algo. I came up with the answer $O(n^{48})$ which was proved wrong. I am not convinced with the answer they gave me which was $O(n^6)$. </p>&#xA;&#xA;<pre><code>void main()&#xA;{&#xA; int i;&#xA;&#xA;...
algorithm analysis
1
Time complexity of this nested loop should be $O(n^{48})$ instead of $O(n^6)$ -- (algorithm analysis) <p>I was asked to solve this code on piece of paper while having a debate in the class. We are all new to DataStrct/Algo. I came up with the answer $O(n^{48})$ which was proved wrong. I am not convinced with the answer...
habedi/stack-exchange-dataset
86,260
What does "local" mean?
<p>I study graph theory on my own using Diestel's <em>Graph Theory</em> book (with Algorithmic graph theory in mind). I don't understand what <em>local property</em>, <em>global property</em>, <em>locality</em> mean given a graph $G$. </p>&#xA;&#xA;<p>For example, on the page 5 it says </p>&#xA;&#xA;<blockquote>&#xA; ...
graphs terminology
1
What does "local" mean? -- (graphs terminology) <p>I study graph theory on my own using Diestel's <em>Graph Theory</em> book (with Algorithmic graph theory in mind). I don't understand what <em>local property</em>, <em>global property</em>, <em>locality</em> mean given a graph $G$. </p>&#xA;&#xA;<p>For example, on the ...
habedi/stack-exchange-dataset
86,270
why are WAW and WAR hazards not possible in mips architecture
<p>i have read about data hazards and then came across that mips architecture doesn't allow WAR AND WAW hazards can someone please help me understand it? the reason is not given in the book the MIPS pipeline is divided into :</p>&#xA;&#xA;<p>1.IF(instruction fetch) 2.ID(decode the instruction) 3.EX(execute instruction)...
computer architecture cpu
1
why are WAW and WAR hazards not possible in mips architecture -- (computer architecture cpu) <p>i have read about data hazards and then came across that mips architecture doesn't allow WAR AND WAW hazards can someone please help me understand it? the reason is not given in the book the MIPS pipeline is divided into :</...
habedi/stack-exchange-dataset
86,274
Approximating a series for asymptotic upper bound
<p>So I stumbled upon a question here to find an asymptotic bound for the recurrence&#xA;$$&#xA;T(n) = 4T(n/4) + \left( \frac {n} {\log n} \right)^2 $$</p>&#xA;&#xA;<p>The solution shows a solution using master method to prove the answer as $O(n)$&#xA;However, I tried to solve it using substitution as:</p>&#xA;&#xA;<p>...
asymptotics recurrence relation
1
Approximating a series for asymptotic upper bound -- (asymptotics recurrence relation) <p>So I stumbled upon a question here to find an asymptotic bound for the recurrence&#xA;$$&#xA;T(n) = 4T(n/4) + \left( \frac {n} {\log n} \right)^2 $$</p>&#xA;&#xA;<p>The solution shows a solution using master method to prove the an...
habedi/stack-exchange-dataset
86,275
Naive argument that P ≠ NP
<p>Consider the following naïve argument that any algorithm solving SAT must take $\Omega(2^n)$ time in the worst-case scenario.</p>&#xA;&#xA;<p>Let $f(x_1,x_2,\dots,x_n)$ be a Boolean function in conjunctive normal form (CNF). The problem SAT is to determine whether there exists a $(x_1,x_2,\dots,x_n) \in \{0,1\}^n$ s...
complexity theory proof techniques p vs np
1
Naive argument that P ≠ NP -- (complexity theory proof techniques p vs np) <p>Consider the following naïve argument that any algorithm solving SAT must take $\Omega(2^n)$ time in the worst-case scenario.</p>&#xA;&#xA;<p>Let $f(x_1,x_2,\dots,x_n)$ be a Boolean function in conjunctive normal form (CNF). The problem SAT i...
habedi/stack-exchange-dataset
86,283
Is there any practical application for arrays that contain themselves?
<p>I'm reading the introduction to Godel, Escher, Bach and and there's heavy discussion of mathematical sets which contain themselves. Being a far better programmer than mathematician, I put it into terms I'm more comfortable with and started to think about arrays which contain/reference themselves.</p>&#xA;&#xA;<p>I k...
recursion
1
Is there any practical application for arrays that contain themselves? -- (recursion) <p>I'm reading the introduction to Godel, Escher, Bach and and there's heavy discussion of mathematical sets which contain themselves. Being a far better programmer than mathematician, I put it into terms I'm more comfortable with and...
habedi/stack-exchange-dataset
86,287
Two's complement addition
<p>I am currently learning about a CPU's status register and was confused about the difference between the carry flag and the overflow flag. Then I found article [1] which explains it very well, but I stumbled across one paragraph I don't really understand:</p>&#xA;&#xA;<blockquote>&#xA; <p>The rules for two's complem...
arithmetic cpu
1
Two's complement addition -- (arithmetic cpu) <p>I am currently learning about a CPU's status register and was confused about the difference between the carry flag and the overflow flag. Then I found article [1] which explains it very well, but I stumbled across one paragraph I don't really understand:</p>&#xA;&#xA;<bl...
habedi/stack-exchange-dataset
86,295
How to compute (x MOD y) with just SUM and MULT gates?
<p>It is known that $\{ SUM, MULT \}$ is Turing-complete, i.e. every Turing machine has an equivalent circuit made up of $SUM$ and $MULT$ gates.</p>&#xA;&#xA;<p>By the way, I could not come up with designing $MOD$ function with $SUM$- and $MULT$-only circuit. How can one construct such a circuit?</p>&#xA;&#xA;<p>P.S. T...
circuits turing completeness
1
How to compute (x MOD y) with just SUM and MULT gates? -- (circuits turing completeness) <p>It is known that $\{ SUM, MULT \}$ is Turing-complete, i.e. every Turing machine has an equivalent circuit made up of $SUM$ and $MULT$ gates.</p>&#xA;&#xA;<p>By the way, I could not come up with designing $MOD$ function with $SU...
habedi/stack-exchange-dataset
86,296
Regularization term moving the hyperbolic plane
<p>When we train a network, we usually have an error function which usually looks like this:</p>&#xA;&#xA;<p>$$Error = (output - target)^2$$</p>&#xA;&#xA;<p>When we add a regularization term, it looks something like this:</p>&#xA;&#xA;<p>$$Error = (output - target)^2 + reg term$$</p>&#xA;&#xA;<p>I understand that there...
machine learning
1
Regularization term moving the hyperbolic plane -- (machine learning) <p>When we train a network, we usually have an error function which usually looks like this:</p>&#xA;&#xA;<p>$$Error = (output - target)^2$$</p>&#xA;&#xA;<p>When we add a regularization term, it looks something like this:</p>&#xA;&#xA;<p>$$Error = (o...
habedi/stack-exchange-dataset
86,307
Why models of computation are primarily focused on machines?
<p>It seems a lot of courses (like <a href="http://cs.brown.edu/~jes/book/pdfs/ModelsOfComputation.pdf" rel="nofollow noreferrer">this</a> and <a href="http://infolab.stanford.edu/~ullman/ialc.html" rel="nofollow noreferrer">this</a>) on theory/models of computation (and even formal languages) cover DFA, NDFA, PDA, and...
turing machines lambda calculus computation models
1
Why models of computation are primarily focused on machines? -- (turing machines lambda calculus computation models) <p>It seems a lot of courses (like <a href="http://cs.brown.edu/~jes/book/pdfs/ModelsOfComputation.pdf" rel="nofollow noreferrer">this</a> and <a href="http://infolab.stanford.edu/~ullman/ialc.html" rel=...
habedi/stack-exchange-dataset
86,310
Cache efficient matrix multiplication
<p>Consider these matrices:</p>&#xA;&#xA;<p>$A=\begin{bmatrix}1 &amp; 2\\3 &amp; 4\end{bmatrix}$</p>&#xA;&#xA;<p>$B=\begin{bmatrix}-1 &amp; -2\\-3 &amp; -4\end{bmatrix}$</p>&#xA;&#xA;<p><strong>Using standard algorithm:</strong></p>&#xA;&#xA;<p>$C=\begin{bmatrix}1*-1+2*-3 &amp; 1*-2+2*-4\\3*-1+4*-3 &amp; 3*-2+4*-4\end{...
computer architecture linear algebra memory access
1
Cache efficient matrix multiplication -- (computer architecture linear algebra memory access) <p>Consider these matrices:</p>&#xA;&#xA;<p>$A=\begin{bmatrix}1 &amp; 2\\3 &amp; 4\end{bmatrix}$</p>&#xA;&#xA;<p>$B=\begin{bmatrix}-1 &amp; -2\\-3 &amp; -4\end{bmatrix}$</p>&#xA;&#xA;<p><strong>Using standard algorithm:</stron...
habedi/stack-exchange-dataset
86,314
What is "Containment order"? Could I get a friendly explanation?
<p>Reading the <a href="https://en.wikipedia.org/wiki/Containment_order" rel="nofollow noreferrer">Wikipedia page</a> was a little dense for me. Can anyone offer a friendly explanation of what this means? It sounds like it saying that if you have two ordered collections, if they are "ordered by containment" then they w...
terminology
1
What is "Containment order"? Could I get a friendly explanation? -- (terminology) <p>Reading the <a href="https://en.wikipedia.org/wiki/Containment_order" rel="nofollow noreferrer">Wikipedia page</a> was a little dense for me. Can anyone offer a friendly explanation of what this means? It sounds like it saying that if ...
habedi/stack-exchange-dataset
86,318
reducing the halting problem to the blank tape problem
<p>I have checked many discussions for understanding this problem.</p>&#xA;&#xA;<p>I understand the reasoning , unfortunately there are some drawback in my understanding.</p>&#xA;&#xA;<p><strong>The Blank-tape halting Problem</strong></p>&#xA;&#xA;<p><strong>Input</strong>: Turing Machine M</p>&#xA;&#xA;<p><strong>Ques...
complexity theory reductions halting problem
1
reducing the halting problem to the blank tape problem -- (complexity theory reductions halting problem) <p>I have checked many discussions for understanding this problem.</p>&#xA;&#xA;<p>I understand the reasoning , unfortunately there are some drawback in my understanding.</p>&#xA;&#xA;<p><strong>The Blank-tape halti...
habedi/stack-exchange-dataset
86,326
Where are 'Base & Bounds' registers located?
<p>I read about virtual memory from <a href="http://www-inst.eecs.berkeley.edu/~cs152/fa16/lectures/L08-AddressTranslation.pdf" rel="nofollow noreferrer">L08/CS152 of U.C Berkeley</a> and used to deep dive into the details of VM <em>hardware</em> implementation, yet didn't find any document or figure on the course spec...
computer architecture memory management virtual memory
1
Where are 'Base & Bounds' registers located? -- (computer architecture memory management virtual memory) <p>I read about virtual memory from <a href="http://www-inst.eecs.berkeley.edu/~cs152/fa16/lectures/L08-AddressTranslation.pdf" rel="nofollow noreferrer">L08/CS152 of U.C Berkeley</a> and used to deep dive into the ...
habedi/stack-exchange-dataset
86,328
How to convert pixel relative focal lengths to mm.
<p>Ive been playing around with the Intel Realsense R200 Camera.&#xA;I am able to exact focal length in x and y i.e. fx and fy,&#xA;but only "up to scale relative to pixel width and height, respectively"</p>&#xA;&#xA;<p>At the moment I dont see any way of querying the pixel dimensions in mm from the API nor can I find ...
computer vision
1
How to convert pixel relative focal lengths to mm. -- (computer vision) <p>Ive been playing around with the Intel Realsense R200 Camera.&#xA;I am able to exact focal length in x and y i.e. fx and fy,&#xA;but only "up to scale relative to pixel width and height, respectively"</p>&#xA;&#xA;<p>At the moment I dont see any...
habedi/stack-exchange-dataset
86,344
How deep do neural networks need to be?
<p>My question is a bit on the philosophical side, and there is probably not one single 'correct' answer on this. Nonetheless, I'm curious to hear your opinion...</p>&#xA;&#xA;<p>I'm currently designing a convolutional neural network to locate features in images taken by a microscope. These features are geometrically q...
machine learning neural networks
1
How deep do neural networks need to be? -- (machine learning neural networks) <p>My question is a bit on the philosophical side, and there is probably not one single 'correct' answer on this. Nonetheless, I'm curious to hear your opinion...</p>&#xA;&#xA;<p>I'm currently designing a convolutional neural network to locat...
habedi/stack-exchange-dataset
86,349
Total Number of Bits Needed to Represent a List of N elements
<p>This is an excerpt from the algorithms textbook <strong>How to Think About Algorithms</strong> by Jeff Edmonds (This book is a gem by the way).</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/u929S.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u929S.png" alt="HTTAA Chapter 5.4 Radix Counting ...
algorithms algorithm analysis time complexity sorting radix sort
1
Total Number of Bits Needed to Represent a List of N elements -- (algorithms algorithm analysis time complexity sorting radix sort) <p>This is an excerpt from the algorithms textbook <strong>How to Think About Algorithms</strong> by Jeff Edmonds (This book is a gem by the way).</p>&#xA;&#xA;<p><a href="https://i.stack....
habedi/stack-exchange-dataset
86,355
$UP=BPP$ implies $UP=RP$?
<p><a href="https://cseweb.ucsd.edu/~mihir/cse200/ss6.pdf" rel="nofollow noreferrer">https://cseweb.ucsd.edu/~mihir/cse200/ss6.pdf</a> shows $NP$ in $BPP$ implies $NP$ in $RP$ by showing $SAT$ is in $RP$ if $NP$ is in $BPP$ and since $SAT$ is $NP$ complete we have $NP$ is in $RP$.</p>&#xA;&#xA;<p>However since $UP$ doe...
complexity theory time complexity complexity classes
1
$UP=BPP$ implies $UP=RP$? -- (complexity theory time complexity complexity classes) <p><a href="https://cseweb.ucsd.edu/~mihir/cse200/ss6.pdf" rel="nofollow noreferrer">https://cseweb.ucsd.edu/~mihir/cse200/ss6.pdf</a> shows $NP$ in $BPP$ implies $NP$ in $RP$ by showing $SAT$ is in $RP$ if $NP$ is in $BPP$ and since $S...
habedi/stack-exchange-dataset
86,357
What happens during the DFA reversal construction if the initial state is final?
<p>The steps in reversal of DFA are :-</p>&#xA;&#xA;<ol>&#xA;<li><p>Make final state as initial state. If there are more than 1 final state, then make a new start state with epsilon transitions to these states.</p></li>&#xA;<li><p>Change all initial states to final states</p></li>&#xA;<li><p>Reverse the direction of ed...
automata finite automata closure properties
1
What happens during the DFA reversal construction if the initial state is final? -- (automata finite automata closure properties) <p>The steps in reversal of DFA are :-</p>&#xA;&#xA;<ol>&#xA;<li><p>Make final state as initial state. If there are more than 1 final state, then make a new start state with epsilon transiti...
habedi/stack-exchange-dataset
86,371
The meaning of 'Pool' in Computer Science
<p>While reading about <code>SIMD</code> on <a href="https://en.wikipedia.org/wiki/SIMD" rel="nofollow noreferrer">Wikipedia</a>, I noticed the use of the technical term <code>Pool</code> in the figure below:</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/63TVs.png" rel="nofollow noreferrer"><img src="https://i.sta...
computer architecture operating systems
1
The meaning of 'Pool' in Computer Science -- (computer architecture operating systems) <p>While reading about <code>SIMD</code> on <a href="https://en.wikipedia.org/wiki/SIMD" rel="nofollow noreferrer">Wikipedia</a>, I noticed the use of the technical term <code>Pool</code> in the figure below:</p>&#xA;&#xA;<p><a href=...
habedi/stack-exchange-dataset
86,375
Does having more bus in the computer increasing speed?
<p>Whát i mention here is for having 2x bus will increasing 2x memory access speed like 3x will have 3x memory access speed like that !</p>&#xA;
computer architecture memory management memory hardware memory access
1
Does having more bus in the computer increasing speed? -- (computer architecture memory management memory hardware memory access) <p>Whát i mention here is for having 2x bus will increasing 2x memory access speed like 3x will have 3x memory access speed like that !</p>&#xA;
habedi/stack-exchange-dataset
86,379
Generating a Context Free Grammar(CFG) from a Language
<p>I would really appreciate if anyone could tell me how to generate CFG from this language. I am trying to learn the procedure of generating CFGs from CFLs and I am able to solve easier problems.. but I am really stuck on this one, I just can't get it how can I generate at two different positions at the same time.</p>...
computability context free pushdown automata
1
Generating a Context Free Grammar(CFG) from a Language -- (computability context free pushdown automata) <p>I would really appreciate if anyone could tell me how to generate CFG from this language. I am trying to learn the procedure of generating CFGs from CFLs and I am able to solve easier problems.. but I am really s...
habedi/stack-exchange-dataset
86,380
Comparison Based Sorting Run-time with respect to Total Number of Bits of Input
<p>Comparison-based sorting algorithms are lower bounded by $\Omega(nlogn)$, where $n$ is the number of elements in the input list.</p>&#xA;&#xA;<p>However, when dealing with different models of computation, such as algorithms that deal with arithmetic operations (Euclid-GCD) or, $n$, the size of the input, is no longe...
algorithms algorithm analysis time complexity sorting radix sort
1
Comparison Based Sorting Run-time with respect to Total Number of Bits of Input -- (algorithms algorithm analysis time complexity sorting radix sort) <p>Comparison-based sorting algorithms are lower bounded by $\Omega(nlogn)$, where $n$ is the number of elements in the input list.</p>&#xA;&#xA;<p>However, when dealing ...
habedi/stack-exchange-dataset
86,406
Do all algorithms aim to solve decision problems?
<p>An algorithm is a “<a href="https://en.wikipedia.org/wiki/Algorithm" rel="nofollow noreferrer">unambiguous specification of how to solve a class of problems... calculation, data processing and automated reasoning tasks</a>” Are the class of problems an algorithm can solve more abstractly considered decision problems...
algorithms decision problem
1
Do all algorithms aim to solve decision problems? -- (algorithms decision problem) <p>An algorithm is a “<a href="https://en.wikipedia.org/wiki/Algorithm" rel="nofollow noreferrer">unambiguous specification of how to solve a class of problems... calculation, data processing and automated reasoning tasks</a>” Are the cl...
habedi/stack-exchange-dataset
86,409
What is a "slice" of a parameterized problem $(Q, \kappa)$?
<p>In the book <a href="http://www.springer.com/gp/book/9783540299523" rel="nofollow noreferrer">"Parameterized Complexity Theory" by J. Flum, and M. Grohe</a>, there is a definition on page 7:</p>&#xA;&#xA;<p><strong>Definition 1.10.</strong><br>&#xA;Let $(Q, \kappa)$ be a parameterized problem and $\ell \in \mathbb{N...
complexity theory parameterized complexity
1
What is a "slice" of a parameterized problem $(Q, \kappa)$? -- (complexity theory parameterized complexity) <p>In the book <a href="http://www.springer.com/gp/book/9783540299523" rel="nofollow noreferrer">"Parameterized Complexity Theory" by J. Flum, and M. Grohe</a>, there is a definition on page 7:</p>&#xA;&#xA;<p><s...
habedi/stack-exchange-dataset
86,412
Are grammars corresponding to DFAs unambiguous and those to NFAs ambiguous?
<p>Are grammars corresponding to DFAs unambiguous and those to NFAs ambiguous?&#xA;According to what I studied, every DCFL is guaranteed to have an unambiguous grammar though there are multiple grammars generating them.&#xA;Every regular language is also DCFL, hence they will follow the same, but I doubt if every gramm...
automata finite automata formal grammars
1
Are grammars corresponding to DFAs unambiguous and those to NFAs ambiguous? -- (automata finite automata formal grammars) <p>Are grammars corresponding to DFAs unambiguous and those to NFAs ambiguous?&#xA;According to what I studied, every DCFL is guaranteed to have an unambiguous grammar though there are multiple gram...
habedi/stack-exchange-dataset
86,418
How to classify a 3D "Knapsack" problem where the only limitation is space, i.e. there is no weight constraint?
<p>The problem is defined as: pack a 3D space with a given list of 3 types of cuboids which are each assigned a value, trying to either completely fill the space or to achieve the highest total value of the packing. &#xA;When researching knapsack problems all of the different variations I came across&#xA;had a weight c...
optimization packing
1
How to classify a 3D "Knapsack" problem where the only limitation is space, i.e. there is no weight constraint? -- (optimization packing) <p>The problem is defined as: pack a 3D space with a given list of 3 types of cuboids which are each assigned a value, trying to either completely fill the space or to achieve the hi...
habedi/stack-exchange-dataset
86,422
Proving worst-case running time is in $\Omega(n^2)$
<p>I was given the following method to argue that an algorithm $A$ has a worst-case running time of $\Omega(n^2)$:</p>&#xA;&#xA;<blockquote>&#xA; <p>We need to argue that there exists an input $x$ of size $n$, the&#xA; running time of $A$ with input $x$, i.e., $t(x)$, is at least&#xA; $cn^2$, where $x&gt;0$ is a con...
asymptotics proof techniques
1
Proving worst-case running time is in $\Omega(n^2)$ -- (asymptotics proof techniques) <p>I was given the following method to argue that an algorithm $A$ has a worst-case running time of $\Omega(n^2)$:</p>&#xA;&#xA;<blockquote>&#xA; <p>We need to argue that there exists an input $x$ of size $n$, the&#xA; running time ...
habedi/stack-exchange-dataset
86,425
Finding the average time complexity for a max algorithm
<p>I'm trying to find the average-case <em>number of times that max is assigned a value</em> by the below algorithm <code>find_max</code>.</p>&#xA;<pre><code>find_max(L):&#xA; max = -oo # negative infinity&#xA; for k = 0 to len(L)-1:&#xA; if L[k] &gt; max:&#xA; max = L[k]&#xA; return ...
complexity theory runtime analysis average case
1
Finding the average time complexity for a max algorithm -- (complexity theory runtime analysis average case) <p>I'm trying to find the average-case <em>number of times that max is assigned a value</em> by the below algorithm <code>find_max</code>.</p>&#xA;<pre><code>find_max(L):&#xA; max = -oo # negative infinity&#...
habedi/stack-exchange-dataset
86,433
Why does functional map() operation not permit operating on two elements of a list at a time?
<p>Mathematically it seems so easy to use two elements of a vector as two arguments to a function.&#xA;$$f(\boldsymbol{x_{i+1}},\boldsymbol{x_{i}})$$&#xA;In functional programming however a map (function) allows to work with one element at a time only, so one would need to create vector of pairwise 2-tuples from a sing...
functional programming
1
Why does functional map() operation not permit operating on two elements of a list at a time? -- (functional programming) <p>Mathematically it seems so easy to use two elements of a vector as two arguments to a function.&#xA;$$f(\boldsymbol{x_{i+1}},\boldsymbol{x_{i}})$$&#xA;In functional programming however a map (fun...
habedi/stack-exchange-dataset
86,434
Theta Manipulation to show $N = \Theta(n/\log N)=\Theta(n/\log n)$
<p>I am studying different models of computation and how algorithms can be interpreted under different models.</p>&#xA;&#xA;<p>Here is a math(?) question that has been bugging me.</p>&#xA;&#xA;<p>Suppose we have $n = \Theta(N\log N)$ bits as the size of input and there are N elements in the input. (The implied assumpti...
algorithm analysis asymptotics runtime analysis landau notation
1
Theta Manipulation to show $N = \Theta(n/\log N)=\Theta(n/\log n)$ -- (algorithm analysis asymptotics runtime analysis landau notation) <p>I am studying different models of computation and how algorithms can be interpreted under different models.</p>&#xA;&#xA;<p>Here is a math(?) question that has been bugging me.</p>&...
habedi/stack-exchange-dataset
86,449
State Machine and State transition Table - Explanation and Creation Of
<p>How do I create a state transition table/array in actual code/pseudo-code?</p>&#xA;&#xA;<p>I haven't experienced the "ah-ha" moment yet with the state machine to coding (and I really want to). I've looked at several code sample and read blog posts, but it's not clicking yet.</p>&#xA;&#xA;<p>I'm looking for a pragmat...
transition systems design patterns
1
State Machine and State transition Table - Explanation and Creation Of -- (transition systems design patterns) <p>How do I create a state transition table/array in actual code/pseudo-code?</p>&#xA;&#xA;<p>I haven't experienced the "ah-ha" moment yet with the state machine to coding (and I really want to). I've looked a...
habedi/stack-exchange-dataset
86,466
What is the precise definition of pseudo-polynomial time (feat. Counting Sort)
<p>From <a href="https://en.wikipedia.org/wiki/Pseudo-polynomial_time" rel="nofollow noreferrer">wikipedia</a> </p>&#xA;&#xA;<blockquote>&#xA; <p>In computational complexity theory, a numeric algorithm runs in <strong>pseudo-polynomial</strong> time if its running time is a polynomial in the length of the input (the...
algorithms complexity theory algorithm analysis time complexity polynomial time
1
What is the precise definition of pseudo-polynomial time (feat. Counting Sort) -- (algorithms complexity theory algorithm analysis time complexity polynomial time) <p>From <a href="https://en.wikipedia.org/wiki/Pseudo-polynomial_time" rel="nofollow noreferrer">wikipedia</a> </p>&#xA;&#xA;<blockquote>&#xA; <p>In comp...
habedi/stack-exchange-dataset
86,475
What is exponent of denormalized real in IEEE 754 floating point format?
<p>I was reading <a href="http://steve.hollasch.net/cgindex/coding/ieeefloat.html" rel="nofollow noreferrer">this link</a>.</p>&#xA;&#xA;<p>Here I noticed that, in table titles "Float Values (b = bias)", in exponent column, entry for denormalized reals is $00..00$, but in value column, the entry is $-b+1$. Why is there...
floating point
1
What is exponent of denormalized real in IEEE 754 floating point format? -- (floating point) <p>I was reading <a href="http://steve.hollasch.net/cgindex/coding/ieeefloat.html" rel="nofollow noreferrer">this link</a>.</p>&#xA;&#xA;<p>Here I noticed that, in table titles "Float Values (b = bias)", in exponent column, ent...
habedi/stack-exchange-dataset
86,480
Number of seeks in an I/O efficent algroithm
<p>A seek is the task of positioning the read/write head of the disk to the required data block, and irrespective of the size of the data block, all contiguous data can be accessed using a single seek. Seek complexity of an algorithm is defined as the number of times the algorithm leaves one data locality for another, ...
algorithms complexity theory big data
1
Number of seeks in an I/O efficent algroithm -- (algorithms complexity theory big data) <p>A seek is the task of positioning the read/write head of the disk to the required data block, and irrespective of the size of the data block, all contiguous data can be accessed using a single seek. Seek complexity of an algorith...
habedi/stack-exchange-dataset
86,482
What is the role of Numerical Gradient Computation in Backpropagation algorithm?
<p>I was listening CS231n (2017) lectures and noted that there is a lot of attention to Numerical Gradient Computation (NGC). It starts <a href="https://youtu.be/d14TUNcbn1k?t=5m53s" rel="nofollow noreferrer">@5:53 in this video</a> and appears a few times later.</p>&#xA;&#xA;<p>Also, looking at the batch normalization...
machine learning neural networks numerical algorithms
1
What is the role of Numerical Gradient Computation in Backpropagation algorithm? -- (machine learning neural networks numerical algorithms) <p>I was listening CS231n (2017) lectures and noted that there is a lot of attention to Numerical Gradient Computation (NGC). It starts <a href="https://youtu.be/d14TUNcbn1k?t=5m53...
habedi/stack-exchange-dataset
86,485
Cover $n$ points in the plane with $k$ circles of radius $1$
<p>I am studying for an algorithms exam and ran into this example problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>A circular disk with radius $2r$ can be covered by $7$ circular disks with&#xA; radius $r$; in the following you can use this statement without proof.</p>&#xA; &#xA; <p>Suppose that we are given a set $S$ o...
algorithms computational geometry
1
Cover $n$ points in the plane with $k$ circles of radius $1$ -- (algorithms computational geometry) <p>I am studying for an algorithms exam and ran into this example problem.</p>&#xA;&#xA;<blockquote>&#xA; <p>A circular disk with radius $2r$ can be covered by $7$ circular disks with&#xA; radius $r$; in the following...
habedi/stack-exchange-dataset
86,492
R.E or non R.E?
<p>$L_1= \{ \langle M \rangle \mid L(M) \text{ is strings of length between } 1 \text{ and } 5 \}$.</p>&#xA;&#xA;<p>$L_2 = \{ \langle M \rangle \mid L(M) \text{ is strings of length at most } 5\}$.</p>&#xA;&#xA;<p>I am able to figure out that both languages are undecidable as we can have $TM_{yes}$ and $TM_{no}$ and ...
turing machines computability
1
R.E or non R.E? -- (turing machines computability) <p>$L_1= \{ \langle M \rangle \mid L(M) \text{ is strings of length between } 1 \text{ and } 5 \}$.</p>&#xA;&#xA;<p>$L_2 = \{ \langle M \rangle \mid L(M) \text{ is strings of length at most } 5\}$.</p>&#xA;&#xA;<p>I am able to figure out that both languages are undec...
habedi/stack-exchange-dataset
86,495
Does MMU contain and manage CPU caches?
<p>I read about <code>Virtual Memory</code> in various CS references, however I'm still not sure whether <code>CPU caches</code> such as <em>TLB</em>, <em>L1</em> and <em>L2</em> are integrated within <code>MMU</code>. Also I don't know if the <code>hit</code>/<code>miss</code> operations are managed by <em>hardware</e...
computer architecture operating systems memory management virtual memory
1
Does MMU contain and manage CPU caches? -- (computer architecture operating systems memory management virtual memory) <p>I read about <code>Virtual Memory</code> in various CS references, however I'm still not sure whether <code>CPU caches</code> such as <em>TLB</em>, <em>L1</em> and <em>L2</em> are integrated within <...
habedi/stack-exchange-dataset
86,497
Is my lambda calculus reduction correct and final form valid in simply typed lambda calc?
<p>I'm looking at some lambda calculus at the moment and came across this question:</p>&#xA;&#xA;<p>0:R</p>&#xA;&#xA;<p>1:R</p>&#xA;&#xA;<p>plus: R->R->R</p>&#xA;&#xA;<p>(lambda f:T . lambda g:U . (f 0) (g 0)) (plus 1) (plus (plus 1 1))</p>&#xA;&#xA;<p>Is it well typed given appropriate types for T and U?</p>&#xA;&#xA;...
lambda calculus
1
Is my lambda calculus reduction correct and final form valid in simply typed lambda calc? -- (lambda calculus) <p>I'm looking at some lambda calculus at the moment and came across this question:</p>&#xA;&#xA;<p>0:R</p>&#xA;&#xA;<p>1:R</p>&#xA;&#xA;<p>plus: R->R->R</p>&#xA;&#xA;<p>(lambda f:T . lambda g:U . (f 0) (g 0))...
habedi/stack-exchange-dataset
86,509
Sort huge file algoritm
<p><strong>What algorithm should be used here to solve this problem efficiently?</strong></p>&#xA;&#xA;<p>One file stores 5 year log of user IDs &amp; their website visit dates in random order. There were around 1,000,000 users on the website and 1/4 of them were active. Active users visited the website 100 times a day...
sorting mergesort
1
Sort huge file algoritm -- (sorting mergesort) <p><strong>What algorithm should be used here to solve this problem efficiently?</strong></p>&#xA;&#xA;<p>One file stores 5 year log of user IDs &amp; their website visit dates in random order. There were around 1,000,000 users on the website and 1/4 of them were active. A...
habedi/stack-exchange-dataset
86,524
Expected number of nodes in the independent set produced by a coloring algorithm on a graph with maximal degree $k$
<p>We have a graph with <span class="math-container">$n$</span> nodes and maximal degree <span class="math-container">$k$</span>. On this graph we run a coloring algorithm that finds a maximum independent set. The algorithm colors every node green with probability <span class="math-container">$\frac{1}{k}$</span> and c...
algorithms probabilistic algorithms
1
Expected number of nodes in the independent set produced by a coloring algorithm on a graph with maximal degree $k$ -- (algorithms probabilistic algorithms) <p>We have a graph with <span class="math-container">$n$</span> nodes and maximal degree <span class="math-container">$k$</span>. On this graph we run a coloring a...
habedi/stack-exchange-dataset
86,525
can every LR(k) grammer be transformed to LR(1)
<p>when i was studying compilers i came across this in Wikipedia every DCFL has a corresponding unambiguous grammar and hence can be parsed by an LR(1) parser which is the most powerful parser then what is the significance of LR(k) parsers are they more powerful than LR(1) when every DCFL can be parsed by LR(1) why do ...
compilers lr k
1
can every LR(k) grammer be transformed to LR(1) -- (compilers lr k) <p>when i was studying compilers i came across this in Wikipedia every DCFL has a corresponding unambiguous grammar and hence can be parsed by an LR(1) parser which is the most powerful parser then what is the significance of LR(k) parsers are they mor...
habedi/stack-exchange-dataset
86,531
Transforming a bounded knapsack to 0/1 knapsack
<p>Could I transform a bounded-knapsack problem into a 0/1 knapsack problem using the following way-:</p>&#xA;&#xA;<p>Example: Lets says I have 3 types of items</p>&#xA;&#xA;<p>$n=3$</p>&#xA;&#xA;<p>$p_j=\{10,15,11\}$</p>&#xA;&#xA;<p>$w_j=\{1,3,5\}$</p>&#xA;&#xA;<p>$b_j=\{6,4,2\}$</p>&#xA;&#xA;<p>$c = 10$</p>&#xA;&#xA;...
dynamic programming knapsack problems
1
Transforming a bounded knapsack to 0/1 knapsack -- (dynamic programming knapsack problems) <p>Could I transform a bounded-knapsack problem into a 0/1 knapsack problem using the following way-:</p>&#xA;&#xA;<p>Example: Lets says I have 3 types of items</p>&#xA;&#xA;<p>$n=3$</p>&#xA;&#xA;<p>$p_j=\{10,15,11\}$</p>&#xA;&#x...
habedi/stack-exchange-dataset
86,535
P reduction between np-complete to np-complete
<p>given 2 lagnauges A,B which are npc.&#xA;is there a reduction function from A to B $A \leq_PB$ ?</p>&#xA;&#xA;<p>my idea was to say that since they are decideable, &#xA;we can do this:&#xA;$$&#xA;f(x) = \begin{cases} y \in B &amp; \text{ } if x \in A \\y \notin B &amp; \text{if }x \notin A.\end{cases}&#xA;$$</p>&#xA...
complexity theory formal languages turing machines reductions
1
P reduction between np-complete to np-complete -- (complexity theory formal languages turing machines reductions) <p>given 2 lagnauges A,B which are npc.&#xA;is there a reduction function from A to B $A \leq_PB$ ?</p>&#xA;&#xA;<p>my idea was to say that since they are decideable, &#xA;we can do this:&#xA;$$&#xA;f(x) = ...
habedi/stack-exchange-dataset
86,539
Does polynomial time reduction from CNFFAL to CNFSAT is also polynomial time reduction from CNFSAT to CNFFAL?
<p><strong>CNFSAT</strong> is the language of all strings that are encoding of <strong>satisfiable</strong> boolean formula in conjunctive normal form while <strong>CNFFAL</strong> is the language of all strings that are encoding of <strong>falsifiable</strong> boolean formula in conjunctive normal form.</p>&#xA;&#xA;<...
complexity theory turing machines reductions satisfiability nondeterminism
1
Does polynomial time reduction from CNFFAL to CNFSAT is also polynomial time reduction from CNFSAT to CNFFAL? -- (complexity theory turing machines reductions satisfiability nondeterminism) <p><strong>CNFSAT</strong> is the language of all strings that are encoding of <strong>satisfiable</strong> boolean formula in con...
habedi/stack-exchange-dataset
86,549
How to construct the objective function for genetic algorithm optimization?
<p>I am trying to optimize a coefficients of filter by minimizing sum-squared error. I want to use a <em>genetic algorithm</em> (GA) optimization wherein the coefficients of filter form the GA's chromosome (a vector).</p>&#xA;&#xA;<p>How can I construct the objective function, given that I want it to use least-square...
optimization genetic algorithms
1
How to construct the objective function for genetic algorithm optimization? -- (optimization genetic algorithms) <p>I am trying to optimize a coefficients of filter by minimizing sum-squared error. I want to use a <em>genetic algorithm</em> (GA) optimization wherein the coefficients of filter form the GA's chromosome...
habedi/stack-exchange-dataset
86,558
Is it possible for a maximum weight edge of a cycle being included in MST?
<p>Let C be a cycle in a simple connected weighted undirected graph. Let "e" be an edge of maximum weight on C &#xA;Which of the following is TRUE?</p>&#xA;&#xA;<p>(A) No minimum weight spanning tree contains e. <br>&#xA;(B) There exists a minimum-weight spanning tree not containing e. <br> &#xA;(C) no shortest path, b...
minimum spanning tree
1
Is it possible for a maximum weight edge of a cycle being included in MST? -- (minimum spanning tree) <p>Let C be a cycle in a simple connected weighted undirected graph. Let "e" be an edge of maximum weight on C &#xA;Which of the following is TRUE?</p>&#xA;&#xA;<p>(A) No minimum weight spanning tree contains e. <br>&#...
habedi/stack-exchange-dataset
86,562
Finding a minimum equivalent graph of a digraph
<p>It is said that this problem is NP-complete but I couldn't find the proof.&#xA;Is there any paper on this problem or not?</p>&#xA;
algorithms np complete reference request
1
Finding a minimum equivalent graph of a digraph -- (algorithms np complete reference request) <p>It is said that this problem is NP-complete but I couldn't find the proof.&#xA;Is there any paper on this problem or not?</p>&#xA;
habedi/stack-exchange-dataset
86,570
How to show that some problem is in NP and that it's NP-complete
<p>I need some help with the following question:</p>&#xA;<blockquote>&#xA;<p>Recall the <em>subset sum problem</em>, which is known to be NP-complete:</p>&#xA;<p><em>&quot;Given a finite set of natural numbers and a number <span class="math-container">$n$</span>, decide whether a subset of the given set exists such tha...
complexity theory np complete np hard np subset sum
1
How to show that some problem is in NP and that it's NP-complete -- (complexity theory np complete np hard np subset sum) <p>I need some help with the following question:</p>&#xA;<blockquote>&#xA;<p>Recall the <em>subset sum problem</em>, which is known to be NP-complete:</p>&#xA;<p><em>&quot;Given a finite set of natu...
habedi/stack-exchange-dataset
86,579
Which is the best approach to solve Turing machines exercises?
<p>I've this exercise of which I'm not very sure about my solution.</p>&#xA;&#xA;<p>Exercise: </p>&#xA;&#xA;<blockquote>&#xA; <p>Define the transition table about a Turing Machine that accepts words&#xA; on the {a, b} alphabet where each a is followed by only two b.</p>&#xA;</blockquote>&#xA;&#xA;<p>My proposed solut...
turing machines
1
Which is the best approach to solve Turing machines exercises? -- (turing machines) <p>I've this exercise of which I'm not very sure about my solution.</p>&#xA;&#xA;<p>Exercise: </p>&#xA;&#xA;<blockquote>&#xA; <p>Define the transition table about a Turing Machine that accepts words&#xA; on the {a, b} alphabet where e...
habedi/stack-exchange-dataset
86,580
Hamming distance and parity
<p>For an Hamming code of $n$ bit there are $k$ bit reserved for the data and $p$ bit for the parity where $p$ is the minimum integer for which the following inequation is satisfied: $$2^p \geqslant p + k + 1$$ &#xA;This because at least $p$ bit are required to code $n$ error on a single bit $+ 1$ for the "no error" wo...
error correcting codes hamming code bit manipulation
1
Hamming distance and parity -- (error correcting codes hamming code bit manipulation) <p>For an Hamming code of $n$ bit there are $k$ bit reserved for the data and $p$ bit for the parity where $p$ is the minimum integer for which the following inequation is satisfied: $$2^p \geqslant p + k + 1$$ &#xA;This because at le...
habedi/stack-exchange-dataset
86,581
Data structure that supports finding frequency of given element in $O(\log n)$ and most frequent elemnt in O(1) time
<p>Ok, so I got this for homework and been struggling for a while now.&#xA;The full assignment requires this:</p>&#xA;&#xA;<p>While <strong>N = number of elements</strong> in given array and <strong>n = number of different elements</strong>, </p>&#xA;&#xA;<p><strong>init(S,A[1...N])</strong> - accept an array A as inpu...
data structures binary trees
1
Data structure that supports finding frequency of given element in $O(\log n)$ and most frequent elemnt in O(1) time -- (data structures binary trees) <p>Ok, so I got this for homework and been struggling for a while now.&#xA;The full assignment requires this:</p>&#xA;&#xA;<p>While <strong>N = number of elements</stron...
habedi/stack-exchange-dataset
86,588
Why RAID 2 would ever be used instead of RAID 3?
<p>According to <a href="https://www.thegeekstuff.com/2011/11/raid2-raid3-raid4-raid6/" rel="nofollow noreferrer">this</a> source and Tanenbaum's Modern Operating Systems a possible implementation of RAID 2 consists of 4 data disks and 3 disks which contain parity bits. Why don't we need 4 disks that stores parity bits...
computer architecture memory hardware
1
Why RAID 2 would ever be used instead of RAID 3? -- (computer architecture memory hardware) <p>According to <a href="https://www.thegeekstuff.com/2011/11/raid2-raid3-raid4-raid6/" rel="nofollow noreferrer">this</a> source and Tanenbaum's Modern Operating Systems a possible implementation of RAID 2 consists of 4 data di...
habedi/stack-exchange-dataset
86,600
Why is RTS/CTS optional?
<p>I was reading in Wikipedia about it and one of the main things that were pointed out was that it is only an optional mechanism. This bugs me more than it should as I cannot find any information that I can understand about it.</p>&#xA;&#xA;<p>Can anyone explain to me like I am a five-year-old why are they optional?</...
algorithms computer networks communication protocols protocols
1
Why is RTS/CTS optional? -- (algorithms computer networks communication protocols protocols) <p>I was reading in Wikipedia about it and one of the main things that were pointed out was that it is only an optional mechanism. This bugs me more than it should as I cannot find any information that I can understand about it...
habedi/stack-exchange-dataset
86,605
Why isn't every vertex connected to every other vertex in TextRank?
<p>I've been reading up on the automatic text summarization approach TextRank, particularly for generating summaries of a text using sentence extraction as opposed to keyword or phrase extraction.</p>&#xA;&#xA;<p>In the published paper, an example body of text and the resulting ranked graph of all sentences/vertices an...
graphs artificial intelligence
1
Why isn't every vertex connected to every other vertex in TextRank? -- (graphs artificial intelligence) <p>I've been reading up on the automatic text summarization approach TextRank, particularly for generating summaries of a text using sentence extraction as opposed to keyword or phrase extraction.</p>&#xA;&#xA;<p>In ...
habedi/stack-exchange-dataset
86,611
Relating accepting/rejecting paths to satisfying/falsifying assignments in (Cook, 1971)
<p>I read <a href="http://4mhz.de/cook.html" rel="nofollow noreferrer"><em>The Complexity of Theorem-Proving Procedures</em> by Stephen A. Cook (1971)</a>.&#xA;Cook explains how to create a boolean formula $\Phi$ from $(M,w)$, where $M$ is a non-deterministic Turing machine that always halts in a polynomial number of s...
complexity theory turing machines satisfiability strings nondeterminism
1
Relating accepting/rejecting paths to satisfying/falsifying assignments in (Cook, 1971) -- (complexity theory turing machines satisfiability strings nondeterminism) <p>I read <a href="http://4mhz.de/cook.html" rel="nofollow noreferrer"><em>The Complexity of Theorem-Proving Procedures</em> by Stephen A. Cook (1971)</a>....
habedi/stack-exchange-dataset
86,612
Can we apply binary search for finding key 'x' in unsorted array?
<p>Suppose we are given A, an array of size n, comprised of an increasing sequence of numbers followed immediately by a decreasing one. What is worst case time complexity of optimal algorithm to determine if a given number x is in the array?</p>&#xA;&#xA;<p>The explanation given on the this <a href="https://www.geeksfo...
algorithms arrays searching
1
Can we apply binary search for finding key 'x' in unsorted array? -- (algorithms arrays searching) <p>Suppose we are given A, an array of size n, comprised of an increasing sequence of numbers followed immediately by a decreasing one. What is worst case time complexity of optimal algorithm to determine if a given numbe...
habedi/stack-exchange-dataset
86,615
How to reduce Untyped λ-Calculus to Normal Form?
<p>I have an assignment to do which involves reducing an Untyped λ-Calculus expression to Normal Form. I am struggling to come to terms with Lambda Calculus though. </p>&#xA;&#xA;<p>For example, one small part of the expression is:</p>&#xA;&#xA;<pre><code>((λ n f x . n f (f x)) (λ f x . x))&#xA;</code></pre>&#xA;&#xA;<...
lambda calculus
1
How to reduce Untyped λ-Calculus to Normal Form? -- (lambda calculus) <p>I have an assignment to do which involves reducing an Untyped λ-Calculus expression to Normal Form. I am struggling to come to terms with Lambda Calculus though. </p>&#xA;&#xA;<p>For example, one small part of the expression is:</p>&#xA;&#xA;<pre>...
habedi/stack-exchange-dataset
86,617
Balanced weight distribution into buckets, but with a twist (aka sharding a list into k even shards)
<p>Is there an existing algorithm that can solve the following problem?</p>&#xA;&#xA;<p><strong>Problem</strong></p>&#xA;&#xA;<p>Given an list N comprised of integers of various values, shard the list into k buckets such that:</p>&#xA;&#xA;<ol>&#xA;<li>The sum of the integers in each bucket are roughly evenly divided (...
algorithms
1
Balanced weight distribution into buckets, but with a twist (aka sharding a list into k even shards) -- (algorithms) <p>Is there an existing algorithm that can solve the following problem?</p>&#xA;&#xA;<p><strong>Problem</strong></p>&#xA;&#xA;<p>Given an list N comprised of integers of various values, shard the list in...
habedi/stack-exchange-dataset
86,636
algorithm for list display
<p>I'm working on a website which gets a list of objects like this:</p>&#xA;&#xA;<p><code>Object { model: "modelhandler.comment", pk: 5, fields: Object }</code> </p>&#xA;&#xA;<p>where the field objects contains this:</p>&#xA;&#xA;<p><code>Object { user: "TestUser",id: 6, video: 7, description: "test new video comment l...
algorithms
1
algorithm for list display -- (algorithms) <p>I'm working on a website which gets a list of objects like this:</p>&#xA;&#xA;<p><code>Object { model: "modelhandler.comment", pk: 5, fields: Object }</code> </p>&#xA;&#xA;<p>where the field objects contains this:</p>&#xA;&#xA;<p><code>Object { user: "TestUser",id: 6, video...
habedi/stack-exchange-dataset
86,638
Understanding PDA and Equivalence of PDA and CFG
<p>When we wanted to construct a PDA for $0^n1^n$ the idea was to put all the zeroes (which is a part of the input string) to the stack associated with the PDA, and then pop each of them when we get a $1$ from the latter part of the input.</p>&#xA;&#xA;<p>But when we try to prove that, we can create a PDA for a given C...
automata context free pushdown automata
1
Understanding PDA and Equivalence of PDA and CFG -- (automata context free pushdown automata) <p>When we wanted to construct a PDA for $0^n1^n$ the idea was to put all the zeroes (which is a part of the input string) to the stack associated with the PDA, and then pop each of them when we get a $1$ from the latter part ...
habedi/stack-exchange-dataset
86,646
Simplifying sum of falling factorials
<p>I wrote the worst algorithm in the world.&#xA;Doesn't matter what it does. I have just a question about folding formula for it's time complexity into some shorter form which would be easier to compute.&#xA;So I concluded that the equation for the number of operations is as follows:</p>&#xA;&#xA;<p>$$n + n(n-1) + n(n...
algorithm analysis discrete mathematics
1
Simplifying sum of falling factorials -- (algorithm analysis discrete mathematics) <p>I wrote the worst algorithm in the world.&#xA;Doesn't matter what it does. I have just a question about folding formula for it's time complexity into some shorter form which would be easier to compute.&#xA;So I concluded that the equa...
habedi/stack-exchange-dataset
86,649
Flexible Team Orienteering Problem
<p>In Team Orienteering Problem <code>(TOP)</code> we have a graph $G=(V,E)$ and $K$ participants, We are supposed to find $K$ paths with total edge cost less than a threshold while maximising total vertex rewards. The constraint on reward collecting is once a reward has been collected by some participant the it can no...
np complete traveling salesman
1
Flexible Team Orienteering Problem -- (np complete traveling salesman) <p>In Team Orienteering Problem <code>(TOP)</code> we have a graph $G=(V,E)$ and $K$ participants, We are supposed to find $K$ paths with total edge cost less than a threshold while maximising total vertex rewards. The constraint on reward collectin...
habedi/stack-exchange-dataset
86,653
What does 'relocation' mean?
<p>I am reading about <code>Base &amp; Bounds</code> memory protection mechanism, and I noticed the use of the term <em>'relocation'</em> in the context of <code>address space</code>, but failed to understand the meaning associated with it.</p>&#xA;&#xA;<p>Below are some examples:</p>&#xA;&#xA;<ol>&#xA;<li><p>U.C Berke...
operating systems memory management virtual memory
1
What does 'relocation' mean? -- (operating systems memory management virtual memory) <p>I am reading about <code>Base &amp; Bounds</code> memory protection mechanism, and I noticed the use of the term <em>'relocation'</em> in the context of <code>address space</code>, but failed to understand the meaning associated wit...
habedi/stack-exchange-dataset
86,660
Whether TM accepts epsilon?
<p><span class="math-container">$L = \{ \langle M \rangle \mid \epsilon \in L(M) \}$</span>, where <span class="math-container">$M$</span> is any Turing machine.</p>&#xA;&#xA;<p>Why is the above problem undecidable? Can't we just check whether the initial state is a final state and say the TM accepts <span class="math-...
turing machines computability
1
Whether TM accepts epsilon? -- (turing machines computability) <p><span class="math-container">$L = \{ \langle M \rangle \mid \epsilon \in L(M) \}$</span>, where <span class="math-container">$M$</span> is any Turing machine.</p>&#xA;&#xA;<p>Why is the above problem undecidable? Can't we just check whether the initial s...
habedi/stack-exchange-dataset
86,666
How does the OS detect B&B violation from hardware?
<p>After reading about <code>Base &amp; Bounds</code> memory protection mechanism from <a href="https://web.stanford.edu/%7Eouster/cgi-bin/cs140-winter13/lecture.php?topic=vm" rel="nofollow noreferrer">Stanford CS140 lecture notes</a>, I understood from the explanation below that there is an <code>integrated circuit</c...
computer architecture operating systems virtual memory
1
How does the OS detect B&B violation from hardware? -- (computer architecture operating systems virtual memory) <p>After reading about <code>Base &amp; Bounds</code> memory protection mechanism from <a href="https://web.stanford.edu/%7Eouster/cgi-bin/cs140-winter13/lecture.php?topic=vm" rel="nofollow noreferrer">Stanfo...
habedi/stack-exchange-dataset
86,669
What does 'RTU' mean?
<p>While I was reading about <code>Base &amp; Bounds</code> memory protection mechanism, I noticed the use of the abbreviation <em>RTU</em> as indicated in the slide below:</p>&#xA;<p><a href="https://i.stack.imgur.com/mf88d.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mf88d.png" alt="enter image ...
computer architecture
1
What does 'RTU' mean? -- (computer architecture) <p>While I was reading about <code>Base &amp; Bounds</code> memory protection mechanism, I noticed the use of the abbreviation <em>RTU</em> as indicated in the slide below:</p>&#xA;<p><a href="https://i.stack.imgur.com/mf88d.png" rel="nofollow noreferrer"><img src="https...
habedi/stack-exchange-dataset