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 |
|---|---|---|---|---|---|---|
47,355 | For tiling simply connected regions with shapes beyond just rectangles, is there a lower # of tile shapes needed for NP-completeness? | <p>In "TILING SIMPLY CONNECTED REGIONS WITH RECTANGLES" by Igor Pak and Jed Yang, they show there is a set of "no more than $10^6$ rectangles" such that the problem of tiling an arbitrary simply connected region with these rectangle shapes is NP-complete. However the number of rectangle shapes $10^6$ seems pretty extre... | complexity theory np complete tiling | 1 | For tiling simply connected regions with shapes beyond just rectangles, is there a lower # of tile shapes needed for NP-completeness? -- (complexity theory np complete tiling)
<p>In "TILING SIMPLY CONNECTED REGIONS WITH RECTANGLES" by Igor Pak and Jed Yang, they show there is a set of "no more than $10^6$ rectangles" s... | habedi/stack-exchange-dataset |
47,357 | Difference between First Order Logic and Predicate Calculus | <p>I see the two used interchangeably. Is one the subset of the other or are they both the same thing? </p>
 | first order logic | 1 | Difference between First Order Logic and Predicate Calculus -- (first order logic)
<p>I see the two used interchangeably. Is one the subset of the other or are they both the same thing? </p>
 | habedi/stack-exchange-dataset |
