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
56,419
Are these languages are regular?
<blockquote>&#xA; <p>Consider the languages $L_1, L_2 \subseteq \sum^*$, where $\sum=\{a,b,c\}$. Define</p>&#xA; &#xA; <p>$$L_1/L_2 = \{x : \exists y \in L_2\ such\ that\ xy \in L_1 \}$$</p>&#xA; &#xA; <p>Let $L_1 = \{a^nb^nc^{2n}: n \ge 0\}$ and $L_2 = \{b^nc^{2n}: n \ge 0\}$.</p>&#xA; &#xA; <p>Justify whether ...
automata
1
Are these languages are regular? -- (automata) <blockquote>&#xA; <p>Consider the languages $L_1, L_2 \subseteq \sum^*$, where $\sum=\{a,b,c\}$. Define</p>&#xA; &#xA; <p>$$L_1/L_2 = \{x : \exists y \in L_2\ such\ that\ xy \in L_1 \}$$</p>&#xA; &#xA; <p>Let $L_1 = \{a^nb^nc^{2n}: n \ge 0\}$ and $L_2 = \{b^nc^{2n}: n...
habedi/stack-exchange-dataset
56,424
Difference between DPDA and NPDA?
<p>What are the major differences between Deterministic Push Down Automata and Non-deterministic Push Down Automata? Which one is faster and how? Also what are the drawbacks of DPDA with respect to NPDA. &#xA;Can anyone quote an example and explain these concepts.</p>&#xA;
automata pushdown automata
1
Difference between DPDA and NPDA? -- (automata pushdown automata) <p>What are the major differences between Deterministic Push Down Automata and Non-deterministic Push Down Automata? Which one is faster and how? Also what are the drawbacks of DPDA with respect to NPDA. &#xA;Can anyone quote an example and explain these...
habedi/stack-exchange-dataset
56,428
Facts about internal and external path lengths of binary tree
<p>While learning binary tree's properties, I came across <a href="http://mathworld.wolfram.com/InternalPathLength.html" rel="nofollow">internal path length</a> and <a href="http://mathworld.wolfram.com/ExternalPathLength.html" rel="nofollow">external path length</a>, number of comparisons required for successful and u...
graphs trees binary trees binary search trees
1
Facts about internal and external path lengths of binary tree -- (graphs trees binary trees binary search trees) <p>While learning binary tree's properties, I came across <a href="http://mathworld.wolfram.com/InternalPathLength.html" rel="nofollow">internal path length</a> and <a href="http://mathworld.wolfram.com/Exte...
habedi/stack-exchange-dataset
56,429
Can we say that Zookeeper updates are ACD (ACID without the I)?
<p>Zookeeper is based on the <a href="http://portal.acm.org/citation.cfm?id=1529978" rel="nofollow">Zab</a> (which is <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos" rel="nofollow">slightly different to Paxos</a>) system. </p>&#xA;&#xA;<p><a href="https://martin.kleppmann.com/2016/02/08/ho...
distributed systems
1
Can we say that Zookeeper updates are ACD (ACID without the I)? -- (distributed systems) <p>Zookeeper is based on the <a href="http://portal.acm.org/citation.cfm?id=1529978" rel="nofollow">Zab</a> (which is <a href="https://cwiki.apache.org/confluence/display/ZOOKEEPER/Zab+vs.+Paxos" rel="nofollow">slightly different t...
habedi/stack-exchange-dataset
56,431
show that special case of NP-complete problem is also NP-complete?
<p>I want to show that a problem is NP-hard by reducing a known NP-complete problem to it. However, I will have to use a special case of the NP-complete problem for the reduction to work. I'm pretty sure that the special case version is also NP-complete but I have no idea how to prove that. Are there any general guidel...
np complete reductions decision problem
1
show that special case of NP-complete problem is also NP-complete? -- (np complete reductions decision problem) <p>I want to show that a problem is NP-hard by reducing a known NP-complete problem to it. However, I will have to use a special case of the NP-complete problem for the reduction to work. I'm pretty sure that...
habedi/stack-exchange-dataset
56,432
removing ε production
<p>It's not that i dont know how to remove εproduction but when complex problem arises i get confused for example</p>&#xA;&#xA;<p>S-->Aa/aaB</p>&#xA;&#xA;<p>A-->a/ε</p>&#xA;&#xA;<p>B-->bbA/ε</p>&#xA;&#xA;<p>CFG without ε production for the above question is</p>&#xA;&#xA;<p>S-->Aa/aaB/a/aa</p>&#xA;&#xA;<p>A-->a</p>&#xA;...
context free
1
removing ε production -- (context free) <p>It's not that i dont know how to remove εproduction but when complex problem arises i get confused for example</p>&#xA;&#xA;<p>S-->Aa/aaB</p>&#xA;&#xA;<p>A-->a/ε</p>&#xA;&#xA;<p>B-->bbA/ε</p>&#xA;&#xA;<p>CFG without ε production for the above question is</p>&#xA;&#xA;<p>S-->Aa...
habedi/stack-exchange-dataset
56,441
clarification about first for cfg
<p>S-->ABCDE</p>&#xA;&#xA;<p>A-->a/ε</p>&#xA;&#xA;<p>B-->b/ε</p>&#xA;&#xA;<p>C-->c</p>&#xA;&#xA;<p>D-->d/ε</p>&#xA;&#xA;<p>E-->e/ε</p>&#xA;&#xA;<p>i have solved first for above question but a little clarification is required</p>&#xA;&#xA;<p>first(S)=</p>&#xA;&#xA;<p>first(A)=a/ε</p>&#xA;&#xA;<p>first(B)=b/ε</p>&#xA;&#...
context free
1
clarification about first for cfg -- (context free) <p>S-->ABCDE</p>&#xA;&#xA;<p>A-->a/ε</p>&#xA;&#xA;<p>B-->b/ε</p>&#xA;&#xA;<p>C-->c</p>&#xA;&#xA;<p>D-->d/ε</p>&#xA;&#xA;<p>E-->e/ε</p>&#xA;&#xA;<p>i have solved first for above question but a little clarification is required</p>&#xA;&#xA;<p>first(S)=</p>&#xA;&#xA;<p>...
habedi/stack-exchange-dataset
56,453
Prove whether this problem is decidable or undecidable
<p>So I am reviewing my notes for this problem, and I cant seem to understand how this problem works. Say we have M, and M accepts an input that makes it visit every non-halting state.</p>&#xA;&#xA;<p>I convinced myself that this problem is decidable, but I am having trouble proving so. A rough outline of my answer wou...
computability turing machines undecidability rice theorem
1
Prove whether this problem is decidable or undecidable -- (computability turing machines undecidability rice theorem) <p>So I am reviewing my notes for this problem, and I cant seem to understand how this problem works. Say we have M, and M accepts an input that makes it visit every non-halting state.</p>&#xA;&#xA;<p>I...
habedi/stack-exchange-dataset
56,454
Whatever that can be done using algorithm can be done using Turing machine
<p>In 1937 how was Alan Turing so sure that all that can be done using algorithms can be implemented using a Turing machine?&#xA;Since that period many new algorithms were implemented. What was his hypothesis behind this theory ?</p>&#xA;
computability turing machines church turing thesis
1
Whatever that can be done using algorithm can be done using Turing machine -- (computability turing machines church turing thesis) <p>In 1937 how was Alan Turing so sure that all that can be done using algorithms can be implemented using a Turing machine?&#xA;Since that period many new algorithms were implemented. What...
habedi/stack-exchange-dataset
56,462
How to understand pushdown automata intuitively?
<p>What is an intuitive way of understanding what a push down automaton is capable of computing?</p>&#xA;
pushdown automata
1
How to understand pushdown automata intuitively? -- (pushdown automata) <p>What is an intuitive way of understanding what a push down automaton is capable of computing?</p>&#xA;
habedi/stack-exchange-dataset
56,466
Orderability of Belief States in a POMDP?
<p>Consider a POMDP with integer states $1,2,\ldots,N$, where $N$ is finite. We thus have a complete order over the states.</p>&#xA;&#xA;<p>It seems reasonable to think that belief states for this POMDP may be orderable in some partial order sense. </p>&#xA;&#xA;<p>Does this orderability translate into any structure of...
dynamic programming markov chains
1
Orderability of Belief States in a POMDP? -- (dynamic programming markov chains) <p>Consider a POMDP with integer states $1,2,\ldots,N$, where $N$ is finite. We thus have a complete order over the states.</p>&#xA;&#xA;<p>It seems reasonable to think that belief states for this POMDP may be orderable in some partial ord...
habedi/stack-exchange-dataset
56,472
Turing tests and humans
<p>How are the questions framed in Turing tests? I mean what factors would one consider before framing questionnaire for the Turing Test.How the questions should be framed to make the test unbiased for a machine and humans?</p>&#xA;
turing machines machine learning artificial intelligence turing test
1
Turing tests and humans -- (turing machines machine learning artificial intelligence turing test) <p>How are the questions framed in Turing tests? I mean what factors would one consider before framing questionnaire for the Turing Test.How the questions should be framed to make the test unbiased for a machine and humans...
habedi/stack-exchange-dataset
56,478
JIT, AOT, Interpretation: What are differences between them?
<p>I'm a beginner in Compilation. &#xA;My understanding is that Interpretation means Interpreter takes source program as input and produce the result of this program.(source -> Interpreter -> run on the machine) Compilation means Compiler take source program as input and the front-end translate them into intermediate r...
compilers
1
JIT, AOT, Interpretation: What are differences between them? -- (compilers) <p>I'm a beginner in Compilation. &#xA;My understanding is that Interpretation means Interpreter takes source program as input and produce the result of this program.(source -> Interpreter -> run on the machine) Compilation means Compiler take ...
habedi/stack-exchange-dataset
56,480
Transitivity of concat comparison
<p>I am trying to solve the problem of finding the permutation, amongst all possible ones, of an array of strings, where the concatenation of them compares smallest lexicographically. I solve it with an sort with the following comparison</p>&#xA;&#xA;<pre><code>def concat_cmp(x, y):&#xA; return cmp(x + y, y + x)&#xA...
sorting strings permutations
1
Transitivity of concat comparison -- (sorting strings permutations) <p>I am trying to solve the problem of finding the permutation, amongst all possible ones, of an array of strings, where the concatenation of them compares smallest lexicographically. I solve it with an sort with the following comparison</p>&#xA;&#xA;<...
habedi/stack-exchange-dataset
56,483
Hash function which is invariant under small changes
<p>I am looking for a hash function which is invariant under small changes.</p>&#xA;&#xA;<p>E.g., if I have two strings <code>MyString</code> and <code>MySttring</code> which slightly differ, their hash values should only differ slightly as well.</p>&#xA;&#xA;<p>Actually, this is the opposite of the normal concept of a...
algorithms cryptography hash hashing
1
Hash function which is invariant under small changes -- (algorithms cryptography hash hashing) <p>I am looking for a hash function which is invariant under small changes.</p>&#xA;&#xA;<p>E.g., if I have two strings <code>MyString</code> and <code>MySttring</code> which slightly differ, their hash values should only dif...
habedi/stack-exchange-dataset
56,486
Finding MST after adding a new vertex
<blockquote>&#xA; <p>Let $G=(V,E)$ which is undirected and simple. We also have $T$, an MST of $G$. We add a vertex $v$ to the graph and connect it with weighted edges to <em>some</em> of the vertices. Find a new MST for the new graph in $O(|V|\cdot \log |V|)$.</p>&#xA;</blockquote>&#xA;&#xA;<p>Basically, the idea is ...
spanning trees minimum spanning tree prims algorithm
1
Finding MST after adding a new vertex -- (spanning trees minimum spanning tree prims algorithm) <blockquote>&#xA; <p>Let $G=(V,E)$ which is undirected and simple. We also have $T$, an MST of $G$. We add a vertex $v$ to the graph and connect it with weighted edges to <em>some</em> of the vertices. Find a new MST for th...
habedi/stack-exchange-dataset
56,489
Recursive definition of Matrix
<p>Like Linked-list for Array, is there a recursive counter-part for Matrix?</p>&#xA;&#xA;<p>Is there a persistent data structure which can be used in place of Matrix in pure functional language like Haskell?</p>&#xA;
functional programming matrices linked lists
1
Recursive definition of Matrix -- (functional programming matrices linked lists) <p>Like Linked-list for Array, is there a recursive counter-part for Matrix?</p>&#xA;&#xA;<p>Is there a persistent data structure which can be used in place of Matrix in pure functional language like Haskell?</p>&#xA;
habedi/stack-exchange-dataset
56,491
Algorithm for grouping identical neighbors in a list
<p>I have a list that I want to reduce to a smaller list by grouping identical neighbors. This list has many many redundant entries. </p>&#xA;&#xA;<p>Example list:</p>&#xA;&#xA;<pre><code>1,1,1,1,1,2,2,2,3,3,1,1,1,2,2,2,2,2,2,2,2,2,4,4,4,4,1,1,1,1,1,1&#xA;</code></pre>&#xA;&#xA;<p>After 'compression'</p>&#xA;&#xA;<pre>...
algorithms time complexity data compression lists
1
Algorithm for grouping identical neighbors in a list -- (algorithms time complexity data compression lists) <p>I have a list that I want to reduce to a smaller list by grouping identical neighbors. This list has many many redundant entries. </p>&#xA;&#xA;<p>Example list:</p>&#xA;&#xA;<pre><code>1,1,1,1,1,2,2,2,3,3,1,1,...
habedi/stack-exchange-dataset
56,494
What are logical addresses and where do they actually reside?
<p>While studying about <em>memory management</em>, <em>paging</em> and <em>segmentation</em> there is a lot of usage of phrases like <code>CPU generates logical addresses</code> and <code>logical addresses are converted to physical addresses</code> etc. I know that the term physical address refers to actual RAM, but I...
operating systems memory management virtual memory paging
1
What are logical addresses and where do they actually reside? -- (operating systems memory management virtual memory paging) <p>While studying about <em>memory management</em>, <em>paging</em> and <em>segmentation</em> there is a lot of usage of phrases like <code>CPU generates logical addresses</code> and <code>logica...
habedi/stack-exchange-dataset
56,495
If O(log n) vs O(n) is exponential what is O(1) vs O(n)?
<p>If one refers to using an <code>O(log n)</code> instead of an <code>O(n)</code> algorithm as an exponential speedup, &#xA;how would one refer the speedup gained by using an <code>O(1)</code> algorithm vs an <code>O(n)</code>?</p>&#xA;
complexity theory terminology
1
If O(log n) vs O(n) is exponential what is O(1) vs O(n)? -- (complexity theory terminology) <p>If one refers to using an <code>O(log n)</code> instead of an <code>O(n)</code> algorithm as an exponential speedup, &#xA;how would one refer the speedup gained by using an <code>O(1)</code> algorithm vs an <code>O(n)</code>?...
habedi/stack-exchange-dataset
56,503
Algorithm to find a path connecting given nodes in a graph
<p>Suppose I have $n$ nodes in a graph and I identify $x$ nodes in the graph (where $x &lt; n$). I would like to find a path to connect all those $x$ nodes I have identified. Is there any algorithm for such a scenario?</p>&#xA;
algorithms graphs shortest path
1
Algorithm to find a path connecting given nodes in a graph -- (algorithms graphs shortest path) <p>Suppose I have $n$ nodes in a graph and I identify $x$ nodes in the graph (where $x &lt; n$). I would like to find a path to connect all those $x$ nodes I have identified. Is there any algorithm for such a scenario?</p>&#...
habedi/stack-exchange-dataset
56,504
Efficient algorithm for finding weakly connected components
<p>We recently studied Tarjan's algorithm at school, which finds all strongly connected components of a given graph. I was curious however how one would find all <em>weakly</em> connected components (I had to search a bit to actually find the term).</p>&#xA;&#xA;<p>The most obvious solution would be to do a BFS or DFS ...
algorithms graphs efficiency graph traversal
1
Efficient algorithm for finding weakly connected components -- (algorithms graphs efficiency graph traversal) <p>We recently studied Tarjan's algorithm at school, which finds all strongly connected components of a given graph. I was curious however how one would find all <em>weakly</em> connected components (I had to s...
habedi/stack-exchange-dataset
56,517
What is an addressable cell size?
<p>This question started with a quiz question from my university:&#xA;Consider a big-endian computer system with an addressable cell size of one byte. The values in memory cells 372 to 375 are shown in the table below. What 16-bit two's complement value (expressed as a decimal number) is stored at address 374?</p>&#xA;...
memory access
1
What is an addressable cell size? -- (memory access) <p>This question started with a quiz question from my university:&#xA;Consider a big-endian computer system with an addressable cell size of one byte. The values in memory cells 372 to 375 are shown in the table below. What 16-bit two's complement value (expressed as...
habedi/stack-exchange-dataset
56,522
What is the relation between First Order Logic and First Order Theory?
<p>I thought that any FOT is a subset of FOL, but that does not seem to be the case, because FOL is complete (every formula is either valid or invalid), while some FOT (like linear integer arithmetic) is not complete.</p>&#xA;&#xA;<p>So, is FOL more expressive than any of FOT? Or incomparable?</p>&#xA;&#xA;<p>Also, the...
logic first order logic
1
What is the relation between First Order Logic and First Order Theory? -- (logic first order logic) <p>I thought that any FOT is a subset of FOL, but that does not seem to be the case, because FOL is complete (every formula is either valid or invalid), while some FOT (like linear integer arithmetic) is not complete.</p...
habedi/stack-exchange-dataset
56,525
Maximum flow with Edmonds–Karp algorithm
<p>I am learning Edmonds–Karp algorithm , I formed following flow network, (capacity is described above arrow, where s is source and t is sink.) </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/nQwy5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nQwy5.png" alt="enter image description here"></a>...
algorithms graphs max flow
1
Maximum flow with Edmonds–Karp algorithm -- (algorithms graphs max flow) <p>I am learning Edmonds–Karp algorithm , I formed following flow network, (capacity is described above arrow, where s is source and t is sink.) </p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/nQwy5.png" rel="nofollow noreferrer"><img src="htt...
habedi/stack-exchange-dataset
56,531
Can a cross-compiler be self-hosting?
<p>My understanding is that a self-hosting compiler will take as input the language it is written in and a cross-compiler will output a language which runs on a platform which is different to what it runs on.</p>&#xA;&#xA;<p>Can we combine these two compiler types into one? </p>&#xA;
compilers
1
Can a cross-compiler be self-hosting? -- (compilers) <p>My understanding is that a self-hosting compiler will take as input the language it is written in and a cross-compiler will output a language which runs on a platform which is different to what it runs on.</p>&#xA;&#xA;<p>Can we combine these two compiler types in...
habedi/stack-exchange-dataset
56,536
similar language by two DFA then why wrong answer
<p>I attempted a mock paper for finite automata .so i was asked to create a DFA which accepts a language in which inputs are a,b and number of b's should be divisible by 3.The first image is my answer for which i was not given marks .but when i checked the answer of the paper they gave the second image as the correct ...
finite automata
1
similar language by two DFA then why wrong answer -- (finite automata) <p>I attempted a mock paper for finite automata .so i was asked to create a DFA which accepts a language in which inputs are a,b and number of b's should be divisible by 3.The first image is my answer for which i was not given marks .but when i che...
habedi/stack-exchange-dataset
56,570
How can a Turing machine accept infinite number of inputs?
<p>How it is possible for a turing machine to process an infinitely long input ?</p>&#xA;
computability turing machines computation models
1
How can a Turing machine accept infinite number of inputs? -- (computability turing machines computation models) <p>How it is possible for a turing machine to process an infinitely long input ?</p>&#xA;
habedi/stack-exchange-dataset
56,577
What is the difference between apprenticeship and imitation learning?
<p>There are many sub-domains of reinforcement learning, two of which are apprenticeship and imitation learning - but that appears just to be two different names for the same thing?</p>&#xA;
terminology reinforcement learning
1
What is the difference between apprenticeship and imitation learning? -- (terminology reinforcement learning) <p>There are many sub-domains of reinforcement learning, two of which are apprenticeship and imitation learning - but that appears just to be two different names for the same thing?</p>&#xA;
habedi/stack-exchange-dataset
56,587
Find k compatible objects with minimum total penalty
<p>Assume we have a set of $n$ objects $X=\{x_1,x_2,\ldots,x_n\}$, where each object $x_i$ has a penalty $p_i$. Additionally, we have a set of incompatibility constraints $C=\{(x_i,x_j),\ldots\}$, where a tuple $(x_i,x_j)$ says that object $x_i$ is incompatible with object $x_j$. The problem is to find a subset $Y$ of...
optimization combinatorics
1
Find k compatible objects with minimum total penalty -- (optimization combinatorics) <p>Assume we have a set of $n$ objects $X=\{x_1,x_2,\ldots,x_n\}$, where each object $x_i$ has a penalty $p_i$. Additionally, we have a set of incompatibility constraints $C=\{(x_i,x_j),\ldots\}$, where a tuple $(x_i,x_j)$ says that ob...
habedi/stack-exchange-dataset
56,590
Is there a name for graphs which contain oriented and non-oriented edges?
<p>Is there a name for graphs which contain oriented and non-oriented edges?</p>&#xA;&#xA;<p>I couldn't find on the internet if there exist a specific name for such graphs.</p>&#xA;
graphs terminology
1
Is there a name for graphs which contain oriented and non-oriented edges? -- (graphs terminology) <p>Is there a name for graphs which contain oriented and non-oriented edges?</p>&#xA;&#xA;<p>I couldn't find on the internet if there exist a specific name for such graphs.</p>&#xA;
habedi/stack-exchange-dataset
56,592
How to express time complexity when the exponential "e" comes into play?
<p>I am new to all of this and I am trying to understand how to define Time Complexity. I have an algorithm which performs a set of operations on inputs of different size.</p>&#xA;&#xA;<p>While timing the execution of such algorithm I have figured out that the time elapsed follows an exponential law:</p>&#xA;&#xA;<pre>...
asymptotics
1
How to express time complexity when the exponential "e" comes into play? -- (asymptotics) <p>I am new to all of this and I am trying to understand how to define Time Complexity. I have an algorithm which performs a set of operations on inputs of different size.</p>&#xA;&#xA;<p>While timing the execution of such algorit...
habedi/stack-exchange-dataset
56,597
TSP problem with a benchmark data
<p>I've got a test Travel Salesman Problem's data with known optimal solutions. It's in a form of set of 2D points. Particularly, this is a tsplib format; sources are <a href="http://www.math.uwaterloo.ca/tsp/world/wi29.tsp" rel="nofollow">here</a> and <a href="http://www.math.uwaterloo.ca/tsp/world/wilog.html" rel="no...
algorithms graphs optimization randomized algorithms traveling salesman
1
TSP problem with a benchmark data -- (algorithms graphs optimization randomized algorithms traveling salesman) <p>I've got a test Travel Salesman Problem's data with known optimal solutions. It's in a form of set of 2D points. Particularly, this is a tsplib format; sources are <a href="http://www.math.uwaterloo.ca/tsp/...
habedi/stack-exchange-dataset
56,607
Length of an Edit Script and the Number of Deletions
<p>I am reading the 1989 paper called <a href="https://publications.mpi-cbg.de/Wu_1990_6334.pdf" rel="nofollow">"An O(NP) Sequence Comparison Algorithm"</a> by Wu, Manber, Myers, and Miller. The algorithm sounds like a good fit for a project I'm doing at work. I have found some implementations in my target language t...
algorithms string metrics edit distance
1
Length of an Edit Script and the Number of Deletions -- (algorithms string metrics edit distance) <p>I am reading the 1989 paper called <a href="https://publications.mpi-cbg.de/Wu_1990_6334.pdf" rel="nofollow">"An O(NP) Sequence Comparison Algorithm"</a> by Wu, Manber, Myers, and Miller. The algorithm sounds like a go...
habedi/stack-exchange-dataset
56,613
Should all internal node keys in B+ tree also be in the leaves?
<p>I was reading about B+ tree insertion.&#xA;The algorithm takes following form:</p>&#xA;<blockquote>&#xA;<ol>&#xA;<li><p>Insert the new node as the leaf node.</p>&#xA;</li>&#xA;<li><p>If the <strong>leaf node overflows</strong>, split the node and <strong>copy</strong> the middle element to the parent index node.</p>...
graphs trees binary trees binary search trees
1
Should all internal node keys in B+ tree also be in the leaves? -- (graphs trees binary trees binary search trees) <p>I was reading about B+ tree insertion.&#xA;The algorithm takes following form:</p>&#xA;<blockquote>&#xA;<ol>&#xA;<li><p>Insert the new node as the leaf node.</p>&#xA;</li>&#xA;<li><p>If the <strong>leaf...
habedi/stack-exchange-dataset
56,615
Huffman encoding: why is there no need for a separator?
<pre><code>Char Code&#xA;==== ====&#xA;E 0000&#xA;i 0001&#xA;y 0010&#xA;l 0011&#xA;k 0100&#xA;. 0101&#xA;space 011&#xA;e 10&#xA;r 1100&#xA;s 1101&#xA;n 1110&#xA;a 1111&#xA;</code></pre>&#xA;...
coding theory encoding scheme huffman coding
1
Huffman encoding: why is there no need for a separator? -- (coding theory encoding scheme huffman coding) <pre><code>Char Code&#xA;==== ====&#xA;E 0000&#xA;i 0001&#xA;y 0010&#xA;l 0011&#xA;k 0100&#xA;. 0101&#xA;space 011&#xA;e 10&...
habedi/stack-exchange-dataset
56,619
If L is a regular language, how to prove that L' is also regular?
<p>I've been trying to construct a proof of the following statement the whole day but I got stuck:</p>&#xA;&#xA;<p>If $L$ is a regular language, the language $L_{}{'}$ consisting of all words in $L$ containing the letter $\sigma$ (where $\sigma$ is an arbitrary fixed letter in $\Sigma$) is also regular.</p>&#xA;&#xA;<p...
formal languages regular languages finite automata
1
If L is a regular language, how to prove that L' is also regular? -- (formal languages regular languages finite automata) <p>I've been trying to construct a proof of the following statement the whole day but I got stuck:</p>&#xA;&#xA;<p>If $L$ is a regular language, the language $L_{}{'}$ consisting of all words in $L$...
habedi/stack-exchange-dataset
56,627
Reconstruct the minimal path cost from the delta-stepping algorithm?
<p>I was coding the <em>delta-steppping algorithm</em> from this <a href="http://arxiv.org/pdf/1604.02113v1.pdf" rel="nofollow">paper</a>. They describe almost everything about the algorithm but not how to get the path. &#xA;As an output I am getting the dictionary <strong>tent</strong> where <code>tent[v]</code> conta...
algorithms graphs
1
Reconstruct the minimal path cost from the delta-stepping algorithm? -- (algorithms graphs) <p>I was coding the <em>delta-steppping algorithm</em> from this <a href="http://arxiv.org/pdf/1604.02113v1.pdf" rel="nofollow">paper</a>. They describe almost everything about the algorithm but not how to get the path. &#xA;As ...
habedi/stack-exchange-dataset
56,632
Is there an example of a recursive language which is not context sensitive?
<p>I have been looking for a prototypical language for recursive languages (decidible) which is no context sensitive without success. For instance $a^*$ is prototypical of regular languages, $a^nb^n$ for context free languages and $a^nb^nc^n$ for context sensitive languages. I usually consider the language which is acc...
formal languages turing machines context sensitive
1
Is there an example of a recursive language which is not context sensitive? -- (formal languages turing machines context sensitive) <p>I have been looking for a prototypical language for recursive languages (decidible) which is no context sensitive without success. For instance $a^*$ is prototypical of regular language...
habedi/stack-exchange-dataset
56,648
What is the complement of the language with all ucv with u ≠ v?
<p>If $L = \{w_1cw_2: w_1,w_2 \in \{a,b\}^* , w_1 \neq w_2\}$ what is the complement of language L? one of my friend said that it is $\overline{L} = \{w_1cw_2: w_1,w_2 \in \{a,b\}^* , w_1 = w_2\}$ and he said that we can ignore $c$ and it's not in $\Sigma$ of language $L$. but I think $c$ should be in $\Sigma$ of langu...
formal languages context free
1
What is the complement of the language with all ucv with u ≠ v? -- (formal languages context free) <p>If $L = \{w_1cw_2: w_1,w_2 \in \{a,b\}^* , w_1 \neq w_2\}$ what is the complement of language L? one of my friend said that it is $\overline{L} = \{w_1cw_2: w_1,w_2 \in \{a,b\}^* , w_1 = w_2\}$ and he said that we can ...
habedi/stack-exchange-dataset
56,653
How to Modify SAT Solvers to Produce Resolution Refutations for Unsatisfiable Instances?
<p>In recent SAT competitions, there is a Certified UNSAT track. The problem instances are all unsatisfiable and the solvers are asked to produce certificates for unsatisfiability. One way is to produce a resolution refutation for the set of clauses in a problem instance. How can a SAT solver, say MiniSAT, be modified ...
algorithms sat solvers
1
How to Modify SAT Solvers to Produce Resolution Refutations for Unsatisfiable Instances? -- (algorithms sat solvers) <p>In recent SAT competitions, there is a Certified UNSAT track. The problem instances are all unsatisfiable and the solvers are asked to produce certificates for unsatisfiability. One way is to produce ...
habedi/stack-exchange-dataset
56,658
How did early computers handle variable word length?
<p>So quoting from the book: <a href="https://rads.stackoverflow.com/amzn/click/com/0262532034" rel="nofollow noreferrer" rel="nofollow noreferrer">A History of Modern Computing (History of Computing)</a></p>&#xA;<blockquote>&#xA;<p>The introduction of reliable core memory made it practical to fetch data in sets of bit...
computer architecture history
1
How did early computers handle variable word length? -- (computer architecture history) <p>So quoting from the book: <a href="https://rads.stackoverflow.com/amzn/click/com/0262532034" rel="nofollow noreferrer" rel="nofollow noreferrer">A History of Modern Computing (History of Computing)</a></p>&#xA;<blockquote>&#xA;<p...
habedi/stack-exchange-dataset
56,662
If P=NP, are there cryptosystems that would require n^2 time to break?
<p>If P does equal NP, will it still be possible do design a cryptosystem where the optimal cryptanalysis algorithm takes, say, the square of the time taken up by the legitimate encryption and decryption algorithms? Do any such algorithms already exist?</p>&#xA;
cryptography encryption
1
If P=NP, are there cryptosystems that would require n^2 time to break? -- (cryptography encryption) <p>If P does equal NP, will it still be possible do design a cryptosystem where the optimal cryptanalysis algorithm takes, say, the square of the time taken up by the legitimate encryption and decryption algorithms? Do a...
habedi/stack-exchange-dataset
56,672
What is the language generated by a given grammar
<blockquote>&#xA; <p>Given the grammar<br>&#xA; $s \to aSb \mid bSb \mid a \mid b$;<br>&#xA; what is the language generated by the grammar over the alphabet $\{a,b\}$?</p>&#xA;</blockquote>&#xA;&#xA;<p>When I was solving this question I was a bit confused &#xA;about the language generated by this grammar. Would be ...
formal languages context free formal grammars
1
What is the language generated by a given grammar -- (formal languages context free formal grammars) <blockquote>&#xA; <p>Given the grammar<br>&#xA; $s \to aSb \mid bSb \mid a \mid b$;<br>&#xA; what is the language generated by the grammar over the alphabet $\{a,b\}$?</p>&#xA;</blockquote>&#xA;&#xA;<p>When I was sol...
habedi/stack-exchange-dataset
56,693
Explanation of Grammar Ambiguity
<p>Consider now the grammar G</p>&#xA;&#xA;<p>S -> (S + S)<br>&#xA;S -> (S * S)<br>&#xA;S -> a</p>&#xA;&#xA;<p>Is it ambiguous?</p>&#xA;&#xA;<p>Answer: No because there are disambiguating parentheses and so no left or right&#xA;recursion.</p>&#xA;&#xA;<p>Can someone explain how the parentheses are disambiguating. I cou...
formal grammars ambiguity left recursion
1
Explanation of Grammar Ambiguity -- (formal grammars ambiguity left recursion) <p>Consider now the grammar G</p>&#xA;&#xA;<p>S -> (S + S)<br>&#xA;S -> (S * S)<br>&#xA;S -> a</p>&#xA;&#xA;<p>Is it ambiguous?</p>&#xA;&#xA;<p>Answer: No because there are disambiguating parentheses and so no left or right&#xA;recursion.</p...
habedi/stack-exchange-dataset
56,694
Can the reproduction function of an evolutionary algorithm consider gene strength?
<p>I am trying to solve the Zen Garden puzzle using an evolutionary algorithm. My question relates to evolutionary algorithms in general.</p>&#xA;&#xA;<p><strong><em>Bit about evolutionary algorithms:</em></strong>&#xA;An evolutionary algorithm is an algorithm which tries to solve a given problem in a semi-random way. ...
genetic algorithms evolutionary computing
1
Can the reproduction function of an evolutionary algorithm consider gene strength? -- (genetic algorithms evolutionary computing) <p>I am trying to solve the Zen Garden puzzle using an evolutionary algorithm. My question relates to evolutionary algorithms in general.</p>&#xA;&#xA;<p><strong><em>Bit about evolutionary a...
habedi/stack-exchange-dataset
56,741
Smallest real root of a polynomial in a range
<p>I'm trying to numerically find the smallest real root of a polynomial in a given range. My initial plan was to shift the polynomial so that the bottom of the range was 0, expand the resulting expressions to find the new coefficients, then use the <a href="https://en.wikipedia.org/wiki/Jenkins%E2%80%93Traub_algorithm...
algorithms numerical algorithms
1
Smallest real root of a polynomial in a range -- (algorithms numerical algorithms) <p>I'm trying to numerically find the smallest real root of a polynomial in a given range. My initial plan was to shift the polynomial so that the bottom of the range was 0, expand the resulting expressions to find the new coefficients, ...
habedi/stack-exchange-dataset
56,745
Will $L = \{a^* b^*\}$ be classified as a regular language?
<p>Will $L = \{a^* b^*\}$ be classified as a regular language?</p>&#xA;&#xA;<p>I am confused because I know that $L = \{a^n b^n\}$ is not regular. What difference does the kleene star make?</p>&#xA;
formal languages regular languages kleene star
1
Will $L = \{a^* b^*\}$ be classified as a regular language? -- (formal languages regular languages kleene star) <p>Will $L = \{a^* b^*\}$ be classified as a regular language?</p>&#xA;&#xA;<p>I am confused because I know that $L = \{a^n b^n\}$ is not regular. What difference does the kleene star make?</p>&#xA;
habedi/stack-exchange-dataset
56,748
On intersection of classes
<p>Consider classes $\mathcal C_1$ and $\mathcal C_2$ of problems both of which are $\mathsf{NP}$-complete. Does it mean $\mathcal C_1\cap\mathcal C_2$ of problems is $\mathsf{NP}$-complete?</p>&#xA;
complexity theory
1
On intersection of classes -- (complexity theory) <p>Consider classes $\mathcal C_1$ and $\mathcal C_2$ of problems both of which are $\mathsf{NP}$-complete. Does it mean $\mathcal C_1\cap\mathcal C_2$ of problems is $\mathsf{NP}$-complete?</p>&#xA;
habedi/stack-exchange-dataset
56,755
Lambda Calculus inductive substitution definition
<p>I'm reading <strong>Lambda-Calculus and Combinators: An Introduction</strong>, and there's the following definition of <span class="math-container">$\lambda$</span>-substitution:</p>&#xA;<ul>&#xA;<li><span class="math-container">$FV(P)$</span> stands for the set containing all free-variables from <span class="math-c...
lambda calculus induction
1
Lambda Calculus inductive substitution definition -- (lambda calculus induction) <p>I'm reading <strong>Lambda-Calculus and Combinators: An Introduction</strong>, and there's the following definition of <span class="math-container">$\lambda$</span>-substitution:</p>&#xA;<ul>&#xA;<li><span class="math-container">$FV(P)$...
habedi/stack-exchange-dataset
56,765
In instruction pipelining, can we forward an operand more than one clock cycle?
<p>Most operand forwarding examples that use the standard 5-stage MIPS pipeline forward operands from EX or MEM by ONE clock cyle to a later instruction. Is it possible to do so for more than one (from the 5th to the 8th clock cycle, for example)?</p>&#xA;
computer architecture cpu pipelines
1
In instruction pipelining, can we forward an operand more than one clock cycle? -- (computer architecture cpu pipelines) <p>Most operand forwarding examples that use the standard 5-stage MIPS pipeline forward operands from EX or MEM by ONE clock cyle to a later instruction. Is it possible to do so for more than one (fr...
habedi/stack-exchange-dataset
56,783
Can any finite problem be in NP-Complete?
<p>My lecturer made the statement</p>&#xA;&#xA;<blockquote>&#xA; <p>Any finite problem cannot be NP-Complete</p>&#xA;</blockquote>&#xA;&#xA;<p>He was talking about Sudoku's at the time saying something along the lines that for a 8x8 Sudoku there is a finite set of solutions but I can't remember exactly what he said. I...
np complete np
1
Can any finite problem be in NP-Complete? -- (np complete np) <p>My lecturer made the statement</p>&#xA;&#xA;<blockquote>&#xA; <p>Any finite problem cannot be NP-Complete</p>&#xA;</blockquote>&#xA;&#xA;<p>He was talking about Sudoku's at the time saying something along the lines that for a 8x8 Sudoku there is a finite...
habedi/stack-exchange-dataset
56,788
Determine whether a context-free language is deterministic or not
<p>I define language $L = \{a^k a^m b^m c^k \} \cup \{a^n b^n b^k c^k\}$ and I want to determine if it's deterministic context free language or it is nondeterministic. so I tried to create pushdown automata for this language like below.</p>&#xA;&#xA;<p>first I read $a$ and push it to stack till it ends. right know num...
context free pushdown automata
1
Determine whether a context-free language is deterministic or not -- (context free pushdown automata) <p>I define language $L = \{a^k a^m b^m c^k \} \cup \{a^n b^n b^k c^k\}$ and I want to determine if it's deterministic context free language or it is nondeterministic. so I tried to create pushdown automata for this l...
habedi/stack-exchange-dataset
56,795
The range of significance in Type Theory
<p>What exactly does "Types as ranges of significance of propositional functions. In modern 
terminology, types are domains of predicates" mean?</p>&#xA;&#xA;<p><strong>Update:</strong>&#xA;I found in <a href="http://www.jstor.org/stable/2369948?seq=1#page_scan_tab_contents" rel="nofollow">this paper (Pag 14 or 234)</a...
type theory
1
The range of significance in Type Theory -- (type theory) <p>What exactly does "Types as ranges of significance of propositional functions. In modern 
terminology, types are domains of predicates" mean?</p>&#xA;&#xA;<p><strong>Update:</strong>&#xA;I found in <a href="http://www.jstor.org/stable/2369948?seq=1#page_scan_...
habedi/stack-exchange-dataset
56,801
TSP Edge Removal
<p>Are there any papers/algorithms for finding edges in a graph that can be removed with affecting the graph's optimal TSP tour length?</p>&#xA;&#xA;<p>For instance, in a Euclidean TSP instance, many edges could be ruled out for being too long (i.e., jumping between very far apart nodes) given a decent upper bound on t...
algorithms graphs optimization traveling salesman
1
TSP Edge Removal -- (algorithms graphs optimization traveling salesman) <p>Are there any papers/algorithms for finding edges in a graph that can be removed with affecting the graph's optimal TSP tour length?</p>&#xA;&#xA;<p>For instance, in a Euclidean TSP instance, many edges could be ruled out for being too long (i.e...
habedi/stack-exchange-dataset
56,802
Hough transform: difference in cartesian to polar equation
<p>According to Wikipedia and most other resources on the internet, the relation between cartesian coordinate and polar coordinate parameters are described by the equation $x\cos{\theta}+y\sin{\theta}=d$.</p>&#xA;&#xA;<p>However, the computer vision course in Udacity used $x\cos{\theta}-y\sin{\theta}=d$ instead, as sho...
computer vision
1
Hough transform: difference in cartesian to polar equation -- (computer vision) <p>According to Wikipedia and most other resources on the internet, the relation between cartesian coordinate and polar coordinate parameters are described by the equation $x\cos{\theta}+y\sin{\theta}=d$.</p>&#xA;&#xA;<p>However, the comput...
habedi/stack-exchange-dataset
56,803
IS $LOGSPACE\subsetneq QMA$ an open problem?
<p>Having read some chapters of <em>Computational Complexity: A Modern Approach</em>, I see no time or space hierarchy theorem which applies to this case. As far as I can see, we know the following inclusions:</p>&#xA;&#xA;<p>$L \subseteq NL \subseteq P \subseteq BPP \subseteq BQP \subseteq QMA$</p>&#xA;&#xA;<p>but no ...
complexity classes quantum computing
1
IS $LOGSPACE\subsetneq QMA$ an open problem? -- (complexity classes quantum computing) <p>Having read some chapters of <em>Computational Complexity: A Modern Approach</em>, I see no time or space hierarchy theorem which applies to this case. As far as I can see, we know the following inclusions:</p>&#xA;&#xA;<p>$L \sub...
habedi/stack-exchange-dataset
56,804
Algorithm to convert rendered number back into symbolic form
<p>If you have a number such as $3.14626437$ and you need to know what symbols create it, as far as I know, there are two tools:</p>&#xA;&#xA;<p>1- <a href="http://isc.carma.newcastle.edu.au/standard" rel="nofollow">ISC</a></p>&#xA;&#xA;<p>2- <a href="http://www.wolframalpha.com/input/?i=3.14626437" rel="nofollow">wolf...
algorithms algorithm analysis mathematical programming
1
Algorithm to convert rendered number back into symbolic form -- (algorithms algorithm analysis mathematical programming) <p>If you have a number such as $3.14626437$ and you need to know what symbols create it, as far as I know, there are two tools:</p>&#xA;&#xA;<p>1- <a href="http://isc.carma.newcastle.edu.au/standard...
habedi/stack-exchange-dataset
56,805
How does a recurrent connection in a neural network work?
<p>I am reading a very <a href="http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf" rel="nofollow noreferrer">interesting paper on genetic algorithms</a> which define neural networks. I am familiar with how a feedforward neural network operates, but then I came across this:</p>&#xA;&#xA;<p><a href="https://i.st...
machine learning neural networks
1
How does a recurrent connection in a neural network work? -- (machine learning neural networks) <p>I am reading a very <a href="http://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf" rel="nofollow noreferrer">interesting paper on genetic algorithms</a> which define neural networks. I am familiar with how a feedfor...
habedi/stack-exchange-dataset
56,811
Where Can I Find DFA Practice?
<p>Where can I find a web site or book where I can practice drawing DFAs from a language like " {w| w has at least three a’s and at least two b’s} ". It will be important to have access to the answer so as to check myself. I need the practice.</p>&#xA;
finite automata
1
Where Can I Find DFA Practice? -- (finite automata) <p>Where can I find a web site or book where I can practice drawing DFAs from a language like " {w| w has at least three a’s and at least two b’s} ". It will be important to have access to the answer so as to check myself. I need the practice.</p>&#xA;
habedi/stack-exchange-dataset
56,818
Why IS is not in NL, only in NP?
<p>All we need to do is guess $k$ vertices. We look at vertex $v_1$, and make sure $v_1$ is not connected to $v_2...v_k$. Then, we "throw" $v_1$, and look at $v_2$. We do this to all vertices.</p>&#xA;&#xA;<p>Meaning that we only need to guess $k$ vertices, and in our working memory (which determinates NL or NP) we onl...
np
1
Why IS is not in NL, only in NP? -- (np) <p>All we need to do is guess $k$ vertices. We look at vertex $v_1$, and make sure $v_1$ is not connected to $v_2...v_k$. Then, we "throw" $v_1$, and look at $v_2$. We do this to all vertices.</p>&#xA;&#xA;<p>Meaning that we only need to guess $k$ vertices, and in our working me...
habedi/stack-exchange-dataset
56,823
Winning strategy of Nim game when picking from multiple piles is allowed
<p>I am studying with Game theory right now. In Nim game, in any turn, a player can move any number of stones from any <strong><em>one</em></strong> pile. I am wondering what might be the winning strategy of first player if in any move, a player can pick any number of stones from <strong><em>one or more</em></strong> p...
algorithms game theory
1
Winning strategy of Nim game when picking from multiple piles is allowed -- (algorithms game theory) <p>I am studying with Game theory right now. In Nim game, in any turn, a player can move any number of stones from any <strong><em>one</em></strong> pile. I am wondering what might be the winning strategy of first playe...
habedi/stack-exchange-dataset
56,824
About randomness and minmax algorithm with alpha beta pruning
<p>Will choosing the child of a node randomly in the alpha beta algorithm have a better chance to get a cut off than choosing them in order?</p>&#xA;&#xA;<p>Here's the pseudocode with my addition marked with ***.</p>&#xA;&#xA;<pre><code>function alphabeta(node, depth, α, β, maximizingPlayer)&#xA; if depth = 0 or no...
algorithms artificial intelligence randomness
1
About randomness and minmax algorithm with alpha beta pruning -- (algorithms artificial intelligence randomness) <p>Will choosing the child of a node randomly in the alpha beta algorithm have a better chance to get a cut off than choosing them in order?</p>&#xA;&#xA;<p>Here's the pseudocode with my addition marked with...
habedi/stack-exchange-dataset
56,825
How to calculate virtual address space from page size, virtual address size and page table entry size?
<p>I try to solve an exercise, unfortunately without any success yet.</p>&#xA;&#xA;<p>From the following given information, the virtual address space should be calculated:</p>&#xA;&#xA;<ul>&#xA;<li>Page size is 16 KB</li>&#xA;<li>Logical address size is 47 bit</li>&#xA;<li>3 levels of page tables; all have the same siz...
memory management virtual memory paging
1
How to calculate virtual address space from page size, virtual address size and page table entry size? -- (memory management virtual memory paging) <p>I try to solve an exercise, unfortunately without any success yet.</p>&#xA;&#xA;<p>From the following given information, the virtual address space should be calculated:<...
habedi/stack-exchange-dataset
56,837
Is function application actually a memory manipulation algorithm?
<p>I thought about how in lambda calculus (and many implementations of functional programming languages) function (lambda) application and lambda itself, as a construct, are "primitive things", usually somehow implemented by an interpeter. Then I thought, can you "boil-down" these two things to more primitve stuff.&#xA...
turing machines lambda calculus functional programming
1
Is function application actually a memory manipulation algorithm? -- (turing machines lambda calculus functional programming) <p>I thought about how in lambda calculus (and many implementations of functional programming languages) function (lambda) application and lambda itself, as a construct, are "primitive things", ...
habedi/stack-exchange-dataset
56,849
Is this decidable language a subset of this undecidable language?
<p>I think I understand the theoretical definition of decidable and undecidable languages but I am struggling with their examples. </p>&#xA;&#xA;<p>A(DFA) = {(M, w): M is a deterministic finite automaton that accepts the string w}</p>&#xA;&#xA;<p>A(TM) = {(M, w): M is a turing machine that accepts the string w}</p>&#xA...
undecidability
1
Is this decidable language a subset of this undecidable language? -- (undecidability) <p>I think I understand the theoretical definition of decidable and undecidable languages but I am struggling with their examples. </p>&#xA;&#xA;<p>A(DFA) = {(M, w): M is a deterministic finite automaton that accepts the string w}</p>...
habedi/stack-exchange-dataset
56,856
Find all shortest paths in a graph where path has even number of edges and greater than 6
<blockquote>&#xA; <p>Let $G=(V,E)$, a directed with non-negative weights ($w:E\to\mathbb{R}^+$). Describe an algorithm, finds all shortest paths in the graph from a source vertex, $s\in V$, such that, each paths has an even number of edges and the number of edges is greater-equal to $6$.</p>&#xA;</blockquote>&#xA;&#xA...
algorithms shortest path
1
Find all shortest paths in a graph where path has even number of edges and greater than 6 -- (algorithms shortest path) <blockquote>&#xA; <p>Let $G=(V,E)$, a directed with non-negative weights ($w:E\to\mathbb{R}^+$). Describe an algorithm, finds all shortest paths in the graph from a source vertex, $s\in V$, such that...
habedi/stack-exchange-dataset
56,862
Maximum set of equalities, subject to some inequalities
<p>I have $n$ variables $x_1,\dots,x_n$. I'm given a set $E$ of equalities (each of the form $x_i=x_j$ for some $i,j$) and a set $I$ of inequalities (each of the form $x_i \ne x_j$ for some $i,j$). I want to find a maximum-size subset $E' \subseteq E$ such that $E'$ is compatible with $I$, i.e., such that there is an...
algorithms graphs constraint programming connected
1
Maximum set of equalities, subject to some inequalities -- (algorithms graphs constraint programming connected) <p>I have $n$ variables $x_1,\dots,x_n$. I'm given a set $E$ of equalities (each of the form $x_i=x_j$ for some $i,j$) and a set $I$ of inequalities (each of the form $x_i \ne x_j$ for some $i,j$). I want t...
habedi/stack-exchange-dataset
56,864
How to improve the accuracy of automatic conflict resolution?
<p><a href="https://www.anc.org/data/oanc/contents/" rel="nofollow noreferrer"><strong>A little background information from my previous question</strong></a>:<a href="https://english.stackexchange.com/questions/318528/conflict-resolution-how-to-decide-if-two-words-are-generally-unmistakable">https://english.stackexchan...
algorithms regular languages artificial intelligence
1
How to improve the accuracy of automatic conflict resolution? -- (algorithms regular languages artificial intelligence) <p><a href="https://www.anc.org/data/oanc/contents/" rel="nofollow noreferrer"><strong>A little background information from my previous question</strong></a>:<a href="https://english.stackexchange.com...
habedi/stack-exchange-dataset
56,867
Why are loops faster than recursion?
<p>In practice I understand that any recursion can be written as a loop (and vice versa(?)) and if we measure with actual computers we find that loops are faster than recursion for the same problem. But is there any theory what makes this difference or is it mainly emprical?</p>&#xA;
time complexity recursion loops
1
Why are loops faster than recursion? -- (time complexity recursion loops) <p>In practice I understand that any recursion can be written as a loop (and vice versa(?)) and if we measure with actual computers we find that loops are faster than recursion for the same problem. But is there any theory what makes this differe...
habedi/stack-exchange-dataset
56,876
Convert non-integer decimal to octal
<p>I follow a course in Computer Architecture and I'm making exercises on number conversions. Now one of the questions asks me to convert 251.5625 to octal and hexdecimal base. No further info is given. Would this mean that I have to convert it and just ignore the point? Or what's the convention on something like this?...
computer architecture base conversion
1
Convert non-integer decimal to octal -- (computer architecture base conversion) <p>I follow a course in Computer Architecture and I'm making exercises on number conversions. Now one of the questions asks me to convert 251.5625 to octal and hexdecimal base. No further info is given. Would this mean that I have to conver...
habedi/stack-exchange-dataset
56,882
Turing Machine that always returns a blank tape
<p>Is it possible to construct a Turing Machine such that given any finite input on a tape $s$, it clears the tape in a finite amount of time?</p>&#xA;&#xA;<p>I have used such a TM as an intermediate step to show a reduction from the State Entry Problem to is $w \in L(M)$ problem but I don't know if it is feasible to c...
computability turing machines
1
Turing Machine that always returns a blank tape -- (computability turing machines) <p>Is it possible to construct a Turing Machine such that given any finite input on a tape $s$, it clears the tape in a finite amount of time?</p>&#xA;&#xA;<p>I have used such a TM as an intermediate step to show a reduction from the Sta...
habedi/stack-exchange-dataset
56,883
What is wrong with this reasoning that finding the genus of a degree 3 bipartite graph is NP-complete?
<p>Finding genus of a biparite graph is $NP$-complete and finding genus of a degree $3$ graph is $NP$-complete and so finding genus of a degree $3$ bipartite graph is $NP$-complete.</p>&#xA;&#xA;<p>Though implication could be right is there any harm in reasoning this way on $NP$-completeness?</p>&#xA;
np complete proof techniques
1
What is wrong with this reasoning that finding the genus of a degree 3 bipartite graph is NP-complete? -- (np complete proof techniques) <p>Finding genus of a biparite graph is $NP$-complete and finding genus of a degree $3$ graph is $NP$-complete and so finding genus of a degree $3$ bipartite graph is $NP$-complete.</...
habedi/stack-exchange-dataset
56,885
Are there any implementations of the spineless tagless G-machine other than in GHC?
<p>From Simon Peyton Jones (recent Royal Society member) we read the paper: <a href="http://www.dcc.fc.up.pt/~pbv/aulas/linguagens/peytonjones92implementing.pdf">Implementing lazy functional languages on stock hardware: the Spineless Tagless G-Machine</a>.</p>&#xA;&#xA;<p>Now this paper is part of how they made Haskell...
reference request compilers
1
Are there any implementations of the spineless tagless G-machine other than in GHC? -- (reference request compilers) <p>From Simon Peyton Jones (recent Royal Society member) we read the paper: <a href="http://www.dcc.fc.up.pt/~pbv/aulas/linguagens/peytonjones92implementing.pdf">Implementing lazy functional languages on...
habedi/stack-exchange-dataset
56,888
How can I explain to my parents that I study programming languages?
<p>I am currently finishing my MSc in computer science. I am interested in programming languages, especially in type systems. I got interested in research in this field and next semester I will start a PhD on the subject.</p>&#xA;&#xA;<p>Now here is the real question: how can I explain what I (want to) do to people wit...
programming languages education typing research
1
How can I explain to my parents that I study programming languages? -- (programming languages education typing research) <p>I am currently finishing my MSc in computer science. I am interested in programming languages, especially in type systems. I got interested in research in this field and next semester I will start...
habedi/stack-exchange-dataset
56,897
Why would we want a self-hosting compiler?
<p>I understand that a self-hosting compiler is a compiler which can compile the code of the language that it is written in into different language but I don't understand why we would want to do that. What are the benefits (and drawbacks) of a compiler which is self-hosting?</p>&#xA;
compilers
1
Why would we want a self-hosting compiler? -- (compilers) <p>I understand that a self-hosting compiler is a compiler which can compile the code of the language that it is written in into different language but I don't understand why we would want to do that. What are the benefits (and drawbacks) of a compiler which is ...
habedi/stack-exchange-dataset
56,900
Machine learning algorithm for predicting binary decisions on a large, underrepresented dataset
<p>I would like create a classifier which works on a relatively large (about 30k samples) dataset with circa 20 attributes and a binary decision, however such, which contains relatively small amount of samples with, say, "Yes" decision. That is, the data for building a classifier seems underepresented.</p>&#xA;&#xA;<p>...
machine learning
1
Machine learning algorithm for predicting binary decisions on a large, underrepresented dataset -- (machine learning) <p>I would like create a classifier which works on a relatively large (about 30k samples) dataset with circa 20 attributes and a binary decision, however such, which contains relatively small amount of ...
habedi/stack-exchange-dataset
56,907
What mathematical background is enough to go through the entire Knuth's TAOCP?
<p>I am an undergrad. I can do mathematics fine and am a lot more interested to explore.<br>&#xA;I turned towards TAOCP as it is highly mathematically oriented so as to excel at maths and programming at the same time.<br>&#xA;But I am stuck. I have only studied calculus, numerical analysis and probability (undergrad le...
algorithms education mathematical foundations
1
What mathematical background is enough to go through the entire Knuth's TAOCP? -- (algorithms education mathematical foundations) <p>I am an undergrad. I can do mathematics fine and am a lot more interested to explore.<br>&#xA;I turned towards TAOCP as it is highly mathematically oriented so as to excel at maths and pr...
habedi/stack-exchange-dataset
56,908
Prove Undecidability Without Using Rice's Theorem
<p>Show that checking if a TM accepts some input string of length greater than some constant $k$ is undecidable. Here the constant $k$ is publicly known.</p>&#xA;&#xA;<p>I tried solving this problem by trying to reduce the "Acceptance Problem" i.e. the problem where we have to check whether a TM $M$ accepts a string $w...
computability turing machines reductions
1
Prove Undecidability Without Using Rice's Theorem -- (computability turing machines reductions) <p>Show that checking if a TM accepts some input string of length greater than some constant $k$ is undecidable. Here the constant $k$ is publicly known.</p>&#xA;&#xA;<p>I tried solving this problem by trying to reduce the "...
habedi/stack-exchange-dataset
56,915
Complexity of Hamiltonian path and clique problem
<p>I came across this question. If we want to check if a graph contains both Hamiltonian path and clique. Would this problem be NPC.</p>&#xA;&#xA;<p>I knew that clique contains a Hamiltonian path and both problems are NPC, but I am uncertain if something would be different if we check it in same time.</p>&#xA;
complexity theory
1
Complexity of Hamiltonian path and clique problem -- (complexity theory) <p>I came across this question. If we want to check if a graph contains both Hamiltonian path and clique. Would this problem be NPC.</p>&#xA;&#xA;<p>I knew that clique contains a Hamiltonian path and both problems are NPC, but I am uncertain if so...
habedi/stack-exchange-dataset
56,922
Decidablity with exponential number of solution
<p>I am trying to understanding this. If a problem has exponential amount of candidate solutions, such as 2^2^n. Is this decidable?&#xA;To my understanding, as long as its' verfiable, no matter how big the solutions there are, it's.decidable. </p>&#xA;&#xA;<p>Thanks for clarity</p>&#xA;
undecidability
1
Decidablity with exponential number of solution -- (undecidability) <p>I am trying to understanding this. If a problem has exponential amount of candidate solutions, such as 2^2^n. Is this decidable?&#xA;To my understanding, as long as its' verfiable, no matter how big the solutions there are, it's.decidable. </p>&#xA;...
habedi/stack-exchange-dataset
56,929
Hill Climbing Search - 8 queens
<p><a href="https://i.stack.imgur.com/gZsmt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gZsmt.png" alt="enter image description here" /></a></p>&#xA;<p>In that picture, I am having trouble counting why there are 17 pairs of queens. I can only count 14. I counted 10 diagonal pairs and 5 horizontal...
search algorithms
1
Hill Climbing Search - 8 queens -- (search algorithms) <p><a href="https://i.stack.imgur.com/gZsmt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gZsmt.png" alt="enter image description here" /></a></p>&#xA;<p>In that picture, I am having trouble counting why there are 17 pairs of queens. I can only...
habedi/stack-exchange-dataset
56,944
Is there an implementation of higher kinded types in typed lambda calculus?
<p>I can see that we can do <a href="https://en.wikipedia.org/wiki/Kind_(type_theory)" rel="nofollow noreferrer">higher kinded types</a> <code>( * -&gt; *) -&gt; *</code> in <a href="http://blogs.atlassian.com/2013/09/scala-types-of-a-higher-kind/" rel="nofollow noreferrer">Scala</a> and <a href="https://downloads.hask...
lambda calculus abstract data types prolog
1
Is there an implementation of higher kinded types in typed lambda calculus? -- (lambda calculus abstract data types prolog) <p>I can see that we can do <a href="https://en.wikipedia.org/wiki/Kind_(type_theory)" rel="nofollow noreferrer">higher kinded types</a> <code>( * -&gt; *) -&gt; *</code> in <a href="http://blogs....
habedi/stack-exchange-dataset
56,949
How to construct a running kd-tree?
<p>I have a stream of 3-tuples of type <code>(x,y,t)</code> where <code>x</code> and <code>y</code> are in the range <code>0-127</code> and <code>t</code> is time, therefore monotonic increasing.</p>&#xA;&#xA;<p>I want to be able to quickly search for points around a query point and think that constructing a kd-tree fr...
data structures trees linear algebra
1
How to construct a running kd-tree? -- (data structures trees linear algebra) <p>I have a stream of 3-tuples of type <code>(x,y,t)</code> where <code>x</code> and <code>y</code> are in the range <code>0-127</code> and <code>t</code> is time, therefore monotonic increasing.</p>&#xA;&#xA;<p>I want to be able to quickly s...
habedi/stack-exchange-dataset
56,952
Comparing asymptotic complexity of functions $\log{n}$, $(\log{n})^c$ and $\sqrt{n}$
<p>I usually follow approach of taking logs and putting arbitrary large powers of $2$ for $n$ and reducing the given function to some constant value for large value of $n$. So in this case I did it as follows:</p>&#xA;&#xA;<ul>&#xA;<li><p>$\log{n}$</p>&#xA;&#xA;<p>Putting $n=2^{2^{2^{16}}}$ and taking $\log$</p>&#xA;&#...
asymptotics
1
Comparing asymptotic complexity of functions $\log{n}$, $(\log{n})^c$ and $\sqrt{n}$ -- (asymptotics) <p>I usually follow approach of taking logs and putting arbitrary large powers of $2$ for $n$ and reducing the given function to some constant value for large value of $n$. So in this case I did it as follows:</p>&#xA;...
habedi/stack-exchange-dataset
56,962
Backward vs Forward Data-flow Analysis
<p>I understand how both forward and backward data-flow analysis work but in what situations would we use them? Why do we need to be able to do it in both ways? Do compilers of certain types perform one way more efficiently than the other?</p>&#xA;
compilers data flow analysis
1
Backward vs Forward Data-flow Analysis -- (compilers data flow analysis) <p>I understand how both forward and backward data-flow analysis work but in what situations would we use them? Why do we need to be able to do it in both ways? Do compilers of certain types perform one way more efficiently than the other?</p>&#xA...
habedi/stack-exchange-dataset
56,965
Path finding well know problems
<p>Is there any pathfinding trivial problems like the TSP?&#xA;<br/>&#xA;I know that is possible to solve TSP using A*, Best-first and using spanning tree and other things as heuristic but, is there any problem well know by the AI community?</p>&#xA;
heuristics
1
Path finding well know problems -- (heuristics) <p>Is there any pathfinding trivial problems like the TSP?&#xA;<br/>&#xA;I know that is possible to solve TSP using A*, Best-first and using spanning tree and other things as heuristic but, is there any problem well know by the AI community?</p>&#xA;
habedi/stack-exchange-dataset
56,972
What's the point of 48 bit colour?
<p>I've read that the human eye can only really decipher around 10&nbsp;million different colours, so what's the point in technology that uses 48-bit colour, which allows for $2.81\times 10^{14}$ colours. Is this not like giant, super inefficient overkill?</p>&#xA;
graphics hci
1
What's the point of 48 bit colour? -- (graphics hci) <p>I've read that the human eye can only really decipher around 10&nbsp;million different colours, so what's the point in technology that uses 48-bit colour, which allows for $2.81\times 10^{14}$ colours. Is this not like giant, super inefficient overkill?</p>&#xA;
habedi/stack-exchange-dataset
56,994
Is it possible to build DFA for odd-length words with 1 in the middle?
<p>$L := \{w \in \{0,1\}^* | $the length of $w$ is odd $ \wedge $ 1 is in the middle of $w\}$</p>&#xA;&#xA;<p>So the alphabet is $\{0,1\}^*$. My problem is that I can't keep track of the equality of chars before and after $1$. A limited DFA for the length less than 6: <a href="https://i.stack.imgur.com/Ey7MW.jpg" rel="...
formal languages finite automata formal grammars
1
Is it possible to build DFA for odd-length words with 1 in the middle? -- (formal languages finite automata formal grammars) <p>$L := \{w \in \{0,1\}^* | $the length of $w$ is odd $ \wedge $ 1 is in the middle of $w\}$</p>&#xA;&#xA;<p>So the alphabet is $\{0,1\}^*$. My problem is that I can't keep track of the equality...
habedi/stack-exchange-dataset
56,999
Genetic Algorithms - Why wouldn't we use the principle of Elitism?
<p>In Genetic Algorithms, the idea of elitism is that we keep our best solution from the generation in our population regardless of what happens throughout the iteration. However, elitism seems to be discussed as an optional thing; so what situations is using elitism actually a negative aspect of a genetic algorithm?</...
genetic algorithms
1
Genetic Algorithms - Why wouldn't we use the principle of Elitism? -- (genetic algorithms) <p>In Genetic Algorithms, the idea of elitism is that we keep our best solution from the generation in our population regardless of what happens throughout the iteration. However, elitism seems to be discussed as an optional thin...
habedi/stack-exchange-dataset
57,002
Using a combination of spatial and non-spatial inputs for convolutional neural networks
<p>I'm working on training a game AI using deep reinforcement learning to achieve specific examples based on pixel input and some additional state information. </p>&#xA;&#xA;<p>Naturally, I'm using a convolutional neural network to deal with the pixel information, which has been working well so far. However, I still ha...
machine learning neural networks reinforcement learning
1
Using a combination of spatial and non-spatial inputs for convolutional neural networks -- (machine learning neural networks reinforcement learning) <p>I'm working on training a game AI using deep reinforcement learning to achieve specific examples based on pixel input and some additional state information. </p>&#xA;&#...
habedi/stack-exchange-dataset
57,003
Boolean search explained
<p>My mother is taking some online course in order to be a librarian of sorts, in this course they cover boolean searches, so they can search databases efficiently, however, she got a question sounding something like this:</p>&#xA;&#xA;<p><em>The search "x OR y" will result in 105 000 hits, while a search for only x wi...
sets counting
1
Boolean search explained -- (sets counting) <p>My mother is taking some online course in order to be a librarian of sorts, in this course they cover boolean searches, so they can search databases efficiently, however, she got a question sounding something like this:</p>&#xA;&#xA;<p><em>The search "x OR y" will result i...
habedi/stack-exchange-dataset
57,009
Determining if my artificial neural network needs additional layers
<p>I have implemented a neural network for load forecasting in Microsoft Excel. My structure is very simplistic and involves only 1 hidden layer and 4 neurons. (See picture)</p>&#xA;&#xA;<p><a href="https://i.stack.imgur.com/vALDp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vALDp.png" alt="Neural...
neural networks neural computing gradient descent
1
Determining if my artificial neural network needs additional layers -- (neural networks neural computing gradient descent) <p>I have implemented a neural network for load forecasting in Microsoft Excel. My structure is very simplistic and involves only 1 hidden layer and 4 neurons. (See picture)</p>&#xA;&#xA;<p><a href...
habedi/stack-exchange-dataset
57,015
What are the most expressive, terminating languages?
<p>I'm less interested in languages where you can write almost anything, but then are required to write an accompanying proof that what you wrote terminates. </p>&#xA;&#xA;<p>I'm more interested in the design space of languages inherently confined to certain complexity classes by construction.</p>&#xA;&#xA;<p>Is there ...
programming languages termination
1
What are the most expressive, terminating languages? -- (programming languages termination) <p>I'm less interested in languages where you can write almost anything, but then are required to write an accompanying proof that what you wrote terminates. </p>&#xA;&#xA;<p>I'm more interested in the design space of languages ...
habedi/stack-exchange-dataset
57,024
What does $\cdot$ mean as a notation with complexity classes?
<p>In the wikipedia page for <a href="https://en.wikipedia.org/wiki/Toda%27s_theorem" rel="nofollow">Toda's Theorem</a>, the notation $A\cdot B$ is used where $A$ and $B$ are two complexity classes, but without explanation as to its meaning.</p>&#xA;&#xA;<p>SO given two classes $A$ and $B$ what does $\cdot$ mean in $A\...
complexity theory complexity classes notation
1
What does $\cdot$ mean as a notation with complexity classes? -- (complexity theory complexity classes notation) <p>In the wikipedia page for <a href="https://en.wikipedia.org/wiki/Toda%27s_theorem" rel="nofollow">Toda's Theorem</a>, the notation $A\cdot B$ is used where $A$ and $B$ are two complexity classes, but with...
habedi/stack-exchange-dataset
57,027
When is an ATM network connection superior to an IP connection?
<p>Currently learning about Networks in Computer Science, and I don't understand why you would ever use an ATM (asynchronous transfer mode) network instead of IP, as IP doesn't have to be as reliable and can be set up much more quickly, and is what the entire Internet basically uses.</p>&#xA;
computer networks
1
When is an ATM network connection superior to an IP connection? -- (computer networks) <p>Currently learning about Networks in Computer Science, and I don't understand why you would ever use an ATM (asynchronous transfer mode) network instead of IP, as IP doesn't have to be as reliable and can be set up much more quic...
habedi/stack-exchange-dataset
57,028
Solving $T(n)= 3T(n/4)+ n\log n$ without the master method
<p>How can one solve&#xA;$$T(n)= 3T\left(\frac{n}{4}\right) + n\cdot \log n$$&#xA;without using the master method?</p>&#xA;&#xA;<p>I know it has a solution using the master theorem from <a href="https://cs.stackexchange.com/questions/3504/solving-tn-3t-fracn4-n-cdot-lgn-using-the-master-theorem">this link</a>.</p>&#xA...
recurrence relation
1
Solving $T(n)= 3T(n/4)+ n\log n$ without the master method -- (recurrence relation) <p>How can one solve&#xA;$$T(n)= 3T\left(\frac{n}{4}\right) + n\cdot \log n$$&#xA;without using the master method?</p>&#xA;&#xA;<p>I know it has a solution using the master theorem from <a href="https://cs.stackexchange.com/questions/3...
habedi/stack-exchange-dataset
57,040
Jobs in algorithm design
<p>I just wanted to know if there are actually jobs only devoted to creating and optimising algorithms after finishing a Bachelors degree. Or is it only restricted to PhD's?</p>&#xA;&#xA;<p>I solve problems on SPOJ and CodeForces, but I'm not sure if I'd get a job doing something like that.</p>&#xA;
algorithms
1
Jobs in algorithm design -- (algorithms) <p>I just wanted to know if there are actually jobs only devoted to creating and optimising algorithms after finishing a Bachelors degree. Or is it only restricted to PhD's?</p>&#xA;&#xA;<p>I solve problems on SPOJ and CodeForces, but I'm not sure if I'd get a job doing somethin...
habedi/stack-exchange-dataset
57,051
Heavy hitters problem linear scan and auxiliary space
<p>I'm looking at Lecture #2 from this Stanford course <a href="http://web.stanford.edu/class/cs168/index.html" rel="nofollow">http://web.stanford.edu/class/cs168/index.html</a>, let me introduce the HH problem:</p>&#xA;&#xA;<p>We have an array of $n$ elements and we want to know which elements appear at least $\frac{n...
algorithms complexity theory
1
Heavy hitters problem linear scan and auxiliary space -- (algorithms complexity theory) <p>I'm looking at Lecture #2 from this Stanford course <a href="http://web.stanford.edu/class/cs168/index.html" rel="nofollow">http://web.stanford.edu/class/cs168/index.html</a>, let me introduce the HH problem:</p>&#xA;&#xA;<p>We h...
habedi/stack-exchange-dataset
57,068
Solve Recurrence Relation
<p>I'm trying to solve the following recurrence relation. I've gotten through two iterations, but I don't see any pattern. I would appreciate any help with this.</p>&#xA;&#xA;<p>$T(1)=1$</p>&#xA;&#xA;<p>$T(n)=6\ T(n/6)\ +\ 2n\ +\ 3$</p>&#xA;&#xA;<p>I've manually ran through two iterations and found the following:</p>&#...
recurrence relation
1
Solve Recurrence Relation -- (recurrence relation) <p>I'm trying to solve the following recurrence relation. I've gotten through two iterations, but I don't see any pattern. I would appreciate any help with this.</p>&#xA;&#xA;<p>$T(1)=1$</p>&#xA;&#xA;<p>$T(n)=6\ T(n/6)\ +\ 2n\ +\ 3$</p>&#xA;&#xA;<p>I've manually ran th...
habedi/stack-exchange-dataset