47,362 | Show that a function is not a PRFs | <p>I am studying cryptography and having some trouble with the PRFs
How do I show that $f_{k}(x) =x+k^2$ mod $2^n$ is not a Psuedo Random function? I know that I need to show that the distignuisher can tell this is not random with a better then $\frac{1}{2}$ probability but how would it do that? (I don't just wan... | proof techniques cryptography randomness | 1 | Show that a function is not a PRFs -- (proof techniques cryptography randomness)
<p>I am studying cryptography and having some trouble with the PRFs
How do I show that $f_{k}(x) =x+k^2$ mod $2^n$ is not a Psuedo Random function? I know that I need to show that the distignuisher can tell this is not random with a ... | habedi/stack-exchange-dataset |
47,367 | Are nearly all natural numbers compressible? | <p>A <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity#Compression" rel="nofollow noreferrer">simple counting argument</a> shows most strings can't be compressed to shorter strings. But, compression is usually defined using Kolmogorov complexity. A string is compressible if its Kolmogorov complexity is less ... | integers kolmogorov complexity | 1 | Are nearly all natural numbers compressible? -- (integers kolmogorov complexity)
<p>A <a href="https://en.wikipedia.org/wiki/Kolmogorov_complexity#Compression" rel="nofollow noreferrer">simple counting argument</a> shows most strings can't be compressed to shorter strings. But, compression is usually defined using Kolm... | habedi/stack-exchange-dataset |
47,408 | Convex Hull in no particular order | <p>The proof for the $\Omega(n\log n)$ lower bound for calculating the convex hull by using order-type predicates that I have come across uses the fact that if there was possible to calculate the convex hull in time better than this, then we could do sorting using the same technique, but as it is known that sorting has... | complexity theory time complexity computational geometry sorting | 1 | Convex Hull in no particular order -- (complexity theory time complexity computational geometry sorting)
<p>The proof for the $\Omega(n\log n)$ lower bound for calculating the convex hull by using order-type predicates that I have come across uses the fact that if there was possible to calculate the convex hull in time... | habedi/stack-exchange-dataset |
47,412 | Star-free decomposition of regular language given by regular expression | <p>I was wondering: is there an algorithm to decompose any regular expression, provided it doesn't use complementation, into one or more regular expressions which don't use Kleene star (only catenation and union).</p>

<p>Right now I'm reading On the Decomposition of Finite Languages by A. Mateescu, A. Salomaa ... | regular languages automata regular expressions | 1 | Star-free decomposition of regular language given by regular expression -- (regular languages automata regular expressions)
<p>I was wondering: is there an algorithm to decompose any regular expression, provided it doesn't use complementation, into one or more regular expressions which don't use Kleene star (only caten... | habedi/stack-exchange-dataset |
47,417 | The 50 value problems in TAoCP | <p>This is just a question for fun and specifically for those who have read the reference pervasively.</p>

<p>I have been reading the work of Knuth's The Art of Computer Programming and struggling and having a lot of fun with its exercises. I was very impressed that Fermat's Last Theorem had a difficulty of 45... | research | 1 | The 50 value problems in TAoCP -- (research)
<p>This is just a question for fun and specifically for those who have read the reference pervasively.</p>

<p>I have been reading the work of Knuth's The Art of Computer Programming and struggling and having a lot of fun with its exercises. I was very impressed that... | habedi/stack-exchange-dataset |
47,422 | Why is the probability used in the definition of RP complexity classes, arbitrary? | <p>I was looking at the following wikipedia article on the RP complexity class:</p>

<p><a href="https://en.wikipedia.org/wiki/RP_(complexity)" rel="nofollow">https://en.wikipedia.org/wiki/RP_(complexity)</a></p>

<p>In its definition it states:</p>

<ul>
<li>If the correct answer is NO then... | complexity theory randomized algorithms | 1 | Why is the probability used in the definition of RP complexity classes, arbitrary? -- (complexity theory randomized algorithms)
<p>I was looking at the following wikipedia article on the RP complexity class:</p>

<p><a href="https://en.wikipedia.org/wiki/RP_(complexity)" rel="nofollow">https://en.wikipedia.org/... | habedi/stack-exchange-dataset |
47,432 | What is a swap-with-memory instruction? | <p>I am reading an article on algorithms for parallel computing and came across the following sentence. What do they mean by a swap-with-memory instruction?</p>

<blockquote>
 <p>Our algorithm provides reasonable latency in the absence of contention, requires only a constant amount of space per lock, and ... | parallel computing memory hardware | 1 | What is a swap-with-memory instruction? -- (parallel computing memory hardware)
<p>I am reading an article on algorithms for parallel computing and came across the following sentence. What do they mean by a swap-with-memory instruction?</p>

<blockquote>
 <p>Our algorithm provides reasonable latency in th... | habedi/stack-exchange-dataset |
47,438 | Number of DFAs of only one state | <p>If I have a DFA with only one state that is not an accept state, it accepts only the empty set.</p>

<p>I get confused when if the DFA of one state is an accept state. Does this mean it accepts everything? Or could you have it only accept "a" and not "b". I guess I don't understand if not having an arrow out... | finite automata combinatorics | 1 | Number of DFAs of only one state -- (finite automata combinatorics)
<p>If I have a DFA with only one state that is not an accept state, it accepts only the empty set.</p>

<p>I get confused when if the DFA of one state is an accept state. Does this mean it accepts everything? Or could you have it only accept "a... | habedi/stack-exchange-dataset |
47,442 | What is a partially sorted array? | <p>I come across this definition but it's not so clear for me !</p>

<blockquote>
 <p>An array is partially sorted if the number of inversions is less or
 equal a constant times the array length. if array length is N then
 (number of inversions) <= c*N, with c constant.</p>
</blockquote>&#... | terminology algorithm analysis sorting arrays | 1 | What is a partially sorted array? -- (terminology algorithm analysis sorting arrays)
<p>I come across this definition but it's not so clear for me !</p>

<blockquote>
 <p>An array is partially sorted if the number of inversions is less or
 equal a constant times the array length. if array length is N ... | habedi/stack-exchange-dataset |
47,448 | Maximum entropy probability distribution among Solomonoff priors | <p>If we take Solomonoff's prior $m$, defined <a href="http://www.scholarpedia.org/article/Algorithmic_probability#Discrete_Universal_A_Priori_Probability" rel="nofollow">here</a> and normalize it we get a probability mass function on all finite words.
But, the pmf isn't completely determined until we fix a univers... | turing machines probability theory entropy | 1 | Maximum entropy probability distribution among Solomonoff priors -- (turing machines probability theory entropy)
<p>If we take Solomonoff's prior $m$, defined <a href="http://www.scholarpedia.org/article/Algorithmic_probability#Discrete_Universal_A_Priori_Probability" rel="nofollow">here</a> and normalize it we get a p... | habedi/stack-exchange-dataset |
47,453 | Why not use large $k$ in a $k$-ary tree? | <p>Obviously binary trees are great because of $O(\log_2 n)$ search, inserts, and deletes in best case.</p>

<p>To "maximize" occurrence of best case, we can use self-balancing trees like red-black trees, AVLs, splay trees, etc.</p>

<p>If we use a $k$-ary tree, we can get $O(\log_k n)$ searches, insert... | trees search trees balanced search trees | 1 | Why not use large $k$ in a $k$-ary tree? -- (trees search trees balanced search trees)
<p>Obviously binary trees are great because of $O(\log_2 n)$ search, inserts, and deletes in best case.</p>

<p>To "maximize" occurrence of best case, we can use self-balancing trees like red-black trees, AVLs, splay trees, e... | habedi/stack-exchange-dataset |
47,469 | Proof that circuit design problem is NP-hard | <p>I have the following problem, and I want to show that it is NP-hard (or NP-complete).</p>

<p>Consider a clause which can have OR and XOR relationship between literals, e.g. $c_1=y_1 \lor y_2 \lor (y_3\oplus y_4)$. Will the assignment of literals such that the equation given by the conjunction of such clause... | np complete reductions 3 sat | 1 | Proof that circuit design problem is NP-hard -- (np complete reductions 3 sat)
<p>I have the following problem, and I want to show that it is NP-hard (or NP-complete).</p>

<p>Consider a clause which can have OR and XOR relationship between literals, e.g. $c_1=y_1 \lor y_2 \lor (y_3\oplus y_4)$. Will the assign... | habedi/stack-exchange-dataset |
47,474 | Evolving artificial neural networks for solving NP problems | <p>I've recently read a really interesting blog entry from Google Research Blog talking about neural network. Basically they use this neural networks for solving various problems like image recognition. They use genetic algorithms to "evolve" the weights of the axons. </p>

<p>So basically my idea is the follow... | machine learning np neural networks p vs np genetic algorithms | 1 | Evolving artificial neural networks for solving NP problems -- (machine learning np neural networks p vs np genetic algorithms)
<p>I've recently read a really interesting blog entry from Google Research Blog talking about neural network. Basically they use this neural networks for solving various problems like image re... | habedi/stack-exchange-dataset |
47,478 | Can starvation occur with interrupts? | <p>The Computer Science text book I own describes how an interrupt is handled in an operating system:</p>

<ul>
<li>At some point at the end of an instruction the processor checks if there are any outstanding interrupts</li>
<li>If there are, the priority of the present task is compared with the highest... | operating systems | 1 | Can starvation occur with interrupts? -- (operating systems)
<p>The Computer Science text book I own describes how an interrupt is handled in an operating system:</p>

<ul>
<li>At some point at the end of an instruction the processor checks if there are any outstanding interrupts</li>
<li>If there are, ... | habedi/stack-exchange-dataset |
47,483 | Why does a graph traversal algorithm is initialised with visited[s]←true | <p>I just had a course on algorithm, we just started to study graph traversal. the teacher wrote analgorithm but I think there is a mistake:
I'm a bit shy so I didn't asked her why so...</p>

<pre><code>EXPLORE (s:sommet, D:dictionnary of the following vertexes or ahed of vertexes,
var visited:tab)
... | algorithms graphs graph traversal | 1 | Why does a graph traversal algorithm is initialised with visited[s]←true -- (algorithms graphs graph traversal)
<p>I just had a course on algorithm, we just started to study graph traversal. the teacher wrote analgorithm but I think there is a mistake:
I'm a bit shy so I didn't asked her why so...</p>

<pre... | habedi/stack-exchange-dataset |
47,490 | "Archiving" byte sequence into human-readable set of chars | <p>Ok, lets assume we have sequence of 1000 bytes.
So the possible number of value variations is 2^100.</p>

<p>Is there a way to "index" each variation with letters and decimal numbers (A-Z, 0-9), having as shortest length as possible? </p>

<p>So the person can dictate sequence of letters and n... | complexity theory combinatorics combinatory logic | 1 | "Archiving" byte sequence into human-readable set of chars -- (complexity theory combinatorics combinatory logic)
<p>Ok, lets assume we have sequence of 1000 bytes.
So the possible number of value variations is 2^100.</p>

<p>Is there a way to "index" each variation with letters and decimal numbers (A-Z,... | habedi/stack-exchange-dataset |
47,498 | Hardcore Bit proof for discrete log | <p>I am studying Crypto and am trying to understand why discrete log creates is useful for creating a PRG. More specifically, I want to prove via reduction that $B(x)=(x<p/2)$ is a hardcore bit for the one-way function $f_{p,g}(x)=g^x \bmod p$. So far, I have shown that if there is a polynomial-time algorithm $D$ t... | cryptography pseudo random generators one way functions | 1 | Hardcore Bit proof for discrete log -- (cryptography pseudo random generators one way functions)
<p>I am studying Crypto and am trying to understand why discrete log creates is useful for creating a PRG. More specifically, I want to prove via reduction that $B(x)=(x<p/2)$ is a hardcore bit for the one-way function ... | habedi/stack-exchange-dataset |
47,502 | Computing probability of sentence using N-grams | <p>I have implemented N-grams by constructing a tree (or a trie, technically) that stores frequencies of each N-gram. Each path in the tree represents an N-gram and its frequency: the path consists of N nodes (each node containing a word), followed by a leaf node containing the frequency. So, each path in the tree is o... | natural language processing | 1 | Computing probability of sentence using N-grams -- (natural language processing)
<p>I have implemented N-grams by constructing a tree (or a trie, technically) that stores frequencies of each N-gram. Each path in the tree represents an N-gram and its frequency: the path consists of N nodes (each node containing a word),... | habedi/stack-exchange-dataset |
47,506 | NP-hardness of a scheduling problem | <p><strong><em>Problem:</em></strong> Given an undirected, weighted, complete graph $G = (V, E, w, c)$. $w$ is the <em>time weight</em> function on edges, $w:E \to \mathbb{N}^{+}$; $w(e)$ represents the time it takes to travel along edge $e$. $c$ is the <em>time deadline</em> function on vertices, $c:V \to \mathbb{N}^{... | algorithms complexity theory reference request np complete scheduling | 1 | NP-hardness of a scheduling problem -- (algorithms complexity theory reference request np complete scheduling)
<p><strong><em>Problem:</em></strong> Given an undirected, weighted, complete graph $G = (V, E, w, c)$. $w$ is the <em>time weight</em> function on edges, $w:E \to \mathbb{N}^{+}$; $w(e)$ represents the time i... | habedi/stack-exchange-dataset |
47,514 | What is the complexity of an in-place merge algorithm for forward iterators | <p>I have written an in-place merge algorithm for forward iterators. My goal was to write an in-place merge algorithm to merge two sorted parts of a singly linked list without allocating extra memory to perform the merge. However, I have no clue how to determine its complexity.</p>

<p>Here is the corresponding... | algorithm analysis runtime analysis | 1 | What is the complexity of an in-place merge algorithm for forward iterators -- (algorithm analysis runtime analysis)
<p>I have written an in-place merge algorithm for forward iterators. My goal was to write an in-place merge algorithm to merge two sorted parts of a singly linked list without allocating extra memory to ... | habedi/stack-exchange-dataset |
47,519 | Why does $2^{O(\log n)} = n^{O(1)}$ hold? | <p>I was recently looking at the article on the <a href="https://en.wikipedia.org/wiki/P_%28complexity%29" rel="nofollow">P complexity class on Wikipedia</a>. In the section on relationships to other classes, it mentions that P is known to be at least as large as L, giving this explanation:</p>

<blockquote>&#x... | asymptotics landau notation | 1 | Why does $2^{O(\log n)} = n^{O(1)}$ hold? -- (asymptotics landau notation)
<p>I was recently looking at the article on the <a href="https://en.wikipedia.org/wiki/P_%28complexity%29" rel="nofollow">P complexity class on Wikipedia</a>. In the section on relationships to other classes, it mentions that P is known to be at... | habedi/stack-exchange-dataset |
47,525 | How to prove for that a given non-regular language its given super-set is also non-regular? | <p>Consider the non-regular language $L_1$ = {$a^n$b$a^n$: $n \geq 0$} and its super-set language </p>

<p>L = Language of strings with equal number of trailing and leading a's,</p>

<p>or in other words,</p>

<p>$$L = \{a^n b w b a^n : n \ge 0, w \in \{a,b\}^*\} \cup \{a^n b a^n : n \ge 0\}.$$... | formal languages regular languages | 1 | How to prove for that a given non-regular language its given super-set is also non-regular? -- (formal languages regular languages)
<p>Consider the non-regular language $L_1$ = {$a^n$b$a^n$: $n \geq 0$} and its super-set language </p>

<p>L = Language of strings with equal number of trailing and leading a's,</... | habedi/stack-exchange-dataset |
47,533 | If a Ptime function loses x bits of data at every call, is it a one way function? | <p>If we have a computational function $f(x)=g(f(x-1)^2)$, where $g(y)$ is a floating point operation, mapped onto a given number of bits say 32 bits (thus leading to loss of a given number of precision bits every time), is the function a one-way function?</p>
 | cryptography one way functions | 1 | If a Ptime function loses x bits of data at every call, is it a one way function? -- (cryptography one way functions)
<p>If we have a computational function $f(x)=g(f(x-1)^2)$, where $g(y)$ is a floating point operation, mapped onto a given number of bits say 32 bits (thus leading to loss of a given number of precision... | habedi/stack-exchange-dataset |
47,539 | Why are so many internet protocols text-based? | <p>From what I have found, a <strong>very</strong> large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP, SMTP, FTP (I think this one is all text-based?), WHOIS, IRC.</p>
<p>In fact, some of these protoco... | computer networks communication protocols protocols | 1 | Why are so many internet protocols text-based? -- (computer networks communication protocols protocols)
<p>From what I have found, a <strong>very</strong> large amount of protocols that travel over the internet are "text-based" rather than binary. The protocols in question include, but are not limited to HTTP... | habedi/stack-exchange-dataset |
47,551 | Arden's rule expressed as matrix algebra | <blockquote>
 <p>The following theorem is (in the context of languages) known as
 Arden's Lemma: Given a linear system $X = B+AX$ and the matrix A is
 quasiregular, then we have a solution which is unique and which
 preserves rationality. In the next lemma we show the converse: For
 every ratio... | regular languages combinatorics matrices | 1 | Arden's rule expressed as matrix algebra -- (regular languages combinatorics matrices)
<blockquote>
 <p>The following theorem is (in the context of languages) known as
 Arden's Lemma: Given a linear system $X = B+AX$ and the matrix A is
 quasiregular, then we have a solution which is unique and which
... | habedi/stack-exchange-dataset |
47,554 | Can every state in a DFA be an accepting state? | <p>I know that we can have 0 accepting states in a DFA, it would just recognize the empty language. What about the case of all states being accepting? Would that mean it would recognize all of the strings in the DFA's particular alphabet?</p>

<p>Thanks</p>
 | finite automata | 1 | Can every state in a DFA be an accepting state? -- (finite automata)
<p>I know that we can have 0 accepting states in a DFA, it would just recognize the empty language. What about the case of all states being accepting? Would that mean it would recognize all of the strings in the DFA's particular alphabet?</p>

... | habedi/stack-exchange-dataset |
47,556 | Given a set of irregular polygons finding a set of vertices (one on each polygon) such that distance between points is maximized | <p>Given a set of irregular polygons with the same number of points, where $polygon_i$ is completely contained within the boundary of $polygon_{(i+1)} $.</p>

<p>I need to find a set of vertices (one vertex from each polygon) such that the pairwise distances between all of the points selected are maximized.</p>... | algorithms computational geometry | 1 | Given a set of irregular polygons finding a set of vertices (one on each polygon) such that distance between points is maximized -- (algorithms computational geometry)
<p>Given a set of irregular polygons with the same number of points, where $polygon_i$ is completely contained within the boundary of $polygon_{(i+1)} $... | habedi/stack-exchange-dataset |
47,561 | Confused about proof that $\log(n!) = \Theta(n \log n)$ | <p>So I was able to show that:</p>

<p>$\log(n!) = O(n\log n)$ without any problems.</p>

<p>My question is when trying to prove that $\log (n!) = \Omega(n\log n)$.</p>

<p>I was able to show that:<br>
$$\begin{align*}
\log n! &= \log(1 \cdot 2 \cdot 3 \cdots n )\\ 
&= \log... | asymptotics | 1 | Confused about proof that $\log(n!) = \Theta(n \log n)$ -- (asymptotics)
<p>So I was able to show that:</p>

<p>$\log(n!) = O(n\log n)$ without any problems.</p>

<p>My question is when trying to prove that $\log (n!) = \Omega(n\log n)$.</p>

<p>I was able to show that:<br>
$$\begin{align*}&... | habedi/stack-exchange-dataset |
47,565 | What does Djikstra mean by "formal techniques" in this essay? | <p>In <a href="http://www.cs.utexas.edu/%7EEWD/transcriptions/EWD09xx/EWD913.html" rel="nofollow noreferrer">this</a> essay (and others) by Djikstra, he refers to "formal techniques" a number of times.</p>
<blockquote>
<p>... for the computing scientist, formal techniques would play a much more import... | history | 1 | What does Djikstra mean by "formal techniques" in this essay? -- (history)
<p>In <a href="http://www.cs.utexas.edu/%7EEWD/transcriptions/EWD09xx/EWD913.html" rel="nofollow noreferrer">this</a> essay (and others) by Djikstra, he refers to "formal techniques" a number of times.</p>
<blockquote>
<p>... f... | habedi/stack-exchange-dataset |
47,576 | What does a square mean in a Boolean formula | <p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow">PDF</a>) and I would like to know what the square symbol... | satisfiability | 1 | What does a square mean in a Boolean formula -- (satisfiability)
<p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="n... | habedi/stack-exchange-dataset |
47,578 | What are the definitions for "hard problem" and "easy problem"? | <p>Take for example the following sentence:</p>

<blockquote>
 <p>Computing a hash for a message is "easy"; retrieving the message from the hash is "hard".</p>
</blockquote>

<p>Intuitively, I can perfectly understand what's written there. But, <strong>in mathematical terms</strong>, when is a ... | time complexity complexity classes | 1 | What are the definitions for "hard problem" and "easy problem"? -- (time complexity complexity classes)
<p>Take for example the following sentence:</p>

<blockquote>
 <p>Computing a hash for a message is "easy"; retrieving the message from the hash is "hard".</p>
</blockquote>

<p>Intuitively, ... | habedi/stack-exchange-dataset |
47,589 | Connected Graph: Select the minimum number of nodes such that the node and neighbor covers everything | <p>The problem is to select the minimum number of nodes from a graph such that, the selected nodes and their neighbors consists of all the nodes of the graph.</p>

<p>Any straight forward algorithm for this?
Repeatedly selecting the node with highest degree centrality doesn't work.</p>

<p>Thank you... | graphs | 1 | Connected Graph: Select the minimum number of nodes such that the node and neighbor covers everything -- (graphs)
<p>The problem is to select the minimum number of nodes from a graph such that, the selected nodes and their neighbors consists of all the nodes of the graph.</p>

<p>Any straight forward algorithm ... | habedi/stack-exchange-dataset |
47,596 | DFS vs. Union Find for computing connected components of a static graph | <p>According to CLRS,</p>

<blockquote>
 <p>When the edges of the graph are static—not changing over time—we can
 compute the connected components faster by using depth-first search.</p>
</blockquote>

<p>However, I tried to do some runtime analysis, and in a graph $G(V, E)$ on which we ha... | graphs runtime analysis | 1 | DFS vs. Union Find for computing connected components of a static graph -- (graphs runtime analysis)
<p>According to CLRS,</p>

<blockquote>
 <p>When the edges of the graph are static—not changing over time—we can
 compute the connected components faster by using depth-first search.</p>
</blockquo... | habedi/stack-exchange-dataset |
47,604 | What is the point of an active shape model in facial recognition? | <p>From what I understood, the Active Shape Model (ASM) is used in facial recognition. I figured out how the ASM works but I don't get why we use it.</p>

<p>How this shape is suppose to be interpreted for facial recognition? Should it be compared directly to the database?</p>

<p>I have read many resea... | algorithms computer vision | 1 | What is the point of an active shape model in facial recognition? -- (algorithms computer vision)
<p>From what I understood, the Active Shape Model (ASM) is used in facial recognition. I figured out how the ASM works but I don't get why we use it.</p>

<p>How this shape is suppose to be interpreted for facial r... | habedi/stack-exchange-dataset |
47,607 | Measuring the hardness of SAT instances Lemma | <p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow">PDF</a>).I have two questions the first one is I would l... | satisfiability | 1 | Measuring the hardness of SAT instances Lemma -- (satisfiability)
<p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="... | habedi/stack-exchange-dataset |
47,611 | Recursive function problem | <p>This might seem very simple but it's been giving me lots of headaches.</p>

<p>For example if I run f(12345) the result is 5310135.</p>

<p>I understand why it would return 5310, the rest of 135 is what is giving me troubles. Sorry if the question sounds dumb, I am a newbie seeking for help:).</p>&#x... | algorithms recursion | 1 | Recursive function problem -- (algorithms recursion)
<p>This might seem very simple but it's been giving me lots of headaches.</p>

<p>For example if I run f(12345) the result is 5310135.</p>

<p>I understand why it would return 5310, the rest of 135 is what is giving me troubles. Sorry if the question ... | habedi/stack-exchange-dataset |
47,636 | What is the appropriate means of bias field in image processing? | <p>I want to do image segmentation. In (Li, C. et al, 2011) article about A Level Set Method for Image Segmentation I saw that the authors use bias field estimation. I searched a lot but I couldn't understand the meaning of bias field...What is the appropriate mean of bias field?</p>
 | image processing | 1 | What is the appropriate means of bias field in image processing? -- (image processing)
<p>I want to do image segmentation. In (Li, C. et al, 2011) article about A Level Set Method for Image Segmentation I saw that the authors use bias field estimation. I searched a lot but I couldn't understand the meaning of bias fiel... | habedi/stack-exchange-dataset |
47,642 | Does this Turing Machine M decide the language of polynomials? | <p>Does this Turing Machine decide
language of polynomials with integer coefficients which have integer roots:
The input represents a polynomial over variables x1, . . . , xn with integer coefficients.<br>
1. Examine all possible integer values of x1, . . . , xn.<br>
2. Evaluate the polynomial on all of... | computability turing machines | 1 | Does this Turing Machine M decide the language of polynomials? -- (computability turing machines)
<p>Does this Turing Machine decide
language of polynomials with integer coefficients which have integer roots:
The input represents a polynomial over variables x1, . . . , xn with integer coefficients.<br>
1. E... | habedi/stack-exchange-dataset |
47,647 | What happens if we expand the alphabet of a given Turing Machine? | <p><a href="https://i.stack.imgur.com/5Is1A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Is1A.png" alt="Turing Machine M"></a></p>

<p>If we expanded the alphabet Sigma = { 0, 1, u, > } to Sigma' = { 0, 1, 2, u, > }. How would the table change? We're just learning about Turing Mach... | computability turing machines | 1 | What happens if we expand the alphabet of a given Turing Machine? -- (computability turing machines)
<p><a href="https://i.stack.imgur.com/5Is1A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5Is1A.png" alt="Turing Machine M"></a></p>

<p>If we expanded the alphabet Sigma = { 0, 1, u, > } to... | habedi/stack-exchange-dataset |
47,653 | Why does an admissible heuristic mean A* is optimal? | <p>An admissible heuristic never overestimates the cost to reach the goal. <strong>However</strong>, isn't that only the relative difference between heuristics for two different paths matter? </p>

<p>Say we have optimal path A (cost 100 to reach goal) and sub-optimal path Z (cost 120 to reach goal). Even if th... | search artificial intelligence | 1 | Why does an admissible heuristic mean A* is optimal? -- (search artificial intelligence)
<p>An admissible heuristic never overestimates the cost to reach the goal. <strong>However</strong>, isn't that only the relative difference between heuristics for two different paths matter? </p>

<p>Say we have optimal pa... | habedi/stack-exchange-dataset |
47,665 | Is something missing in this EXPLORE algorithm? | <p>It took me about a week to understand how does it works, but still, I'm wondering if it actually works!</p>

<h1>I. The algorithm EXPLORE</h1>

<pre><code>EXPLORE (S:sommet, D:following vertices of vertex X, visited:TAB)
var LIST;
i,j:vertices
visited[S] ←true;
LIST ←{S};
WHILE LI... | algorithms | 1 | Is something missing in this EXPLORE algorithm? -- (algorithms)
<p>It took me about a week to understand how does it works, but still, I'm wondering if it actually works!</p>

<h1>I. The algorithm EXPLORE</h1>

<pre><code>EXPLORE (S:sommet, D:following vertices of vertex X, visited:TAB)
var LIST;&#x... | habedi/stack-exchange-dataset |
47,677 | Scientific soundness of computer science papers | <p>First of all, this question relates to an issue that affects several areas of science, but since StackExchange doesn't have a meta science section I'll make it specific to computer science, which is pertinent because the solution to the bigger problem may actually come from computer science.</p>

<p>In the c... | machine learning semantics natural language processing | 1 | Scientific soundness of computer science papers -- (machine learning semantics natural language processing)
<p>First of all, this question relates to an issue that affects several areas of science, but since StackExchange doesn't have a meta science section I'll make it specific to computer science, which is pertinent ... | habedi/stack-exchange-dataset |
47,681 | The Space of an Unsatisfiable Formula | <p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow noreferrer">PDF</a>). I am trying to understand the demon... | satisfiability | 1 | The Space of an Unsatisfiable Formula -- (satisfiability)
<p>I am reading the paper <em>Measuring the hardness of SAT instances</em> by Ansótegui, Bonet, Levy and Manyà (Proc. 23rd AAAI Conf. on AI, pp. 222–228, 2008) (<a href="https://www.aaai.org/Papers/AAAI/2008/AAAI08-035.pdf" rel="nofollow... | habedi/stack-exchange-dataset |
47,686 | Simulating continuous time semi-Markov state machine and changing transition probability on the fly | <p>The problem that I'm trying to solve (well, I think that I almost did, but need a review from someone more experienced) is about changing probability of the transition for semi-Markov state machine during simulation.</p>

<p>Let's assume that <code>M=<S,T></code> defines machine with <code>S</code> sta... | probability theory simulation markov chains | 1 | Simulating continuous time semi-Markov state machine and changing transition probability on the fly -- (probability theory simulation markov chains)
<p>The problem that I'm trying to solve (well, I think that I almost did, but need a review from someone more experienced) is about changing probability of the transition ... | habedi/stack-exchange-dataset |
47,694 | Algorithm for generating coprime number sequences? | <p>Does anyone know of an algorithm to generate a set of numbers of size $N$ which are all co-prime to eachother?</p>

<p>Ideally I'm looking for something that has random access abilities so i could ask for the 100th item in the set without having to first calculate items 0 to 99.</p>

<p>Also, I would... | sets primes | 1 | Algorithm for generating coprime number sequences? -- (sets primes)
<p>Does anyone know of an algorithm to generate a set of numbers of size $N$ which are all co-prime to eachother?</p>

<p>Ideally I'm looking for something that has random access abilities so i could ask for the 100th item in the set without ha... | habedi/stack-exchange-dataset |
47,697 | Understanding Closest Pair Algorithm (CLRS) | <p>I'm reading CLRS Section <code>33.4 Finding the closest pair of points</code>. At exercise 
<code>33.4-2</code> they say</p>

<blockquote>
 <p><strong>33.4-2</strong></p>
 
 <p>Show that it actually suffices to check only the points in the 5 array positions following each point in the arra... | algorithms computational geometry divide and conquer | 1 | Understanding Closest Pair Algorithm (CLRS) -- (algorithms computational geometry divide and conquer)
<p>I'm reading CLRS Section <code>33.4 Finding the closest pair of points</code>. At exercise 
<code>33.4-2</code> they say</p>

<blockquote>
 <p><strong>33.4-2</strong></p>
 
 <p>Show that i... | habedi/stack-exchange-dataset |
47,698 | Complexity of special instance of Knapsack | <p>Consider the following algorithmic task:</p>

<p>Given: primes $p_1,\dots,p_k$, and positive integers $e_1,\dots,e_k$, and a positive integer $M$<br>
Find: integers $d_1,\dots,d_k$ that maximize $\prod_i p_i^{d_i}$, subject to the requirements that $0 \le d_i \le e_i$ and $\prod_i p_i^{d_i} \le M$.</p>&#... | algorithms optimization np hard | 1 | Complexity of special instance of Knapsack -- (algorithms optimization np hard)
<p>Consider the following algorithmic task:</p>

<p>Given: primes $p_1,\dots,p_k$, and positive integers $e_1,\dots,e_k$, and a positive integer $M$<br>
Find: integers $d_1,\dots,d_k$ that maximize $\prod_i p_i^{d_i}$, subject t... | habedi/stack-exchange-dataset |
47,700 | $k$th Largest Algorithm in a range $[k, k+c]$ | <p>The well-known algorithm for computing the $k$-th largest element in an unsorted array of size $n$ runs in $O(n)$ time. </p>

<p>How about for a range $[k, k+c]$, where $c$ is not necessarily independent of $n, k$? The obvious "brute-force" algorithm is to find the $k$th largest using the original $O(n)$-tim... | algorithms selection problem | 1 | $k$th Largest Algorithm in a range $[k, k+c]$ -- (algorithms selection problem)
<p>The well-known algorithm for computing the $k$-th largest element in an unsorted array of size $n$ runs in $O(n)$ time. </p>

<p>How about for a range $[k, k+c]$, where $c$ is not necessarily independent of $n, k$? The obvious "b... | habedi/stack-exchange-dataset |
47,704 | How to reduce this regular expression? | <p>I was converting a DFA to regular expression with the help of state equations and came up with this regular expression. How do I further reduce this regular expression?
$$b+aaa^*b+abb^*+a$$
I can feel it's same as $$a^*b+ab^*$$ but how do I proceed to simplify the first one to the second mathematically?</p>&... | regular expressions | 1 | How to reduce this regular expression? -- (regular expressions)
<p>I was converting a DFA to regular expression with the help of state equations and came up with this regular expression. How do I further reduce this regular expression?
$$b+aaa^*b+abb^*+a$$
I can feel it's same as $$a^*b+ab^*$$ but how do I proc... | habedi/stack-exchange-dataset |
47,707 | Kolmogorov complexity of strings in a given language | <p>Consider the language</p>

<p>$$L = \{1^i 0^j 1^k \mid i + j = 2k, k ≥ 1\}\,,$$</p>

<p>and let $x_n$ be the canonical $n$'th word in $L$. My problem involves proving that the Kolmogorov complexity of $x_n$ can be bounded by</p>

<p>$$K(x_n) \leq c + 2\log_2 |x_n|$$</p>

<p>for some c... | complexity theory kolmogorov complexity | 1 | Kolmogorov complexity of strings in a given language -- (complexity theory kolmogorov complexity)
<p>Consider the language</p>

<p>$$L = \{1^i 0^j 1^k \mid i + j = 2k, k ≥ 1\}\,,$$</p>

<p>and let $x_n$ be the canonical $n$'th word in $L$. My problem involves proving that the Kolmogorov complexity of $x... | habedi/stack-exchange-dataset |
47,708 | What is token-type in Lexical analysis? | <p>I'm currently studying compiler construction book "Compilers Principles, Techniques, and Tools (2nd Edition)" , in page <a href="https://books.google.com.pk/books?id=kLVv4MSa7EUC&pg=PA113&lpg=PA113&dq=%3Cid,%20pointer%20to%20symbol-table%20entry%20for%20M%3E%20%3Cmult%20op%3E%20%3Cid,%20pointer%20to%20sy... | terminology compilers lexical analysis | 1 | What is token-type in Lexical analysis? -- (terminology compilers lexical analysis)
<p>I'm currently studying compiler construction book "Compilers Principles, Techniques, and Tools (2nd Edition)" , in page <a href="https://books.google.com.pk/books?id=kLVv4MSa7EUC&pg=PA113&lpg=PA113&dq=%3Cid,%20pointer%20t... | habedi/stack-exchange-dataset |
47,712 | Why can humans solve certain "undecidable" problems? | <p>High-order pattern matching is an undecidable problem. That means there is no algorithm that, given an equation <code>a => b</code>, where <code>a</code> and <code>b</code> are open terms on the simply typed lambda calculus, finds a substitution <code>S</code> such that <code>aS => bS</code>, where <code>=>... | computability philosophy computer vs human | 1 | Why can humans solve certain "undecidable" problems? -- (computability philosophy computer vs human)
<p>High-order pattern matching is an undecidable problem. That means there is no algorithm that, given an equation <code>a => b</code>, where <code>a</code> and <code>b</code> are open terms on the simply typed lambd... | habedi/stack-exchange-dataset |
47,722 | Is chess game movement TM decidable? | <p>If we have a finite chess board and two figures x and y. Is it possible to get y from x by following chess rules and when white is y and white starts from y placement. Is this decidable? </p>

<p>My reasoning is, that we have a finite sets of moves and since all finite languages are decidable and at some po... | turing machines automata undecidability decision problem | 1 | Is chess game movement TM decidable? -- (turing machines automata undecidability decision problem)
<p>If we have a finite chess board and two figures x and y. Is it possible to get y from x by following chess rules and when white is y and white starts from y placement. Is this decidable? </p>

<p>My reasoning i... | habedi/stack-exchange-dataset |
47,729 | Algorithm for finding two smallest numbers in an array | <p>I was just thinking today that the best approach to find two smallest numbers in any array would be to first sort(ascending order) it with some efficient algorithm like <code>Quicksort</code>(Average case complexity: <code>nlogn</code>) and then access the first two members of the array in <code>O(1)</code>.</p>
... | algorithms search problem selection problem | 1 | Algorithm for finding two smallest numbers in an array -- (algorithms search problem selection problem)
<p>I was just thinking today that the best approach to find two smallest numbers in any array would be to first sort(ascending order) it with some efficient algorithm like <code>Quicksort</code>(Average case complexi... | habedi/stack-exchange-dataset |
47,747 | A factoring conversion | <p>There was a comment <a href="https://cstheory.stackexchange.com/questions/2274/permanents-approximation-and-connection-to-integer-factorization">here</a> that " It is possible in principle to reduce the factorization of a $256$-bit number (which is computable in TFNP) to the Permanent on a matrix of dimension $N\tim... | factoring | 1 | A factoring conversion -- (factoring)
<p>There was a comment <a href="https://cstheory.stackexchange.com/questions/2274/permanents-approximation-and-connection-to-integer-factorization">here</a> that " It is possible in principle to reduce the factorization of a $256$-bit number (which is computable in TFNP) to the Per... | habedi/stack-exchange-dataset |
47,754 | Priority inversion in Hoare and Mesa monitors | <p>I understand the difference between Hoare and Mesa monitors. However I don't understand why priority inversion (when a lower priority process gets done before a higher priority process) is possible in the Hoare type but not possible in the Mesa type. Can someone explain this?</p>
 | operating systems synchronization real time | 1 | Priority inversion in Hoare and Mesa monitors -- (operating systems synchronization real time)
<p>I understand the difference between Hoare and Mesa monitors. However I don't understand why priority inversion (when a lower priority process gets done before a higher priority process) is possible in the Hoare type but no... | habedi/stack-exchange-dataset |
47,755 | DFS traversal: explanation required | <p>I am studying about DFS these days from the book "Algorithm Design" by Jon Kleinberg. Here a DFS algo is given which is as follows:</p>

<pre><code>DFS(s):
 Initialize S to be a stack with one element s
 While S is not empty
 Take a node u from S
 If Explored[u] = false th... | algorithm analysis | 1 | DFS traversal: explanation required -- (algorithm analysis)
<p>I am studying about DFS these days from the book "Algorithm Design" by Jon Kleinberg. Here a DFS algo is given which is as follows:</p>

<pre><code>DFS(s):
 Initialize S to be a stack with one element s
 While S is not empty
 ... | habedi/stack-exchange-dataset |
47,758 | Sum of products of n-tuples | <p>Let's say I have an array of numbers {a,b,c,d,e} and want to calculate the sum of product of all triples abc+abd+...+cde.
I can calculate it very fast without generating all triples using this formula<br>
F(n,k)= k*F(n-1, k-1)+ F(n-1, k) with two loops</p>

<pre><code> int[] values={a, b, c, d,... | algorithms | 1 | Sum of products of n-tuples -- (algorithms)
<p>Let's say I have an array of numbers {a,b,c,d,e} and want to calculate the sum of product of all triples abc+abd+...+cde.
I can calculate it very fast without generating all triples using this formula<br>
F(n,k)= k*F(n-1, k-1)+ F(n-1, k) with two loops</p>

... | habedi/stack-exchange-dataset |
47,760 | Is sierpenski's triangle considered to be a computational model? | <p>I was reading about <strong>sierpenski's triangle</strong> and i found that it is similar to <strong>pascal's Triangle</strong>, which can show coefficients in binomial expansion, also <a href="http://mathworld.wolfram.com/Rule90.html" rel="nofollow">rule 90</a> from ECA.</p>

<p>If Sierpenski's triangle ca... | algorithms complexity theory computability | 1 | Is sierpenski's triangle considered to be a computational model? -- (algorithms complexity theory computability)
<p>I was reading about <strong>sierpenski's triangle</strong> and i found that it is similar to <strong>pascal's Triangle</strong>, which can show coefficients in binomial expansion, also <a href="http://ma... | habedi/stack-exchange-dataset |
47,771 | A list of n strings lexicographic order using the merge-sort algorithm. The worst case running time of this computation is | <p>A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is __________.</p>

<ol>
<li>$O(n log n)$</li>
<li>$O(n^2 log n)$</li>
<li>$O(n^2 +log n)$</li>
<li>$O(n^2)$</li>
</ol>

<hr>&#... | algorithm analysis runtime analysis sorting | 1 | A list of n strings lexicographic order using the merge-sort algorithm. The worst case running time of this computation is -- (algorithm analysis runtime analysis sorting)
<p>A list of n strings, each of length n, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this com... | habedi/stack-exchange-dataset |
47,775 | Encrypting a 180-bit plaintext into a 180 bit ciphertext with a 128-bit block cipher | <p>I have a field in my data store which must take exactly 180 bits of information. Some users will choose to make this data encrypted, some won't, so some of those 180 bit fields will be ciphertext some will be plaintext. A boolean will indicate which one the user is using. The important thing here is that I need this... | cryptography | 1 | Encrypting a 180-bit plaintext into a 180 bit ciphertext with a 128-bit block cipher -- (cryptography)
<p>I have a field in my data store which must take exactly 180 bits of information. Some users will choose to make this data encrypted, some won't, so some of those 180 bit fields will be ciphertext some will be plain... | habedi/stack-exchange-dataset |
47,777 | What is the maximum number of classes resulting from partitioning by DFA as function of number of states? | <p>I was wondering whether it is possible (and if so, then how) to tell what is the maximum number of equivalence classes generated by a DFA as per Myhill-Nerode theorem (assuming it has no redundant transitions) as a function of number of accepting and rejecting states and cardinality of its alphabet. </p>

<... | automata finite automata | 1 | What is the maximum number of classes resulting from partitioning by DFA as function of number of states? -- (automata finite automata)
<p>I was wondering whether it is possible (and if so, then how) to tell what is the maximum number of equivalence classes generated by a DFA as per Myhill-Nerode theorem (assuming it h... | habedi/stack-exchange-dataset |
47,788 | Hex Bit Pattern to IEEE 754 standard Floating Point Number | <p>The question asks for the decimal number that 0x0C000000 represents if it is a floating number. I'm not too sure on how to approach this, but here's my thought process:</p>

<p>0x0C000000 = 0000 1100 0000 0000 0000 0000 0000 0000</p>

<p>The first digit is 0, so it's positive. The exponent is
 0x... | computer architecture floating point number formats | 1 | Hex Bit Pattern to IEEE 754 standard Floating Point Number -- (computer architecture floating point number formats)
<p>The question asks for the decimal number that 0x0C000000 represents if it is a floating number. I'm not too sure on how to approach this, but here's my thought process:</p>

<p>0x0C000000 = 000... | habedi/stack-exchange-dataset |
47,798 | Adder circuit with sign bit (not twos complement) | <p>I've found and implemented a full adder to be able to do unsigned or two's complement addition on wikipedia:
<a href="https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder" rel="nofollow">https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder</a></p>

<p>However, in my particular case, I'd l... | arithmetic digital circuits | 1 | Adder circuit with sign bit (not twos complement) -- (arithmetic digital circuits)
<p>I've found and implemented a full adder to be able to do unsigned or two's complement addition on wikipedia:
<a href="https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder" rel="nofollow">https://en.wikipedia.org/wiki/Adder... | habedi/stack-exchange-dataset |
47,799 | What's the time complexity of this algorithm? And Why? | <p>I am stuck by analyzing the time complexity of the following algorithm:</p>

<pre><code>def fun (r, k, d, p):
 if d > p:
 return r
 if d = 0 and p = 0:
 r <- r + k
 return r
 if d > 0:
 fun (r, k + 1, d - 1, p)
 if p > 0:
... | algorithm analysis runtime analysis | 1 | What's the time complexity of this algorithm? And Why? -- (algorithm analysis runtime analysis)
<p>I am stuck by analyzing the time complexity of the following algorithm:</p>

<pre><code>def fun (r, k, d, p):
 if d > p:
 return r
 if d = 0 and p = 0:
 r <- r + k
 ... | habedi/stack-exchange-dataset |
47,803 | How to check the ability to satisfy demand? | <p>We have Stocks in several discrete positions, let say:</p>

<pre><code>A B C
40 20 80
</code></pre>

<p>And Demand, which may be satisfied by one or more Stock positions (if no specified then it would accept any Stock).</p>

<p>Demand for A=20 may be satisfied from A Stock onl... | algorithms approximation | 1 | How to check the ability to satisfy demand? -- (algorithms approximation)
<p>We have Stocks in several discrete positions, let say:</p>

<pre><code>A B C
40 20 80
</code></pre>

<p>And Demand, which may be satisfied by one or more Stock positions (if no specified then it would accept any... | habedi/stack-exchange-dataset |
47,818 | Minimal number of comparisons - sorting $6$ elements | <p>I've been thinking about sorting $6$ elements with the minimal possible number of comparisons. I can do it in $10$ comparisons but I've no idea if this is optimal. Or is there a better algorithm ? </p>

<p><strong>Algorithm</strong><br>
1. Sort $a_1, a_2, a_3$ and $a_4, a_5, a_6$.<br>
Number of comp... | algorithms sorting lower bounds | 1 | Minimal number of comparisons - sorting $6$ elements -- (algorithms sorting lower bounds)
<p>I've been thinking about sorting $6$ elements with the minimal possible number of comparisons. I can do it in $10$ comparisons but I've no idea if this is optimal. Or is there a better algorithm ? </p>

<p><strong>Algo... | habedi/stack-exchange-dataset |
47,821 | lower bound of checking if in array are two different elements | <p>Considering the lower limit to the problem of checking whether the array are only the same number via comparisons. And thnik about $ n-1 $.
Consider the diagram hasse. This diagram must be consistent (one piece), so you need at least $ n-1 $ edges (comparisons),.</p>

<p>However, I would like to consider... | arrays lower bounds | 1 | lower bound of checking if in array are two different elements -- (arrays lower bounds)
<p>Considering the lower limit to the problem of checking whether the array are only the same number via comparisons. And thnik about $ n-1 $.
Consider the diagram hasse. This diagram must be consistent (one piece), so you need ... | habedi/stack-exchange-dataset |
47,823 | Balanced weight distribution in buckets, with different weight per bucket | <p>Is this problem a know variant of the optimisation version of the bin packing problem? There is an approximating algorithm for it?</p>
<blockquote>
<p>Let <span class="math-container">$A = \{a_1,a_2,...a_n\}$</span> be a set of items, <span class="math-container">$B = \{b_1,b_2,...b_m\}$</span> be a set of b... | optimization packing | 1 | Balanced weight distribution in buckets, with different weight per bucket -- (optimization packing)
<p>Is this problem a know variant of the optimisation version of the bin packing problem? There is an approximating algorithm for it?</p>
<blockquote>
<p>Let <span class="math-container">$A = \{a_1,a_2,...a_n\}$<... | habedi/stack-exchange-dataset |
47,824 | Root Color of a Black Red Tree | <p>It is required that, in a black red tree, the color for the root is always black. However, wikipedia argues that this rule can be omitted as a red root can always be changed to black but not vice versa. I get the first half, that a red root can be changed to black at any time, but in what circumstance is it impossib... | sorting balanced search trees | 1 | Root Color of a Black Red Tree -- (sorting balanced search trees)
<p>It is required that, in a black red tree, the color for the root is always black. However, wikipedia argues that this rule can be omitted as a red root can always be changed to black but not vice versa. I get the first half, that a red root can be cha... | habedi/stack-exchange-dataset |
47,831 | Selection algorithm variant for an array | <p>Have a problem that's a variant of the linear time selection algorithm of a randomized array that I'm struggling with.</p>
<blockquote>
<p>Let <span class="math-container">$A = A[1], ..., A[n]$</span> be an array of <span class="math-container">$n \ge 4$</span> distinct keys.</p>
<p>Describe an <em>effic... | algorithms asymptotics partial order selection problem | 1 | Selection algorithm variant for an array -- (algorithms asymptotics partial order selection problem)
<p>Have a problem that's a variant of the linear time selection algorithm of a randomized array that I'm struggling with.</p>
<blockquote>
<p>Let <span class="math-container">$A = A[1], ..., A[n]$</span> be an a... | habedi/stack-exchange-dataset |
47,833 | Computing mod inverse? | <p>How might one compute $4^{-1} \mod 17$ I know the answer is 13. I'm just not sure how to arrive at that number, and can't find any good explanations. Any help would be great </p>
 | modular arithmetic | 1 | Computing mod inverse? -- (modular arithmetic)
<p>How might one compute $4^{-1} \mod 17$ I know the answer is 13. I'm just not sure how to arrive at that number, and can't find any good explanations. Any help would be great </p>
 | habedi/stack-exchange-dataset |
47,835 | Can a regular expression be infinite? | <p>I know that languages which can be defined using regular expressions and those recognisable by DFA/NFA ( finite automata ) are equivalent. Also no DFA exists for the language $\{0^n1^n|n \ge 0\}$. But still it can be written using regular expressions ( for that matter any non-regular language can be ) as $\{ \epsi... | formal languages regular languages regular expressions | 1 | Can a regular expression be infinite? -- (formal languages regular languages regular expressions)
<p>I know that languages which can be defined using regular expressions and those recognisable by DFA/NFA ( finite automata ) are equivalent. Also no DFA exists for the language $\{0^n1^n|n \ge 0\}$. But still it can be ... | habedi/stack-exchange-dataset |
47,842 | I know Binary Search is more efficient than Ternary search, but my results are opposite. Help interpreting results? | <p>I have a piece of code that applies recursive Binary and Ternary searches on sorted arrays of increasing size, i.e. 500, 1000, 2000, 4000, etc. The entire code segment is about 200 lines so I've been forced to upload it to Pastebin which you can find <a href="http://pastebin.com/zkJ0kBpm" rel="nofollow">here.</a> Wh... | algorithm analysis binary search | 1 | I know Binary Search is more efficient than Ternary search, but my results are opposite. Help interpreting results? -- (algorithm analysis binary search)
<p>I have a piece of code that applies recursive Binary and Ternary searches on sorted arrays of increasing size, i.e. 500, 1000, 2000, 4000, etc. The entire code seg... | habedi/stack-exchange-dataset |
47,846 | Ways to perform "batch" Approximate Member Queries efficiently | <p>In this problem, I'm first given <code>n</code> number of values which I have to store in a space efficient manner. Then I'm given <code>m</code> number of values which I have to check if they were added to the data structure before (such that after the operation, I know which value was a member, and which weren't).... | data structures approximation probabilistic algorithms bloom filters | 1 | Ways to perform "batch" Approximate Member Queries efficiently -- (data structures approximation probabilistic algorithms bloom filters)
<p>In this problem, I'm first given <code>n</code> number of values which I have to store in a space efficient manner. Then I'm given <code>m</code> number of values which I have to c... | habedi/stack-exchange-dataset |
47,849 | A variation of the baseball elimination problem | <p>I suppose you are all familiar with the baseball elimination problem (it is about determining whether some team with particular number of points can finish in the first place, when there are still such and such games to be played by other teams). </p>

<p>The rules there are rather simple - the winner gets a... | graphs max flow | 1 | A variation of the baseball elimination problem -- (graphs max flow)
<p>I suppose you are all familiar with the baseball elimination problem (it is about determining whether some team with particular number of points can finish in the first place, when there are still such and such games to be played by other teams). <... | habedi/stack-exchange-dataset |
47,865 | Finding median of three sorted array (the same length) | <p>I think about following problem:<br>
There are given three sorted arrays $A,B,C$ (each of them is length $n$).<br>
Every array has distinct elements.
Find median of union $A,B,C$. </p>

<p>I consider following approach:<br>
Let's consider $A_i, B_i, C_i$, where $i=n/2$. There are six cases -... | arrays search problem binary search | 1 | Finding median of three sorted array (the same length) -- (arrays search problem binary search)
<p>I think about following problem:<br>
There are given three sorted arrays $A,B,C$ (each of them is length $n$).<br>
Every array has distinct elements.
Find median of union $A,B,C$. </p>

<p>I consider ... | habedi/stack-exchange-dataset |
47,867 | Subset sum algorithms, their time complexity | <p>The algorithm is in Python. Seems correct to me, ideas how to prove it? And what would be its time complexity?</p>

<pre><code>from bisect import bisect

# Implements the decision version of subset sum.
# The subset sum problem: given a set and a number find a subset of the set which sums to the ... | algorithms algorithm analysis | 1 | Subset sum algorithms, their time complexity -- (algorithms algorithm analysis)
<p>The algorithm is in Python. Seems correct to me, ideas how to prove it? And what would be its time complexity?</p>

<pre><code>from bisect import bisect

# Implements the decision version of subset sum.
# The subset s... | habedi/stack-exchange-dataset |
47,869 | Can NP-Hard be converted to NP? | <p>I get that all problems in NP can be reduced in polynomial time to some NP-Hard problem. An NP-Hard problem is also supposed to be harder or at least as hard as any NP problem.</p>

<p>Can an NP-Hard problem be reduced to an NP problem, which is not already an NP-Complete problem?</p>

<p>Also, are N... | np complete np hard complexity classes np | 1 | Can NP-Hard be converted to NP? -- (np complete np hard complexity classes np)
<p>I get that all problems in NP can be reduced in polynomial time to some NP-Hard problem. An NP-Hard problem is also supposed to be harder or at least as hard as any NP problem.</p>

<p>Can an NP-Hard problem be reduced to an NP pr... | habedi/stack-exchange-dataset |
47,873 | What's the formal definition of Big-O notation for functions of more than one variable? | <p>For functions of a single totally ordered variable, I already know that $f(n)$ is $O(g(n))$ if and only if $\exists m. \exists c. \forall n. (n \ge m) \rightarrow [ f(n) \le c \cdot g(n) ]$.</p>

<p>What I don't know is the meaning of $O(g(n_1, n_2 \dots n_k))$ for $k > 1$ totally ordered variables. What'... | asymptotics landau notation | 1 | What's the formal definition of Big-O notation for functions of more than one variable? -- (asymptotics landau notation)
<p>For functions of a single totally ordered variable, I already know that $f(n)$ is $O(g(n))$ if and only if $\exists m. \exists c. \forall n. (n \ge m) \rightarrow [ f(n) \le c \cdot g(n) ]$.</p>&#... | habedi/stack-exchange-dataset |
47,879 | Alternative graph data structures | <p>Are there any graph implementation data structures beyond the standard adjacency list/matrix ones? If so, what are they?</p>

<p>I welcome experimental ones as well as highly specialized ones.</p>

<p>A little background: I'm developing an algorithm that relies heavily on graph operations, so I'm doi... | graphs data structures | 1 | Alternative graph data structures -- (graphs data structures)
<p>Are there any graph implementation data structures beyond the standard adjacency list/matrix ones? If so, what are they?</p>

<p>I welcome experimental ones as well as highly specialized ones.</p>

<p>A little background: I'm developing an... | habedi/stack-exchange-dataset |
47,880 | Direct conversion from regular expression to MSO | <p>A language $L \subseteq \Sigma^*$ can be described by a regular expression iff it can be defined by a formula in monadic second order with words as structure $(\{0, \dots, n-1\}, <, (P_a)_{a \in \Sigma})$. The proof I know is an indirection construction over automata, i.e. we show that DFAs and regular expression... | regular languages logic regular expressions | 1 | Direct conversion from regular expression to MSO -- (regular languages logic regular expressions)
<p>A language $L \subseteq \Sigma^*$ can be described by a regular expression iff it can be defined by a formula in monadic second order with words as structure $(\{0, \dots, n-1\}, <, (P_a)_{a \in \Sigma})$. The proof ... | habedi/stack-exchange-dataset |
47,881 | Total number of edges in the graph | <p>Consider a <code>directed</code> graph with nodes <code>{1,2,3...n}</code> and include an edge <code>(i,j)</code> whenever <code>i<j</code>.</p>

<p>According to me, it should be <code>n(n-1)/2</code> but the book says it's nC2(combinations).</p>
 | graphs | 1 | Total number of edges in the graph -- (graphs)
<p>Consider a <code>directed</code> graph with nodes <code>{1,2,3...n}</code> and include an edge <code>(i,j)</code> whenever <code>i<j</code>.</p>

<p>According to me, it should be <code>n(n-1)/2</code> but the book says it's nC2(combinations).</p>
 | habedi/stack-exchange-dataset |
47,887 | Can context-free grammar generate $a^{2^n}$? | <p>Context-free grammar can generate the string a 2 n for n≥0 .</p>

<p>The production rule P is S→SS|a .</p>

<p>The derivations is, for example:</p>

<p>1) S⇒a (this is when n = 0)</p>

<p>2) S⇒SS⇒aa (this is when n = 1)</p>

<p>3) S⇒SS⇒SSSS⇒aaaa (this is when n = 2)</p>&... | formal languages context free formal grammars | 1 | Can context-free grammar generate $a^{2^n}$? -- (formal languages context free formal grammars)
<p>Context-free grammar can generate the string a 2 n for n≥0 .</p>

<p>The production rule P is S→SS|a .</p>

<p>The derivations is, for example:</p>

<p>1) S⇒a (this is when n = 0)</p>

... | habedi/stack-exchange-dataset |
47,890 | Hardness of a special GAP-CLIQUE problem | <p>In the GAP-CLIQUE$(k,\ell)$ problem, we are given a graph $G$ over $n$ vertices and have to decide whether $G$ contains a clique of size $k$ or no clique of size $\ell$. Using a PCP system, it can be shown that GAP-CLIQUE$(k,\varepsilon k)$ is NP-hard for any positive constant $\varepsilon$ less or equal to $1$. In ... | np hard approximation clique | 1 | Hardness of a special GAP-CLIQUE problem -- (np hard approximation clique)
<p>In the GAP-CLIQUE$(k,\ell)$ problem, we are given a graph $G$ over $n$ vertices and have to decide whether $G$ contains a clique of size $k$ or no clique of size $\ell$. Using a PCP system, it can be shown that GAP-CLIQUE$(k,\varepsilon k)$ i... | habedi/stack-exchange-dataset |
47,892 | implementation of queue using stack with REVERSE | <blockquote>
 <p>Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions.</p>
</blockquote>

<hr>

<p>I'm looking for implementation of queue where ENQUEUE takes a sequence of three instructi... | data structures stacks | 1 | implementation of queue using stack with REVERSE -- (data structures stacks)
<blockquote>
 <p>Suppose a stack implementation supports an instruction REVERSE, which reverses the order of elements on the stack, in addition to the PUSH and POP instructions.</p>
</blockquote>

<hr>

<p>I'm looking ... | habedi/stack-exchange-dataset |
47,893 | What does $CS - CF$ means? | <p>What does $L_1 \in CS - CF$ means?</p>

<p>I think the meaning is $L_1$ can be generated by context-sensitive grammars, but cannot be generated by context-free grammars. </p>

<p>Am I understanding this correctly? Just to be sure.</p>
 | formal languages notation | 1 | What does $CS - CF$ means? -- (formal languages notation)
<p>What does $L_1 \in CS - CF$ means?</p>

<p>I think the meaning is $L_1$ can be generated by context-sensitive grammars, but cannot be generated by context-free grammars. </p>

<p>Am I understanding this correctly? Just to be sure.</p>
 | habedi/stack-exchange-dataset |
47,896 | Comparing two graphs | <p>I want to compare the vertices of two graphs. Given two graphs, $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$, I want to compare $u_n$ and $v_m$ for $u \in V_1$ and $v \in V_2$. I came up with double loops for doing this:</p>

<pre><code>for all u in G1
 for all v in G2
 if u.label == v.label then&#x... | algorithms graphs lower bounds | 1 | Comparing two graphs -- (algorithms graphs lower bounds)
<p>I want to compare the vertices of two graphs. Given two graphs, $G_1 = (V_1, E_1)$ and $G_2 = (V_2, E_2)$, I want to compare $u_n$ and $v_m$ for $u \in V_1$ and $v \in V_2$. I came up with double loops for doing this:</p>

<pre><code>for all u in G1&#x... | habedi/stack-exchange-dataset |
47,901 | Schedule tasks from a weighted list with time frame constraints | <p>I'm attempting to create an automatic scheduler from a list of tasks I have available. Here are the key points:</p>

<ul>
<li>Each task has been given a priority beforehand and the algorithm should try to maximize the total 'priority points' it can get from the tasks it schedules.</li>
<li>There shou... | algorithms scheduling | 1 | Schedule tasks from a weighted list with time frame constraints -- (algorithms scheduling)
<p>I'm attempting to create an automatic scheduler from a list of tasks I have available. Here are the key points:</p>

<ul>
<li>Each task has been given a priority beforehand and the algorithm should try to maximize ... | habedi/stack-exchange-dataset |
47,902 | How powerful is a k-stack pushdown automaton with a unary stack alphabet? | <p>I'm interested in pushdown automata with a unary stack alphabet: let's call them UPDA's. Define a $k$-UPDA to be a pushdown automaton with $k$ stacks, each with a unary stack alphabet.</p>

<p>I've figured out that a $k$-UPDA is at least as powerful as a $(k-1)$-PDA (see proof at the end). This implies that... | formal languages computability pushdown automata | 1 | How powerful is a k-stack pushdown automaton with a unary stack alphabet? -- (formal languages computability pushdown automata)
<p>I'm interested in pushdown automata with a unary stack alphabet: let's call them UPDA's. Define a $k$-UPDA to be a pushdown automaton with $k$ stacks, each with a unary stack alphabet.</p>... | habedi/stack-exchange-dataset |
47,913 | Complexity for finding a ball that maximizes the number of points lying in it | <p>Given a set of points $x_1, \ldots, x_n \in \mathbb{R}^2$ and a radius $r$. Which is the complexity of finding the point with higher number of points at a distance smaller than $r$. E.g the one that maximizes $\sum_{i=1}^n \mathbb{1}_{\|x - x_i\| \leq r}$?</p>

<p>A brute force algorithm would be to go over ... | algorithms complexity theory computational geometry | 1 | Complexity for finding a ball that maximizes the number of points lying in it -- (algorithms complexity theory computational geometry)
<p>Given a set of points $x_1, \ldots, x_n \in \mathbb{R}^2$ and a radius $r$. Which is the complexity of finding the point with higher number of points at a distance smaller than $r$. ... | habedi/stack-exchange-dataset |
47,916 | Binomial coefficient to approach multi-way choices DP problem? | <p>I'm trying to understand this dynamic programming related problem, adapted from Kleinberg's Algorithm Design book. Not homework: i've already a solution, just considering if i'm ok with the theory. </p>

<blockquote>
 <p>Suppose we want to replicate a file over a collection of $n$ servers $S_1, S_2
... | dynamic programming | 1 | Binomial coefficient to approach multi-way choices DP problem? -- (dynamic programming)
<p>I'm trying to understand this dynamic programming related problem, adapted from Kleinberg's Algorithm Design book. Not homework: i've already a solution, just considering if i'm ok with the theory. </p>

<blockquote>
... | habedi/stack-exchange-dataset |
47,918 | Why is a deterministic Turing machine a special case of a probabilistic Turing machine? | <p>I have no formal training in computer science as I have not yet taken any such classes, so perhaps this question appears naive. I was reading about BPP and it was claimed that a deterministic Turing machine is a special case of a probabilistic Turing machine. I don't understand why this is. </p>
 | turing machines | 1 | Why is a deterministic Turing machine a special case of a probabilistic Turing machine? -- (turing machines)
<p>I have no formal training in computer science as I have not yet taken any such classes, so perhaps this question appears naive. I was reading about BPP and it was claimed that a deterministic Turing machine ... | habedi/stack-exchange-dataset |
47,926 | Difficulty understanding pre-emptive vs non-preemptive CPU scheduling | <p>I'm having difficulty understanding what my book is trying to say in regards to preemptive and non-preemptive CPU scheduling.</p>

<p>It says the following:</p>

<blockquote>
 <p>CPU Scheduling decisions may take place under the following four
 circumstances:</p>
 
 <ol>
 <li... | operating systems process scheduling cpu | 1 | Difficulty understanding pre-emptive vs non-preemptive CPU scheduling -- (operating systems process scheduling cpu)
<p>I'm having difficulty understanding what my book is trying to say in regards to preemptive and non-preemptive CPU scheduling.</p>

<p>It says the following:</p>

<blockquote>
 <p>C... | habedi/stack-exchange-dataset |
47,942 | Can quantum computer become perfect chess player? | <p>Can quantum computer become perfect chess player?</p>

<p>Can it determine whether (when both players are perfect) win white or black? (or is it dead heat?)</p>
 | quantum computing | 1 | Can quantum computer become perfect chess player? -- (quantum computing)
<p>Can quantum computer become perfect chess player?</p>

<p>Can it determine whether (when both players are perfect) win white or black? (or is it dead heat?)</p>
 | habedi/stack-exchange-dataset |
47,945 | Kleene star differences | <p>We have languages $A= \{a\}$ and $B = \{b\}$. If we consider $(A\cup B)^*$, where ${}^*$ means Kleene star, we have a set of words like $\{\lambda, a,b,aa,ab,aaa,\dots\}$, where $\lambda$ is the empty word. Another example we do is $A^*(BA^*)^*$. If we concatenate two languages, $\lambda$ will not be in the set, but... | formal languages regular languages kleene star | 1 | Kleene star differences -- (formal languages regular languages kleene star)
<p>We have languages $A= \{a\}$ and $B = \{b\}$. If we consider $(A\cup B)^*$, where ${}^*$ means Kleene star, we have a set of words like $\{\lambda, a,b,aa,ab,aaa,\dots\}$, where $\lambda$ is the empty word. Another example we do is $A^*(BA^*... | habedi/stack-exchange-dataset |
47,955 | Negation of 8-bit hexadecimal | <p>I am looking for a mathematical formula / algorithm to find the negation of a 8-bit hexadecimal without having to expand into a binary form. </p>

<p>E.g; </p>

<p>0000BDDA -> 48602</p>

<p>FFFF4226 -> -48602</p>

<p>Need to get from 0000BDDA -> FFFF4226 without 2' complements / expan... | discrete mathematics | 1 | Negation of 8-bit hexadecimal -- (discrete mathematics)
<p>I am looking for a mathematical formula / algorithm to find the negation of a 8-bit hexadecimal without having to expand into a binary form. </p>

<p>E.g; </p>

<p>0000BDDA -> 48602</p>

<p>FFFF4226 -> -48602</p>

<p>Need to get ... | habedi/stack-exchange-dataset |
47,961 | Big-O Notation Statement True? | <p>Considering functions f and g, is the following true? </p>

<p>$ (f \in O(g)) \implies (f \in \Theta(g)) \lor (f \in o(g))$</p>

<p>If not, can you please state an example? Despite thinking hard, i could not find one.</p>

<p>Thanks a lot!</p>
 | asymptotics landau notation | 1 | Big-O Notation Statement True? -- (asymptotics landau notation)
<p>Considering functions f and g, is the following true? </p>

<p>$ (f \in O(g)) \implies (f \in \Theta(g)) \lor (f \in o(g))$</p>

<p>If not, can you please state an example? Despite thinking hard, i could not find one.</p>

<p>Tha... | habedi/stack-exchange-dataset |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.