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
76,652
Generalized Büchi Automata - Formal definition of a state appearing infinitely often?
<p>I am studying generalized Büchi automata and I don't really understand when a state is considered to appear infinitely often. The definition I have is:</p>&#xA;&#xA;<p>A state $s$ appears infinitely often if there exists an infinite set of points $i \in N$ such that the $i$th state of the execution is $s$.</p>&#xA;&...
automata buchi automata
1
Generalized Büchi Automata - Formal definition of a state appearing infinitely often? -- (automata buchi automata) <p>I am studying generalized Büchi automata and I don't really understand when a state is considered to appear infinitely often. The definition I have is:</p>&#xA;&#xA;<p>A state $s$ appears infinitely oft...
habedi/stack-exchange-dataset
76,660
Lambda calculus :difficulty in getting hang of induction and conversion
<p>I am going through the book on lambda calculus by Hindley and Seldin .&#xA;They introduce the syntactic equivalence of expressions and proving them by a technique named &quot;induction&quot; , which has not been directly defined in the book .</p>&#xA;<blockquote>&#xA;<p>(a) <span class="math-container">$[N/x]x \equi...
lambda calculus
1
Lambda calculus :difficulty in getting hang of induction and conversion -- (lambda calculus) <p>I am going through the book on lambda calculus by Hindley and Seldin .&#xA;They introduce the syntactic equivalence of expressions and proving them by a technique named &quot;induction&quot; , which has not been directly def...
habedi/stack-exchange-dataset
76,663
Need clarification about the use of Big-O to describe matrix sparsity
<p>In one of my courses, Big-O notation was used for defining what a sparse matrix is, under the context of qualifying for suitability for a particular set of linear algebra algorithms. I looked around on the net, and only found more such uses that I have an issue with.</p>&#xA;&#xA;<p>To say a matrix is sparse if it h...
graphs matrices sparse matrices
1
Need clarification about the use of Big-O to describe matrix sparsity -- (graphs matrices sparse matrices) <p>In one of my courses, Big-O notation was used for defining what a sparse matrix is, under the context of qualifying for suitability for a particular set of linear algebra algorithms. I looked around on the net,...
habedi/stack-exchange-dataset
76,666
Efficient Algorithm for determining who wins a game of Chess
<p>I was reading Jeff E's lecture notes on Algorithms when I came upon the following question:</p>&#xA;&#xA;<p>Describe and analyze an efficient algorithm that determines, given a legal arrangement of&#xA;standard pieces on a standard chess board, which player will win at chess from the given&#xA;starting position if b...
algorithms graphs
1
Efficient Algorithm for determining who wins a game of Chess -- (algorithms graphs) <p>I was reading Jeff E's lecture notes on Algorithms when I came upon the following question:</p>&#xA;&#xA;<p>Describe and analyze an efficient algorithm that determines, given a legal arrangement of&#xA;standard pieces on a standard c...
habedi/stack-exchange-dataset
76,672
Flow Problem in Tripartite Graph
<p>Given a Directed Tripartite graph with 3 Groups of vertices {A, B, C} such that:</p>&#xA;&#xA;<ol>&#xA;<li>Edges from A are directed in B.</li>&#xA;<li>Edges from B are directed in C.</li>&#xA;</ol>&#xA;&#xA;<p>Objective: Minimize the number of vertices in B (by keeping few and deleting the rest) such that every ver...
algorithms graphs
1
Flow Problem in Tripartite Graph -- (algorithms graphs) <p>Given a Directed Tripartite graph with 3 Groups of vertices {A, B, C} such that:</p>&#xA;&#xA;<ol>&#xA;<li>Edges from A are directed in B.</li>&#xA;<li>Edges from B are directed in C.</li>&#xA;</ol>&#xA;&#xA;<p>Objective: Minimize the number of vertices in B (b...
habedi/stack-exchange-dataset
76,681
Edge Constraint satisfaction in a Directed Graph Path?
<p>Given a directed Graph and two vertices $S$ and $D$ (source and destination) such that each of its edges has a weight of the form:</p>&#xA;&#xA;<p>$A_i+B_ix_i = V$</p>&#xA;&#xA;<p>where $A_0$ is a non negative integer, $B_0$ is a positive integer, $x_i$ a variable that can take non negative integer values (each vari...
algorithms graphs
1
Edge Constraint satisfaction in a Directed Graph Path? -- (algorithms graphs) <p>Given a directed Graph and two vertices $S$ and $D$ (source and destination) such that each of its edges has a weight of the form:</p>&#xA;&#xA;<p>$A_i+B_ix_i = V$</p>&#xA;&#xA;<p>where $A_0$ is a non negative integer, $B_0$ is a positive ...
habedi/stack-exchange-dataset
76,682
Understanding of SPACE in non deterministic Turing Machines
<p>Let's consider the following situation.&#xA;We have a finitie alphabet $A$. Let $A = \{a_1, .., a_k\}$ We consider words over $A$ of length exactly $n$.&#xA;I am trying to solve some problem and I am going to:</p>&#xA;&#xA;<p>Generate every word using non-deterministic Turing Machine. And, for every generated word m...
turing machines space complexity nondeterminism
1
Understanding of SPACE in non deterministic Turing Machines -- (turing machines space complexity nondeterminism) <p>Let's consider the following situation.&#xA;We have a finitie alphabet $A$. Let $A = \{a_1, .., a_k\}$ We consider words over $A$ of length exactly $n$.&#xA;I am trying to solve some problem and I am goin...
habedi/stack-exchange-dataset
76,691
Devise algorithm to travel destinations in a way that you always have enough money for the next destination (getting paid at each destination as well)
<p>This problem probably falls under some category of algorithms but I don't know which.</p>&#xA;&#xA;<blockquote>&#xA; <p>A given restaurant has $b_1..b_n$ branches around the world. A food critic has to travel all of the branches. </p>&#xA; &#xA; <ol>&#xA; <li>When the critic finishes visit to the branch $1 \le j...
algorithms time complexity priority queues
1
Devise algorithm to travel destinations in a way that you always have enough money for the next destination (getting paid at each destination as well) -- (algorithms time complexity priority queues) <p>This problem probably falls under some category of algorithms but I don't know which.</p>&#xA;&#xA;<blockquote>&#xA; ...
habedi/stack-exchange-dataset
76,692
CPU cache - retrieving data from memory
<p>Regarding CPU cache, if the CPU does not find the data it needs in the cache, I understand it then looks for it in the main memory (RAM). (Let's assume we have only one level of cache in order to keep this question as simple as possible.)</p>&#xA;&#xA;<p>My question is this: if the data is found in main memory, what...
computer architecture cpu cache memory management cpu
1
CPU cache - retrieving data from memory -- (computer architecture cpu cache memory management cpu) <p>Regarding CPU cache, if the CPU does not find the data it needs in the cache, I understand it then looks for it in the main memory (RAM). (Let's assume we have only one level of cache in order to keep this question as ...
habedi/stack-exchange-dataset
76,693
Complexity for checking if an array is a min-d-heap
<p><strong>The problem is this</strong>: Let us have an int array of length n. Find an algorithm to determine if the array represents a min-d-heap.</p>&#xA;&#xA;<p><strong>My solution</strong>: We start from the first index in the array, and compare its value to the value of its children (all the nodes at locations $i*...
algorithm analysis data structures heaps
1
Complexity for checking if an array is a min-d-heap -- (algorithm analysis data structures heaps) <p><strong>The problem is this</strong>: Let us have an int array of length n. Find an algorithm to determine if the array represents a min-d-heap.</p>&#xA;&#xA;<p><strong>My solution</strong>: We start from the first inde...
habedi/stack-exchange-dataset
76,700
Throwing an error when initializing an object in c++
<p>Let's say that when initializing a pet class, I wanted to exclude or disallow dogs or cats as species. What would be the proper way to throw an invalid_argument exception?</p>&#xA;&#xA;<pre><code>using std::string;&#xA;#include &lt;stdexcept&gt;&#xA;using std:: invalid_argument;&#xA;struct Pet {&#xA; const string n...
data structures
1
Throwing an error when initializing an object in c++ -- (data structures) <p>Let's say that when initializing a pet class, I wanted to exclude or disallow dogs or cats as species. What would be the proper way to throw an invalid_argument exception?</p>&#xA;&#xA;<pre><code>using std::string;&#xA;#include &lt;stdexcept&g...
habedi/stack-exchange-dataset
76,709
What's the difference between a calculus and a programming language?
<p>I think I'm pretty confused about what's called a calculus and what's called a programming language.</p>&#xA;&#xA;<p>I tend to think, and might have been told, that a calculus is a formal system for reasoning about the equivalence of programs. Programs have an operational semantics specified by a machine, that shoul...
terminology programming languages lambda calculus semantics operational semantics
1
What's the difference between a calculus and a programming language? -- (terminology programming languages lambda calculus semantics operational semantics) <p>I think I'm pretty confused about what's called a calculus and what's called a programming language.</p>&#xA;&#xA;<p>I tend to think, and might have been told, t...
habedi/stack-exchange-dataset
76,716
Is the langauge of (descriptions of) DFAs that accept $\Sigma^*$ decidable?
<p>Is $L = \{\langle A\rangle\mid A\text{ is a DFA and }L(A) = \Sigma^*\}$ decidable?</p>&#xA;&#xA;<p>I know that $L'=\{\langle A,w\rangle \mid A\text{ is a DFA and }w\in L(A)\}$ is decidable, but I'm not sure if this is related.</p>&#xA;
computability automata
1
Is the langauge of (descriptions of) DFAs that accept $\Sigma^*$ decidable? -- (computability automata) <p>Is $L = \{\langle A\rangle\mid A\text{ is a DFA and }L(A) = \Sigma^*\}$ decidable?</p>&#xA;&#xA;<p>I know that $L'=\{\langle A,w\rangle \mid A\text{ is a DFA and }w\in L(A)\}$ is decidable, but I'm not sure if thi...
habedi/stack-exchange-dataset
76,726
How to compare computational complexity of algorithms
<p>I have three different algorithms for achieving a target. Algorithm 1 takes $O(Mn)$ - $M$ is constsnt and n is variable,Algorithm 2 takes $O(min(p^3,n^3))$ - both $p$ and $n$ is variable and Algorithm 3 takes $O(nk+nd)$ - $k$ constant, $n$ and $d$ is variable. Is it possible to compare these algorithms? Which algori...
algorithm analysis landau notation
1
How to compare computational complexity of algorithms -- (algorithm analysis landau notation) <p>I have three different algorithms for achieving a target. Algorithm 1 takes $O(Mn)$ - $M$ is constsnt and n is variable,Algorithm 2 takes $O(min(p^3,n^3))$ - both $p$ and $n$ is variable and Algorithm 3 takes $O(nk+nd)$ - $...
habedi/stack-exchange-dataset
76,727
Operating system maintains copy of page table for each process
<p>I am quoting a paragraph in <em>Operating System Concepts</em> by Silberschatz, in paging chapter,</p>&#xA;&#xA;<blockquote>&#xA; <p>In addition, the operating system must be aware that user processes operate&#xA; in user space, and all logical addresses must be mapped to produce physical&#xA; addresses. If a use...
operating systems paging
1
Operating system maintains copy of page table for each process -- (operating systems paging) <p>I am quoting a paragraph in <em>Operating System Concepts</em> by Silberschatz, in paging chapter,</p>&#xA;&#xA;<blockquote>&#xA; <p>In addition, the operating system must be aware that user processes operate&#xA; in user ...
habedi/stack-exchange-dataset
76,749
Computational complexity of finding a spanning tree in planar hybergraphs
<p>Using a bipartite graph to represent hypergraphs as described by Wikipedia :</p>&#xA;&#xA;<blockquote>&#xA; <p>A hypergraph <span class="math-container">$H$</span> may be represented by a bipartite graph <span class="math-container">$BG$</span> as follows:&#xA; the sets <span class="math-container">$X$</span> and ...
complexity theory graphs np complete spanning trees
1
Computational complexity of finding a spanning tree in planar hybergraphs -- (complexity theory graphs np complete spanning trees) <p>Using a bipartite graph to represent hypergraphs as described by Wikipedia :</p>&#xA;&#xA;<blockquote>&#xA; <p>A hypergraph <span class="math-container">$H$</span> may be represented by...
habedi/stack-exchange-dataset
76,750
What runtime complexity if DNF formula not PAC-learnable, $O(2^N)$ or $O(2^{2^N})$ runtime?
<p>Valiant's theory of PAC learning looks at the tradeoff between expected error and algorithm runtime in different classes of learning problems. In particular, a lot of his analysis focuses on which classes of disjunctive normal form (DNF) formulae are learnable in polynomial time while minimizing expected error (PAC...
machine learning
1
What runtime complexity if DNF formula not PAC-learnable, $O(2^N)$ or $O(2^{2^N})$ runtime? -- (machine learning) <p>Valiant's theory of PAC learning looks at the tradeoff between expected error and algorithm runtime in different classes of learning problems. In particular, a lot of his analysis focuses on which class...
habedi/stack-exchange-dataset
76,762
When is a variable bound or free in a lambda application?
<p>I am currently reading the book &quot;An Introduction to Functional Programming through Lambda Calculus&quot; (the 2011 edition) and am a bit puzzled by the definitions of free and bound variables with regards to function application.</p>&#xA;<p>The book states, in section 2.10, that a variable is <strong>bound</str...
lambda calculus variable binding
1
When is a variable bound or free in a lambda application? -- (lambda calculus variable binding) <p>I am currently reading the book &quot;An Introduction to Functional Programming through Lambda Calculus&quot; (the 2011 edition) and am a bit puzzled by the definitions of free and bound variables with regards to function...
habedi/stack-exchange-dataset
76,763
What is a fixpoint?
<p>Could someone please explain me, what is a fix point? </p>&#xA;&#xA;<p>I caught the minimum explanation about fix point from <a href="https://www.schoolofhaskell.com/user/bartosz/understanding-algebras" rel="noreferrer">the website</a>:</p>&#xA;&#xA;<blockquote>&#xA; <p>After infinitely many iterations we should ...
terminology type theory fixed point
1
What is a fixpoint? -- (terminology type theory fixed point) <p>Could someone please explain me, what is a fix point? </p>&#xA;&#xA;<p>I caught the minimum explanation about fix point from <a href="https://www.schoolofhaskell.com/user/bartosz/understanding-algebras" rel="noreferrer">the website</a>:</p>&#xA;&#xA;<blo...
habedi/stack-exchange-dataset
76,767
Recognizability of $\left\{ \left\langle M\right\rangle |M\text{ is a TM and }A_{TM}\leq\mathcal{L}\left(M\right)\right\} $
<blockquote>&#xA; <p>Determine whether the following language is decidable, recognizable but not decidable, co-recognizable but not decidable or neither recognizable nor co-recognizable. Prove your answer.&#xA; $$L=\left\{ \left\langle M\right\rangle |M\text{ is a TM and }A_{TM}\leq\mathcal{L}\left(M\right)\right\} $...
computability reductions decision problem semi decidability
1
Recognizability of $\left\{ \left\langle M\right\rangle |M\text{ is a TM and }A_{TM}\leq\mathcal{L}\left(M\right)\right\} $ -- (computability reductions decision problem semi decidability) <blockquote>&#xA; <p>Determine whether the following language is decidable, recognizable but not decidable, co-recognizable but no...
habedi/stack-exchange-dataset
76,768
Decide whether a DFA accepts at least two strings
<p>Is the following language decidable? $$L = \{A : \text{A is a DFA and } |L(A)| \ge 2\}$$</p>&#xA;
turing machines finite automata undecidability
1
Decide whether a DFA accepts at least two strings -- (turing machines finite automata undecidability) <p>Is the following language decidable? $$L = \{A : \text{A is a DFA and } |L(A)| \ge 2\}$$</p>&#xA;
habedi/stack-exchange-dataset
76,770
Is $L=\{\langle M \rangle|M$ makes more than 10 steps on some input$\}$ decidable?
<p>I want to show that it satisfies Rice's theorem:</p>&#xA;&#xA;<p>(i) $L$ is non-trivial, since $\langle M\rangle \notin L$ where $L(M)=\emptyset$, as $M$ halts/rejects any input string in the first step.</p>&#xA;&#xA;<p>(ii) if $L(M_1)=L(M_2)$ where $M_1$ and $M_2$ are turing machines, then $M_1$ makes more than 10 ...
turing machines
1
Is $L=\{\langle M \rangle|M$ makes more than 10 steps on some input$\}$ decidable? -- (turing machines) <p>I want to show that it satisfies Rice's theorem:</p>&#xA;&#xA;<p>(i) $L$ is non-trivial, since $\langle M\rangle \notin L$ where $L(M)=\emptyset$, as $M$ halts/rejects any input string in the first step.</p>&#xA;&...
habedi/stack-exchange-dataset
76,787
Why is learning DNF harder than learning CNF?
<p>In the PAC-learning setting, it is easy to learn a CNF formula when we know each clause has at most $c$ variables.</p>&#xA;&#xA;<p>We go through each positive sample, and eliminate every clause that contradicts the sample.</p>&#xA;&#xA;<p>Learning a DNF formula is said to be much harder, but it seems a similar proce...
machine learning propositional logic
1
Why is learning DNF harder than learning CNF? -- (machine learning propositional logic) <p>In the PAC-learning setting, it is easy to learn a CNF formula when we know each clause has at most $c$ variables.</p>&#xA;&#xA;<p>We go through each positive sample, and eliminate every clause that contradicts the sample.</p>&#x...
habedi/stack-exchange-dataset
76,807
How to order the functions based on complexity $2^n$ vs $n^{\log n}$?
<p>How to order the functions $2^n$ vs $n^{\log n}$ based on their complexity?</p>&#xA;&#xA;<p>I found this question in a programming website (InterviewBit). But the answer given there, $n^{\log n}, 2^n$, does not seem convincing.</p>&#xA;&#xA;<p>The <a href="https://www.desmos.com/calculator/j7z3ntdkyq" rel="nofollow ...
asymptotics
1
How to order the functions based on complexity $2^n$ vs $n^{\log n}$? -- (asymptotics) <p>How to order the functions $2^n$ vs $n^{\log n}$ based on their complexity?</p>&#xA;&#xA;<p>I found this question in a programming website (InterviewBit). But the answer given there, $n^{\log n}, 2^n$, does not seem convincing.</p...
habedi/stack-exchange-dataset
76,818
Are all proof techniques which only look at black box behaviour of a TM relativizing?
<p>I am currently working on a seminar on $\mathbf{P \stackrel{?}{=} NP}$ and one of the points I want to adress is the Relativization barrier. </p>&#xA;&#xA;<p>However, it is hard to find a concrete definition of a "relativizing" proof. The best defintion I have found is as follows:&#xA;"A relativizing proof is any pr...
complexity theory turing machines proof techniques oracle machines relativization
1
Are all proof techniques which only look at black box behaviour of a TM relativizing? -- (complexity theory turing machines proof techniques oracle machines relativization) <p>I am currently working on a seminar on $\mathbf{P \stackrel{?}{=} NP}$ and one of the points I want to adress is the Relativization barrier. </p...
habedi/stack-exchange-dataset
76,821
How to tell if a spanning tree is a shortest-spanning tree of a DAG?
<p>I know how to calculate the shortest paths from source <code>s</code> to all other reachable vertices in a DAG (with no negative weight on the edges)</p>&#xA;&#xA;<p>By iterating the topological sort of the graph and <code>relax</code> each adjacent vertices. Which take <code>O(V+E)</code> </p>&#xA;&#xA;<p>However -...
graphs shortest path dag
1
How to tell if a spanning tree is a shortest-spanning tree of a DAG? -- (graphs shortest path dag) <p>I know how to calculate the shortest paths from source <code>s</code> to all other reachable vertices in a DAG (with no negative weight on the edges)</p>&#xA;&#xA;<p>By iterating the topological sort of the graph and <...
habedi/stack-exchange-dataset
76,834
What formal representation is commonly used to describe compiler optimizations?
<p>I have devised a compiler optimization that works on any structured language that has arrays assignments <code>array[index] = value</code> and counted loops <code>(for i = n; i &lt; N; i++) {doTHIS}</code> (*). </p>&#xA;&#xA;<p>Now I want to represent this optimization using some formal semantics. Since I want to pu...
formal languages compilers semantics program optimization operational semantics
1
What formal representation is commonly used to describe compiler optimizations? -- (formal languages compilers semantics program optimization operational semantics) <p>I have devised a compiler optimization that works on any structured language that has arrays assignments <code>array[index] = value</code> and counted l...
habedi/stack-exchange-dataset
76,839
Confusion converting BNF to regular expression
<p>I have a Computer Science A-Level exam tomorrow and I've been trying to get this question answered by my teacher but she's not been too helpful so asking here instead.</p>&#xA;&#xA;<p>In an exam question, I have the following BNF grammar, where <code>_</code> denotes a space.</p>&#xA;&#xA;<pre><code>&lt;fullname&gt;...
context free regular languages regular expressions
1
Confusion converting BNF to regular expression -- (context free regular languages regular expressions) <p>I have a Computer Science A-Level exam tomorrow and I've been trying to get this question answered by my teacher but she's not been too helpful so asking here instead.</p>&#xA;&#xA;<p>In an exam question, I have th...
habedi/stack-exchange-dataset
76,840
Conditions for Linear Diophantine Equations to always have a solution
<p>Given a set of $n$ linear equations in $v$ integer variables, where $v &gt; n$, we can say that this system of equations will always have an integer solution.</p>&#xA;&#xA;<p>Over $\mathbb N$, is there any such constraint that guarantees that a solution always exists? Or, if not, can it be tested in polynomial time?...
algorithm analysis linear algebra integer programming
1
Conditions for Linear Diophantine Equations to always have a solution -- (algorithm analysis linear algebra integer programming) <p>Given a set of $n$ linear equations in $v$ integer variables, where $v &gt; n$, we can say that this system of equations will always have an integer solution.</p>&#xA;&#xA;<p>Over $\mathbb...
habedi/stack-exchange-dataset
76,846
Updating the distances matrix after single edge was decreased
<p>I was reading <a href="https://stackoverflow.com/questions/4467884/updating-shortest-path-distances-matrix-if-one-edge-weight-is-decreased">this question</a> on how to update the distances matrix D of a graph after one edge was decreased, and I don't understand why it works:</p>&#xA;&#xA;<p>The answer suggests that ...
graphs
1
Updating the distances matrix after single edge was decreased -- (graphs) <p>I was reading <a href="https://stackoverflow.com/questions/4467884/updating-shortest-path-distances-matrix-if-one-edge-weight-is-decreased">this question</a> on how to update the distances matrix D of a graph after one edge was decreased, and ...
habedi/stack-exchange-dataset
76,847
What is the basic idea behind the usage of TLBs?
<p>I know how <strong>Translation Lookaside Buffers</strong> work, and i also know we use them to improve the <strong>performance of data/program access</strong> by storing the <strong>recent</strong> page numbers - frame numbers in a memory cache.&#xA;The problem is that i can't understand why <strong>frequent</strong...
operating systems memory hardware performance caching
1
What is the basic idea behind the usage of TLBs? -- (operating systems memory hardware performance caching) <p>I know how <strong>Translation Lookaside Buffers</strong> work, and i also know we use them to improve the <strong>performance of data/program access</strong> by storing the <strong>recent</strong> page number...
habedi/stack-exchange-dataset
76,865
Computational Complexity of Integer Linear Program [with Fixed number of 'Pure Constants']
<p>This is a follow up to the previous Question: <a href="https://cs.stackexchange.com/questions/76840/conditions-for-linear-diophantine-equations-to-always-have-a-solution">Conditions for Linear Diophantine Equations to always have a solution</a></p>&#xA;&#xA;<p>It was established in the above's answer that obtaining ...
algorithm analysis linear algebra integer programming
1
Computational Complexity of Integer Linear Program [with Fixed number of 'Pure Constants'] -- (algorithm analysis linear algebra integer programming) <p>This is a follow up to the previous Question: <a href="https://cs.stackexchange.com/questions/76840/conditions-for-linear-diophantine-equations-to-always-have-a-soluti...
habedi/stack-exchange-dataset
76,866
Prove $T$ is a BST iff for every node $x$ of $T$ that is not a leaf, the key of $x$ is larger or equal than the key of the left child of $x$
<blockquote>&#xA; <p>Let $T$ be a complete binary tree. Prove that $T$ is a binary search tree if and only if for every node $x$ of $T$ that is not a leaf, the key of $x$ is larger or equal than the key of the left child of $x$ or it is less than or equal than the key of the right child.</p>&#xA;</blockquote>&#xA;&#xA...
data structures proof techniques binary trees search trees
1
Prove $T$ is a BST iff for every node $x$ of $T$ that is not a leaf, the key of $x$ is larger or equal than the key of the left child of $x$ -- (data structures proof techniques binary trees search trees) <blockquote>&#xA; <p>Let $T$ be a complete binary tree. Prove that $T$ is a binary search tree if and only if for ...
habedi/stack-exchange-dataset
76,869
Find All permutation of String using Iteration
<p>How to find all permutation of a String in Iterative way ? </p>&#xA;&#xA;<h2>Code (Recursion) :</h2>&#xA;&#xA;<pre><code>private void permute(String str, int l, int r)&#xA;{&#xA; if (l == r)&#xA; System.out.println(str);&#xA; else&#xA; {&#xA; for (int i = l; i &lt;= r; i++)&#xA; {&#xA; ...
algorithms strings
1
Find All permutation of String using Iteration -- (algorithms strings) <p>How to find all permutation of a String in Iterative way ? </p>&#xA;&#xA;<h2>Code (Recursion) :</h2>&#xA;&#xA;<pre><code>private void permute(String str, int l, int r)&#xA;{&#xA; if (l == r)&#xA; System.out.println(str);&#xA; else&#x...
habedi/stack-exchange-dataset
76,890
which of the following languages are Recursively Enumerable?
<p>Which of the following languages are recursively enumerable?</p>&#xA;&#xA;<p>A={⟨M⟩∣ TM M accepts at most 2 distinct inputs}</p>&#xA;&#xA;<p>B={⟨M⟩∣ TM M accepts more than 2 distinct inputs}</p>&#xA;&#xA;<p>For first language I think that we can enumerate all the TM's which accept at most 2 distinct inputs using dov...
computability turing machines undecidability semi decidability
1
which of the following languages are Recursively Enumerable? -- (computability turing machines undecidability semi decidability) <p>Which of the following languages are recursively enumerable?</p>&#xA;&#xA;<p>A={⟨M⟩∣ TM M accepts at most 2 distinct inputs}</p>&#xA;&#xA;<p>B={⟨M⟩∣ TM M accepts more than 2 distinct input...
habedi/stack-exchange-dataset
76,894
determining whether a program halts or not
<p>I have difficulty understanding the halting problem. I know that for all possible Turing machines and strings w, we don't have a Turing machine which can decide whether a TM M halts on input w.Now my problem is that if we have a program p that for example solves the Hamiltonian path problem can we conclude from the ...
np complete undecidability decision problem halting problem
1
determining whether a program halts or not -- (np complete undecidability decision problem halting problem) <p>I have difficulty understanding the halting problem. I know that for all possible Turing machines and strings w, we don't have a Turing machine which can decide whether a TM M halts on input w.Now my problem i...
habedi/stack-exchange-dataset
76,899
How to solve a knapsack problem with increased weight limit?
<p>Let us consider the knapsack problem. Given a set $P$ of $n$ items where each item has weight $w_i$ and value $v_i$ for all $i=1,2,\ldots,n$. We have two bins, one has a weight limit of $W$ and the other has a weight limit of $W'=2W$. Assume that we have an optimal algorithm $\texttt{OPT}$ that solves the knapsack p...
algorithms lower bounds upper bound
1
How to solve a knapsack problem with increased weight limit? -- (algorithms lower bounds upper bound) <p>Let us consider the knapsack problem. Given a set $P$ of $n$ items where each item has weight $w_i$ and value $v_i$ for all $i=1,2,\ldots,n$. We have two bins, one has a weight limit of $W$ and the other has a weigh...
habedi/stack-exchange-dataset
76,912
How can I calculate the new quotient if I came to know divisor is increased by one?
<p>If I have two number consider <strong>a</strong> and <strong>b</strong> and let their division quotient is <strong>c</strong>.&#xA;I know the value of <strong>c</strong> but I don't know either value of <strong>divided</strong>(a) or <strong>divisor</strong>(b). If I came to know the value of divisor is increased by...
discrete mathematics mathematical programming
1
How can I calculate the new quotient if I came to know divisor is increased by one? -- (discrete mathematics mathematical programming) <p>If I have two number consider <strong>a</strong> and <strong>b</strong> and let their division quotient is <strong>c</strong>.&#xA;I know the value of <strong>c</strong> but I don't ...
habedi/stack-exchange-dataset
76,919
Rod Cutting without using dynamic approach
<h2>Question</h2>&#xA;&#xA;<p>I want to Implement Rod cutting Algorithm without Dynamic Programming Approach.</p>&#xA;&#xA;<p>Let me Describe the problem statement.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a rod of length $n$ inches and a table of prices $p_{i}$ for $i=1,2,3,4,\,.\,.\,.$ determine the maximum revenue $...
algorithms dynamic programming recursion
1
Rod Cutting without using dynamic approach -- (algorithms dynamic programming recursion) <h2>Question</h2>&#xA;&#xA;<p>I want to Implement Rod cutting Algorithm without Dynamic Programming Approach.</p>&#xA;&#xA;<p>Let me Describe the problem statement.</p>&#xA;&#xA;<blockquote>&#xA; <p>Given a rod of length $n$ inche...
habedi/stack-exchange-dataset
76,931
Is there a polynomial time algorithm to determine whether an 'up down' language is 'emptible'?
<p><b>Definitions:</b></p>&#xA;&#xA;<p>An up down language is a language whose alphabet is a set of <b>pairs</b>, but not characters, of two characters, where the one character in the pair is the opposite of the other character in the pair.</p>&#xA;&#xA;<p>Each word in the language is concatenation of some characters f...
time complexity space complexity greedy algorithms search problem search
1
Is there a polynomial time algorithm to determine whether an 'up down' language is 'emptible'? -- (time complexity space complexity greedy algorithms search problem search) <p><b>Definitions:</b></p>&#xA;&#xA;<p>An up down language is a language whose alphabet is a set of <b>pairs</b>, but not characters, of two charac...
habedi/stack-exchange-dataset
76,934
prove that NDFA = {< M1,M2 > | M1 and M2 are DFAs such that there is at least one string x that is accepted by neither M1 nor M2} is decidable?
<p>How can I prove that $NDFA = \{ \langle M_1,M_2 \rangle | M_1$ and $M_2$ are $DFA$s such that there is at least one string $x$ that is accepted by neither $M_1$ nor $M_2\}$ is decidable using the fact that $ANFA = \{\langle N \rangle | N$ is an $NFA$ with some input alphabet $\Sigma$, and $L(N) = \Sigma^*\}$?</p>&#x...
turing machines finite automata undecidability
1
prove that NDFA = {< M1,M2 > | M1 and M2 are DFAs such that there is at least one string x that is accepted by neither M1 nor M2} is decidable? -- (turing machines finite automata undecidability) <p>How can I prove that $NDFA = \{ \langle M_1,M_2 \rangle | M_1$ and $M_2$ are $DFA$s such that there is at least one strin...
habedi/stack-exchange-dataset
76,939
What is a good approach to symbol identification/recognition given a path, instead of raster data
<p>Excuse any mistakes in my description as I'm new to ML. But I have an application that takes user input to generate paths/curves (All symbols are single paths) and I would then like to attempt identification. This seems, generally, to be a pretty well studied problem, and there is a lot of reference I can find.</p>&...
machine learning classification pattern recognition
1
What is a good approach to symbol identification/recognition given a path, instead of raster data -- (machine learning classification pattern recognition) <p>Excuse any mistakes in my description as I'm new to ML. But I have an application that takes user input to generate paths/curves (All symbols are single paths) an...
habedi/stack-exchange-dataset
76,943
Estimating probability from generative model
<p>Assume that we have access to a generative model $G$, that takes as input a state-action pair $(s,a)$ and outputs a sample consisting of a successor state-observation pair $(s',o)$, that is, $(s',o)\sim G(s,a)$.</p>&#xA;&#xA;<p>It can be assumed that the states, actions, and observations all take on a finite number ...
probability theory
1
Estimating probability from generative model -- (probability theory) <p>Assume that we have access to a generative model $G$, that takes as input a state-action pair $(s,a)$ and outputs a sample consisting of a successor state-observation pair $(s',o)$, that is, $(s',o)\sim G(s,a)$.</p>&#xA;&#xA;<p>It can be assumed th...
habedi/stack-exchange-dataset
76,953
Maximum cut using a 1/2 approximation greedy algorithm
<p>I have the following greedy algorithm for max cut problem: </p>&#xA;&#xA;<ol>&#xA;<li>Initialization: $A \leftarrow \{v_1\}$ , $B \leftarrow \{v_2\}$</li>&#xA;<li><p>For $v \in V − \{v_1, v_2\}$ do:</p>&#xA;&#xA;<p>if $d(v,A) \geq d(v,B)$ then $B \leftarrow B \cup \{v\}$,</p>&#xA;&#xA;<p>else $A \leftarrow A \cup \{...
approximation greedy algorithms max cut
1
Maximum cut using a 1/2 approximation greedy algorithm -- (approximation greedy algorithms max cut) <p>I have the following greedy algorithm for max cut problem: </p>&#xA;&#xA;<ol>&#xA;<li>Initialization: $A \leftarrow \{v_1\}$ , $B \leftarrow \{v_2\}$</li>&#xA;<li><p>For $v \in V − \{v_1, v_2\}$ do:</p>&#xA;&#xA;<p>if...
habedi/stack-exchange-dataset
76,954
single tape NTM to single tape DTM equivalence
<p>I am having some trouble understanding the equivalence of DTM's and NTM's.&#xA;If you have Sipser its under 7.11; where he says that any NTM $N$ that halts after $t(n)$ steps has an equivalent DTM $D$ that halts after $2^{O(t(n))}$ &#xA;steps.</p>&#xA;&#xA;<p>He says that $N$ 's "computation tree" has at most $b^{t...
turing machines time complexity nondeterminism
1
single tape NTM to single tape DTM equivalence -- (turing machines time complexity nondeterminism) <p>I am having some trouble understanding the equivalence of DTM's and NTM's.&#xA;If you have Sipser its under 7.11; where he says that any NTM $N$ that halts after $t(n)$ steps has an equivalent DTM $D$ that halts after ...
habedi/stack-exchange-dataset
76,960
Formal Languages - Matching this regular expression
<p>I'm trying to write a regular expression over the alphabet {0,1,2} for the language in which every 1 is preceded by 0. For example 2200201010, 01022020102012 are strings of the language. </p>&#xA;&#xA;<p>I've tried with this:</p>&#xA;&#xA;<pre><code>(0+2)*(01)*(0+2)*(01)*(0+2)*&#xA;</code></pre>&#xA;&#xA;<p>, where ...
formal languages regular expressions
1
Formal Languages - Matching this regular expression -- (formal languages regular expressions) <p>I'm trying to write a regular expression over the alphabet {0,1,2} for the language in which every 1 is preceded by 0. For example 2200201010, 01022020102012 are strings of the language. </p>&#xA;&#xA;<p>I've tried with thi...
habedi/stack-exchange-dataset
76,961
Addition modulo 2 notation (Quantum Computing)
<p>I am studying Quantum Computing using the book Quantum Computation and Quantum Information of Michael Nielsen and Isaac Chuang. I am confused by the meaning of the $\oplus$ (addition modulo 2) symbol in the notation.</p>&#xA;&#xA;<p>Given a starting state $|\psi\rangle|\phi\rangle$ and a unitary gate $U$ such that $...
quantum computing notation
1
Addition modulo 2 notation (Quantum Computing) -- (quantum computing notation) <p>I am studying Quantum Computing using the book Quantum Computation and Quantum Information of Michael Nielsen and Isaac Chuang. I am confused by the meaning of the $\oplus$ (addition modulo 2) symbol in the notation.</p>&#xA;&#xA;<p>Given...
habedi/stack-exchange-dataset
76,964
If $L$ is NOT Turing-recognizable, does that mean that super sets with $L$ are also not?
<p>Suppose there is a language $L$ that is not Turing-recognizable. Now suppose, for every word in $L$, you would concatenate a "0" as prefix, resulting in $L' = \{0w | w \in L\}$. Does this mean that $L'$ is also not Turing-recognizable?</p>&#xA;&#xA;<p>I would argue that $L'$ is also not Turing-recognizable:</p>&#xA;...
turing machines automata
1
If $L$ is NOT Turing-recognizable, does that mean that super sets with $L$ are also not? -- (turing machines automata) <p>Suppose there is a language $L$ that is not Turing-recognizable. Now suppose, for every word in $L$, you would concatenate a "0" as prefix, resulting in $L' = \{0w | w \in L\}$. Does this mean that ...
habedi/stack-exchange-dataset
76,966
Multi-threading : N cores = N times one core?
<p>This question is about modern CPU architectures and multi-threading. I'm mainly interested in personal computers or servers having 2, 4, 8, 16... cores like for example an Intel core i7. I mean not a NASA supercomputer or GPU vector processing.</p>&#xA;&#xA;<p>You have N cores.</p>&#xA;&#xA;<p>You write an algorithm...
computer architecture cpu threads
1
Multi-threading : N cores = N times one core? -- (computer architecture cpu threads) <p>This question is about modern CPU architectures and multi-threading. I'm mainly interested in personal computers or servers having 2, 4, 8, 16... cores like for example an Intel core i7. I mean not a NASA supercomputer or GPU vector...
habedi/stack-exchange-dataset
76,980
"Insensitive" CNF/DNF SAT always satisfying same number of clauses
<p>I came across <a href="https://www.ti.inf.ethz.ch/ew/lehre/SAT14/spa1.pdf" rel="nofollow noreferrer">this paper</a>, which mentions an interesting variation on SAT:</p>&#xA;&#xA;<blockquote>&#xA; <p>We call a CNF formula F <strong>insensitive</strong> if every total assignment α satisfies the same number of clauses...
np satisfiability co np
1
"Insensitive" CNF/DNF SAT always satisfying same number of clauses -- (np satisfiability co np) <p>I came across <a href="https://www.ti.inf.ethz.ch/ew/lehre/SAT14/spa1.pdf" rel="nofollow noreferrer">this paper</a>, which mentions an interesting variation on SAT:</p>&#xA;&#xA;<blockquote>&#xA; <p>We call a CNF formula...
habedi/stack-exchange-dataset
76,987
IP Fragmentation
<p>I have an IPv4 packet, 3523 byte of information Data a MTU (maximum transmission unit) of 516 (496 byte + 20 byte IP header), also an TCP header with 20 byte.</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/n267W.png" alt="IPv4 packet with 8 Datagrams"></p>&#xA;&#xA;<p>How does this result is created from the ab...
computer networks communication protocols
1
IP Fragmentation -- (computer networks communication protocols) <p>I have an IPv4 packet, 3523 byte of information Data a MTU (maximum transmission unit) of 516 (496 byte + 20 byte IP header), also an TCP header with 20 byte.</p>&#xA;&#xA;<p><img src="https://i.stack.imgur.com/n267W.png" alt="IPv4 packet with 8 Datagra...
habedi/stack-exchange-dataset
76,992
Alternative way of proving a language is $NP$
<p>I would like to show a language $A$ is in $NP$.</p>&#xA;&#xA;<p>I can find a TM for $A$, but I wanted to try a different approach and see if it is correct.</p>&#xA;&#xA;<p>Let $B$ be a known problem in $NP$. If I show a polynomial time reduction $A \leq B$, will this imply $A\in NP$?</p>&#xA;&#xA;<p>I believe it wil...
reductions np
1
Alternative way of proving a language is $NP$ -- (reductions np) <p>I would like to show a language $A$ is in $NP$.</p>&#xA;&#xA;<p>I can find a TM for $A$, but I wanted to try a different approach and see if it is correct.</p>&#xA;&#xA;<p>Let $B$ be a known problem in $NP$. If I show a polynomial time reduction $A \le...
habedi/stack-exchange-dataset
76,998
Is the ability to do depth first search a proof of Turing Completeness? Can we write a non-TC automaton that does DFS?
<p>As the title states. Let's say we have a set of inputs that define a tree structure. Is it possible to construct an automaton that can perform depth-first search on this data that is not Turing-complete? If so, can we state that the ability to do DFS a sufficient proof of Turing-completeness?</p>&#xA;&#xA;<p>For the...
search algorithms computation models turing completeness
1
Is the ability to do depth first search a proof of Turing Completeness? Can we write a non-TC automaton that does DFS? -- (search algorithms computation models turing completeness) <p>As the title states. Let's say we have a set of inputs that define a tree structure. Is it possible to construct an automaton that can p...
habedi/stack-exchange-dataset
77,008
Find all intervals that are contained in a query interval
<p>Given a set of intervals $S = I_1, ..., I_n$, what is the fastest way to find all intervals of $S$ that are completely contained in an interval $I_\text{query}$? It should also support incremental (dynamic) insertion of new intervals to $S$.</p>&#xA;&#xA;<p><a href="https://en.wikipedia.org/wiki/Interval_tree" rel="...
data structures trees search algorithms search problem intervals
1
Find all intervals that are contained in a query interval -- (data structures trees search algorithms search problem intervals) <p>Given a set of intervals $S = I_1, ..., I_n$, what is the fastest way to find all intervals of $S$ that are completely contained in an interval $I_\text{query}$? It should also support incr...
habedi/stack-exchange-dataset
77,019
Return destinations for an expression-oriented programming language
<p>I am designing a programming language and I want to give everything the ability to return a value. For example, if I use a block as a right-hand side value, I can assign it to a lvalue:</p>&#xA;&#xA;<pre><code>sum := {&#xA; if (a &lt; 0) { a := -a; }&#xA; if (b &lt; 0) { b := -b; }&#xA; return a + b;&#xA;};...
programming languages language design
1
Return destinations for an expression-oriented programming language -- (programming languages language design) <p>I am designing a programming language and I want to give everything the ability to return a value. For example, if I use a block as a right-hand side value, I can assign it to a lvalue:</p>&#xA;&#xA;<pre><c...
habedi/stack-exchange-dataset
77,021
I do not know if my algorithm complexity is $P$, $NP$ or $NP-hard$?
<p>I developed an algorithm but just not sure what is the complexity of the algorithm. I provide a brief description of it below:</p>&#xA;&#xA;<p>"For $N$ user case, there are $B(N)$ Decision Variables. $B(N)$ is Bell Number, for those of you who are not familiar with Bell Numbers please be noted that $B(N)$ grows expo...
complexity theory np hard np
1
I do not know if my algorithm complexity is $P$, $NP$ or $NP-hard$? -- (complexity theory np hard np) <p>I developed an algorithm but just not sure what is the complexity of the algorithm. I provide a brief description of it below:</p>&#xA;&#xA;<p>"For $N$ user case, there are $B(N)$ Decision Variables. $B(N)$ is Bell ...
habedi/stack-exchange-dataset
77,043
Can literals in functional languages be thought of as functions from the empty type?
<p>A while ago, I think on Stack Overflow, I saw someone say that Haskell literals can be thought of as functions that don't operate on anything. This makes sense to me but I remember someone else vehemently disagreeing with him.</p>&#xA;&#xA;<p>If I understand correctly, all values in primitive types, or at least thos...
type theory functional programming
1
Can literals in functional languages be thought of as functions from the empty type? -- (type theory functional programming) <p>A while ago, I think on Stack Overflow, I saw someone say that Haskell literals can be thought of as functions that don't operate on anything. This makes sense to me but I remember someone els...
habedi/stack-exchange-dataset
77,047
What is the practical purpose of an epsilon NFA?
<p>If for every $\epsilon$-NFA their exists an equivalent NFA what is the purpose of ever using an $\epsilon$-NFA? I am having trouble understanding what the practical purpose of using one would be.</p>&#xA;
formal languages finite automata
1
What is the practical purpose of an epsilon NFA? -- (formal languages finite automata) <p>If for every $\epsilon$-NFA their exists an equivalent NFA what is the purpose of ever using an $\epsilon$-NFA? I am having trouble understanding what the practical purpose of using one would be.</p>&#xA;
habedi/stack-exchange-dataset
77,057
Reduction from Clique-6 to Clique-3
<p>Recall that $G$ has a clique of size $k$ if it has a complete sub graph consisting of $k$ vertices. </p>&#xA;&#xA;<p>Let us define the problem $Clique-k$ as follows: &#xA;$$\{ \langle G \rangle \mid G \text{ is an undirected graph that contains a clique of size } k\}$$</p>&#xA;&#xA;<hr>&#xA;&#xA;<p><strong>Question...
complexity theory reductions clique
1
Reduction from Clique-6 to Clique-3 -- (complexity theory reductions clique) <p>Recall that $G$ has a clique of size $k$ if it has a complete sub graph consisting of $k$ vertices. </p>&#xA;&#xA;<p>Let us define the problem $Clique-k$ as follows: &#xA;$$\{ \langle G \rangle \mid G \text{ is an undirected graph that cont...
habedi/stack-exchange-dataset
77,058
warm/neutral/cool tone of one image
<p>I wanna determine whether an image belongs to warm/neutral/cool tone. I find Kelvin color temperature to calculate the average temperature of an image over all piexls. But the result seems not good. Can anybody point in the right direction to determine the tone of one image?</p>&#xA;
image processing colorings
1
warm/neutral/cool tone of one image -- (image processing colorings) <p>I wanna determine whether an image belongs to warm/neutral/cool tone. I find Kelvin color temperature to calculate the average temperature of an image over all piexls. But the result seems not good. Can anybody point in the right direction to determ...
habedi/stack-exchange-dataset
77,060
Conflict Detection Algorithm
<p>I have been trying to come up with a better algorithm that detects conflicts in the scenarios below.</p>&#xA;&#xA;<p>Let's say we have 4 dancers. We pair them up and find out which ones can dance together. So, we have the dancer # combination and whether they can dance together or not. </p>&#xA;&#xA;<pre><code>(1,2)...
algorithms search algorithms decision problem
1
Conflict Detection Algorithm -- (algorithms search algorithms decision problem) <p>I have been trying to come up with a better algorithm that detects conflicts in the scenarios below.</p>&#xA;&#xA;<p>Let's say we have 4 dancers. We pair them up and find out which ones can dance together. So, we have the dancer # combin...
habedi/stack-exchange-dataset
77,064
Validity of list of articulation points in a graph after a node is deleted
<p>Say I have a bidirectional graph <code>G</code> and I have the list of articulation points and bridges of this graph. Say, the list of articulation points is <code>ap[]</code> and the list of bridges are <code>bridges[]</code>. Now, if I remove a node which does not belong to the list of <code>ap[]</code>, meaning, ...
graphs
1
Validity of list of articulation points in a graph after a node is deleted -- (graphs) <p>Say I have a bidirectional graph <code>G</code> and I have the list of articulation points and bridges of this graph. Say, the list of articulation points is <code>ap[]</code> and the list of bridges are <code>bridges[]</code>. No...
habedi/stack-exchange-dataset
77,067
Why do we need increase_key procedure in max priority queue?
<p>Since if I want to increase the priority of a specific node, how do I find the node without linear searching it.</p>&#xA;&#xA;<p>I need to pass the index to this function, which is in a way a bottleneck. So the question is, how can I avoid it? Or exactly this data structure doesn't provide any solution for this prob...
algorithms data structures priority queues
1
Why do we need increase_key procedure in max priority queue? -- (algorithms data structures priority queues) <p>Since if I want to increase the priority of a specific node, how do I find the node without linear searching it.</p>&#xA;&#xA;<p>I need to pass the index to this function, which is in a way a bottleneck. So t...
habedi/stack-exchange-dataset
77,090
Reccurence $T(n) = \sqrt{n}T(\sqrt{n})+n$
<p>Note: this is from JeffE's Algorithms notes on Recurrences, page 5.</p>&#xA;&#xA;<p>(1). So we define the recurrence $T(n) = \sqrt{n}T(\sqrt{n})+n$ without any base case. Now I understand that for most recurrences, since we're looking for asymptotic bounds, the base case wouldn't matter. But in this case, I don't ev...
recurrence relation
1
Reccurence $T(n) = \sqrt{n}T(\sqrt{n})+n$ -- (recurrence relation) <p>Note: this is from JeffE's Algorithms notes on Recurrences, page 5.</p>&#xA;&#xA;<p>(1). So we define the recurrence $T(n) = \sqrt{n}T(\sqrt{n})+n$ without any base case. Now I understand that for most recurrences, since we're looking for asymptotic ...
habedi/stack-exchange-dataset
77,114
Deciding on decidability of a problem and reducing it to halting problem if not decidable
<p>Given are two following languages: </p>&#xA;&#xA;<p>$L_1 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ visits each of its states at least once} \}$</p>&#xA;&#xA;<p>$L_2 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with...
turing machines undecidability semi decidability
1
Deciding on decidability of a problem and reducing it to halting problem if not decidable -- (turing machines undecidability semi decidability) <p>Given are two following languages: </p>&#xA;&#xA;<p>$L_1 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ visits eac...
habedi/stack-exchange-dataset
77,124
Is regular expression syntax regular?
<p>Regular expressions are equivalent to DFA's and describe regular languages, but is the language used to construct regular expressions regular?</p>&#xA;&#xA;<p>My guess is that the original syntax (concat, | and *) is, but the Perl-style syntax is not (backtracking). As the newer syntax recognises non regular languag...
regular languages regular expressions
1
Is regular expression syntax regular? -- (regular languages regular expressions) <p>Regular expressions are equivalent to DFA's and describe regular languages, but is the language used to construct regular expressions regular?</p>&#xA;&#xA;<p>My guess is that the original syntax (concat, | and *) is, but the Perl-style...
habedi/stack-exchange-dataset
77,135
Why is adding log probabilities faster than multiplying probabilities?
<p>To frame the question, in computer science often we want to calculate the product of several probabilities:</p>&#xA;&#xA;<pre><code>P(A,B,C) = P(A) * P(B) * P(C)&#xA;</code></pre>&#xA;&#xA;<p>The simplest approach is simply to multiply these numbers, and that is what I was going to do. However, my boss said it's bet...
algorithm analysis probability theory
1
Why is adding log probabilities faster than multiplying probabilities? -- (algorithm analysis probability theory) <p>To frame the question, in computer science often we want to calculate the product of several probabilities:</p>&#xA;&#xA;<pre><code>P(A,B,C) = P(A) * P(B) * P(C)&#xA;</code></pre>&#xA;&#xA;<p>The simples...
habedi/stack-exchange-dataset
77,138
Number of Retransmission in case of Go Back N
<p>While Going through <strong>Exercise problem</strong> of &quot; <strong>Computer Networking</strong> A Top-Down Approach&quot; by Kurose and Ross, i encountered this problem.I am giving my approach and the point where i am stuck at.</p>&#xA;<h2>Question</h2>&#xA;<blockquote>&#xA;<p>Suppose Host A sends 5 data segme...
computer networks
1
Number of Retransmission in case of Go Back N -- (computer networks) <p>While Going through <strong>Exercise problem</strong> of &quot; <strong>Computer Networking</strong> A Top-Down Approach&quot; by Kurose and Ross, i encountered this problem.I am giving my approach and the point where i am stuck at.</p>&#xA;<h2>Qu...
habedi/stack-exchange-dataset
77,145
Reinforcement Learning: An Introduction, A Gambler's Problem, Exercise 4.7 Solution
<p>Currently reading a recent draft of Reinforcement Learning: An Introduction by Sutton and Barto. Really good book! </p>&#xA;&#xA;<p>I was a bit confused by exercise 4.7 in chapter 4, section 4, page 93, (see attached photo) where it asks you to intuit about the form of the graph and the policy that converged. I do n...
dynamic programming reinforcement learning
1
Reinforcement Learning: An Introduction, A Gambler's Problem, Exercise 4.7 Solution -- (dynamic programming reinforcement learning) <p>Currently reading a recent draft of Reinforcement Learning: An Introduction by Sutton and Barto. Really good book! </p>&#xA;&#xA;<p>I was a bit confused by exercise 4.7 in chapter 4, se...
habedi/stack-exchange-dataset
77,151
Shortest Path in a Graph with Interacting Edge Weights
<p>Suppose we have a graph $G = (V,E)$.</p>&#xA;&#xA;<p>Every edge $e \in E$ has a unary cost $f(e) &gt; 0$.</p>&#xA;&#xA;<p>Also, for every two edges $e_1,e_2 \in E$ we have a binary reward function $g(e_1,e_2) \geq 0$.</p>&#xA;&#xA;<p>Given two vertices $s$ and $t$, is it possible to find the path that minimizes the ...
graphs shortest path
1
Shortest Path in a Graph with Interacting Edge Weights -- (graphs shortest path) <p>Suppose we have a graph $G = (V,E)$.</p>&#xA;&#xA;<p>Every edge $e \in E$ has a unary cost $f(e) &gt; 0$.</p>&#xA;&#xA;<p>Also, for every two edges $e_1,e_2 \in E$ we have a binary reward function $g(e_1,e_2) \geq 0$.</p>&#xA;&#xA;<p>Gi...
habedi/stack-exchange-dataset
77,168
simulation of PDA with 2-tape Turing machine
<p>Can someone give me suggestions how can I construct a 2-tape Turing machine which simulates PDA ?</p>&#xA;
turing machines pushdown automata
1
simulation of PDA with 2-tape Turing machine -- (turing machines pushdown automata) <p>Can someone give me suggestions how can I construct a 2-tape Turing machine which simulates PDA ?</p>&#xA;
habedi/stack-exchange-dataset
77,170
Was it known that $\mathsf{LTIME \subsetneq NLTIME}$?
<p>$\mathsf{LTIME = DTIME(\log n), NLTIME = NTIME(\log n)}$.</p>&#xA;&#xA;<p>For example, it seems that NTM can find an element in <em>unsorted</em> array in log-time by use of non-deterministic binary search (check if first half leads to solution and if second half leads to solution).</p>&#xA;&#xA;<p>Obviously, it can...
complexity theory time complexity
1
Was it known that $\mathsf{LTIME \subsetneq NLTIME}$? -- (complexity theory time complexity) <p>$\mathsf{LTIME = DTIME(\log n), NLTIME = NTIME(\log n)}$.</p>&#xA;&#xA;<p>For example, it seems that NTM can find an element in <em>unsorted</em> array in log-time by use of non-deterministic binary search (check if first ha...
habedi/stack-exchange-dataset
77,172
Limit on table size - perfect hashing
<p>Let us define a <strong><em>"root universal family"</em></strong> as a family of hash function which for every two items $k_i,k_j$ the probability $P(h(k_i)=h(k_j)) \le \frac{1}{\sqrt m}$ where $m$ is the size of the table.</p>&#xA;&#xA;<p>Now, let us have $|U| = n$ - (the size of the given universe, note that it i...
data structures probability theory hash tables
1
Limit on table size - perfect hashing -- (data structures probability theory hash tables) <p>Let us define a <strong><em>"root universal family"</em></strong> as a family of hash function which for every two items $k_i,k_j$ the probability $P(h(k_i)=h(k_j)) \le \frac{1}{\sqrt m}$ where $m$ is the size of the table.</p>...
habedi/stack-exchange-dataset
77,191
Complete Graph & Connected Component
<p>There seems to be various implementations of algorithms that find the connected components of a graph. </p>&#xA;&#xA;<p>I have not found, however, an algorithm or implementation for finding which of the connected components are also complete. Does anybody know of one?</p>&#xA;&#xA;<p>Thank you!</p>&#xA;
algorithms graphs
1
Complete Graph & Connected Component -- (algorithms graphs) <p>There seems to be various implementations of algorithms that find the connected components of a graph. </p>&#xA;&#xA;<p>I have not found, however, an algorithm or implementation for finding which of the connected components are also complete. Does anybody k...
habedi/stack-exchange-dataset
77,192
Algorithmic complexity of a Maximum Capacity Representatives variant
<p>I have been trying to find the algorithmic complexity of a problem that I have. I am almost sure it is either NP-hard or NP-complete but I cannot find any proof. Recently, I found that my problem can be something similar to a special instance of the Maximum Capacity Representatives problem, which is NP-complete. How...
complexity theory optimization sets
1
Algorithmic complexity of a Maximum Capacity Representatives variant -- (complexity theory optimization sets) <p>I have been trying to find the algorithmic complexity of a problem that I have. I am almost sure it is either NP-hard or NP-complete but I cannot find any proof. Recently, I found that my problem can be some...
habedi/stack-exchange-dataset
77,201
P decision problem that potentially requires at least $\Omega(n \log n)$ in the Turing model?
<p>Currently, it is not proven that $NP \geq O(n \log n)$ in the Turing Machine Model.</p>&#xA;&#xA;<p>The <em>weakness</em> of this statement can be illustrated by NP-complete problems, which we think require way more time. But I'm looking for the easiest-to-solve decision problem in P that probably has $\Omega (n \lo...
turing machines polynomial time
1
P decision problem that potentially requires at least $\Omega(n \log n)$ in the Turing model? -- (turing machines polynomial time) <p>Currently, it is not proven that $NP \geq O(n \log n)$ in the Turing Machine Model.</p>&#xA;&#xA;<p>The <em>weakness</em> of this statement can be illustrated by NP-complete problems, wh...
habedi/stack-exchange-dataset
77,226
How to find number of permutations of 1-N length, each [1-N] with k values
<p>This imaginary problem involves a vector of length 5, with each value to be selected from a unique range of values. </p>&#xA;&#xA;<p>A real-world example might include 5 different single-digit combination locks.</p>&#xA;&#xA;<p>How many different ways could I lock a single gate, assuming that I can use any number of...
combinatorics permutations
1
How to find number of permutations of 1-N length, each [1-N] with k values -- (combinatorics permutations) <p>This imaginary problem involves a vector of length 5, with each value to be selected from a unique range of values. </p>&#xA;&#xA;<p>A real-world example might include 5 different single-digit combination locks...
habedi/stack-exchange-dataset
77,227
How to derive the size of $k = \log n$ base from $\frac{1}{2^k} = O(\frac{1}{n})$?
<p>"We need $k$ to be large enough so that $(\frac{1}{2})^k = O(\frac{1}{n})$, and to do this we can choose $k = \log_2 n$. Thus, when $k = \log_2 n$, the size of the active region has been reduced to a constant, at which point the recursion bottoms out and we can search the remainder of the array directly in constant ...
algorithms asymptotics
1
How to derive the size of $k = \log n$ base from $\frac{1}{2^k} = O(\frac{1}{n})$? -- (algorithms asymptotics) <p>"We need $k$ to be large enough so that $(\frac{1}{2})^k = O(\frac{1}{n})$, and to do this we can choose $k = \log_2 n$. Thus, when $k = \log_2 n$, the size of the active region has been reduced to a consta...
habedi/stack-exchange-dataset
77,233
Vertex Cover, Hardness of Approximation
<p>In chapter of Hardness of Approximation in <em>V. Vazirani's</em> book it says:</p>&#xA;<blockquote>&#xA;<p>For establishing a hardness of approximation result for, say, the vertex cover problem, PCP theorem is used to show the following polynomial time reduction. It maps an instance φ of SAT to a graph G = (V,E) su...
np complete np hard approximation
1
Vertex Cover, Hardness of Approximation -- (np complete np hard approximation) <p>In chapter of Hardness of Approximation in <em>V. Vazirani's</em> book it says:</p>&#xA;<blockquote>&#xA;<p>For establishing a hardness of approximation result for, say, the vertex cover problem, PCP theorem is used to show the following ...
habedi/stack-exchange-dataset
77,235
What does it mean for a problem to be solved in polynomial time "relative to" an oracle?
<p>I came across the following theorem in page 12 of the following <a href="http://www2.fiit.stuba.sk/~kvasnicka/QuantumComputing/Gruska_QC.pdf" rel="nofollow noreferrer">pdf</a> :</p>&#xA;&#xA;<blockquote>&#xA; <p>There exists an oracle relative to which there is a problem solvable&#xA; in polynomial time (with boun...
complexity theory terminology quantum computing probabilistic algorithms oracle machines
1
What does it mean for a problem to be solved in polynomial time "relative to" an oracle? -- (complexity theory terminology quantum computing probabilistic algorithms oracle machines) <p>I came across the following theorem in page 12 of the following <a href="http://www2.fiit.stuba.sk/~kvasnicka/QuantumComputing/Gruska_...
habedi/stack-exchange-dataset
77,236
How to show that $L=\{ wa^kw | w \in \{ a,b,c \}^* ,k \geq 0 \}$ is not regular using the pumping lemma for regular languages?
<p>I'm trying to show that the language in the title is not regular but I don't know how to chose a decomposition $x = abc$ to express the word in the language because the $w \in \{a,b,c\}^*$ is kinda tricky for me, I know it means $ \{ a,b,c\} \cup\{ a,b,c\}^2 \cup ... \cup \{ a,b,c\}^k $ but I don't know how to chose...
formal languages regular languages pumping lemma
1
How to show that $L=\{ wa^kw | w \in \{ a,b,c \}^* ,k \geq 0 \}$ is not regular using the pumping lemma for regular languages? -- (formal languages regular languages pumping lemma) <p>I'm trying to show that the language in the title is not regular but I don't know how to chose a decomposition $x = abc$ to express the ...
habedi/stack-exchange-dataset
77,242
Computational Complexity of Not All Equal SAT variant
<p>Not All Equal SAT is an NP Complete problem. Let us now consider another variant of the problem.</p>&#xA;&#xA;<p>Given a Not All Equal SAT (NAESAT) problem (arbitrary number of literals allowed per clause) with an additional constraint that each pair of clauses share at least 1 literal (not variables but literals).<...
complexity theory
1
Computational Complexity of Not All Equal SAT variant -- (complexity theory) <p>Not All Equal SAT is an NP Complete problem. Let us now consider another variant of the problem.</p>&#xA;&#xA;<p>Given a Not All Equal SAT (NAESAT) problem (arbitrary number of literals allowed per clause) with an additional constraint that...
habedi/stack-exchange-dataset
77,269
Is Weighted Averages the Best Method to Aggregate Information?
<p>I'm working on a recommendation system. My system uses user's past rating data, to predict future ratings. </p>&#xA;&#xA;<p>I designed mathematical methods for generating recommendation algorithms that allows me to generate an unlimited number of recommendation algorithms (given a large enough set of relevant rating...
machine learning recommendation systems
1
Is Weighted Averages the Best Method to Aggregate Information? -- (machine learning recommendation systems) <p>I'm working on a recommendation system. My system uses user's past rating data, to predict future ratings. </p>&#xA;&#xA;<p>I designed mathematical methods for generating recommendation algorithms that allows ...
habedi/stack-exchange-dataset
77,272
Uniformly Random Nested Subset Pairs
<h2>Main Question</h2>&#xA;&#xA;<p>We can represent subsets of a vector using, say, a bit mask. Let's say a nested subset is a pair of masks, for example</p>&#xA;&#xA;<pre><code>A B C D E F&#xA;1 0 0 1 0 1&#xA;1 0 0 0 0 1&#xA;</code></pre>&#xA;&#xA;<p>is a nested subset, where the first mask tells us inclusion in the f...
algorithms combinatorics randomized algorithms
1
Uniformly Random Nested Subset Pairs -- (algorithms combinatorics randomized algorithms) <h2>Main Question</h2>&#xA;&#xA;<p>We can represent subsets of a vector using, say, a bit mask. Let's say a nested subset is a pair of masks, for example</p>&#xA;&#xA;<pre><code>A B C D E F&#xA;1 0 0 1 0 1&#xA;1 0 0 0 0 1&#xA;</cod...
habedi/stack-exchange-dataset
77,280
Is $DSPACE(f) \subseteq DTIME(f)$ always?
<p>Is $DSPACE(f) \subseteq DTIME(f)$ always?</p>&#xA;&#xA;<p>For example, if we have a language $A\in DSPACE(log^2(n))$ can we say that $A\in P$ (and subsequently in NP and coNP) since $DSPACE(log^2(n))\subseteq DSPACE(n^3) \subseteq DTIME(n^3)$?</p>&#xA;&#xA;<p>I know about $ DTIME(f) \subseteq DSPACE(f) \subseteq DT...
complexity theory time complexity space complexity
1
Is $DSPACE(f) \subseteq DTIME(f)$ always? -- (complexity theory time complexity space complexity) <p>Is $DSPACE(f) \subseteq DTIME(f)$ always?</p>&#xA;&#xA;<p>For example, if we have a language $A\in DSPACE(log^2(n))$ can we say that $A\in P$ (and subsequently in NP and coNP) since $DSPACE(log^2(n))\subseteq DSPACE(n^...
habedi/stack-exchange-dataset
77,282
Create a schedule from overlapping events
<p>Let me first sketch my situation. I have a list of events with time slots, and I need to generate a schedule from these. We can assume that I have already validated and ordered the events from lowest to highest priority, so I will have a list like:</p>&#xA;&#xA;<pre><code>Starts Ends Event&#xA;-------------------...
algorithms runtime analysis
1
Create a schedule from overlapping events -- (algorithms runtime analysis) <p>Let me first sketch my situation. I have a list of events with time slots, and I need to generate a schedule from these. We can assume that I have already validated and ordered the events from lowest to highest priority, so I will have a list...
habedi/stack-exchange-dataset
77,285
Why every point is in exactly one pair in Well Separated Pair Decomposition(WSPD)
<p>In the <a href="http://rads.stackoverflow.com/amzn/click/0521815134" rel="nofollow noreferrer">Geometric Spanner Networks</a> book by Giri Narasimhan and Michiel Smid Page 153 says</p>&#xA;&#xA;<blockquote>&#xA; <p><strong><em>Definition 9.1.3 (Well-Separated Pair Decomposition).</em></strong> Let $S$ be a set of $...
algorithms graphs computational geometry
1
Why every point is in exactly one pair in Well Separated Pair Decomposition(WSPD) -- (algorithms graphs computational geometry) <p>In the <a href="http://rads.stackoverflow.com/amzn/click/0521815134" rel="nofollow noreferrer">Geometric Spanner Networks</a> book by Giri Narasimhan and Michiel Smid Page 153 says</p>&#xA;...
habedi/stack-exchange-dataset
77,289
A systematic approach to creating a simple test parser
<p>I need to create a simple text parser that replaces <code>{tokens}</code> with text from a table. The more complicated bit is the <code>{?text?}</code> tag where <code>text</code> must be included only if the preceding AND the following tokens exist and are not empty. You could do <code>{?text}</code> where it looks...
formal languages language design
1
A systematic approach to creating a simple test parser -- (formal languages language design) <p>I need to create a simple text parser that replaces <code>{tokens}</code> with text from a table. The more complicated bit is the <code>{?text?}</code> tag where <code>text</code> must be included only if the preceding AND t...
habedi/stack-exchange-dataset
77,295
How to prove that a system is real-time?
<p>I'm writing a paper on the system I designed which upon receiving an event, performs a number of calculations and publishes the result to several subscribers. I can calculate the amount of time it takes from the moment the system is informed about the event, to the moment when all subscribers successfully received t...
real time
1
How to prove that a system is real-time? -- (real time) <p>I'm writing a paper on the system I designed which upon receiving an event, performs a number of calculations and publishes the result to several subscribers. I can calculate the amount of time it takes from the moment the system is informed about the event, to...
habedi/stack-exchange-dataset
77,302
Deciding whether there exists a permutation of the entries of an $n \times n$ matrix that is magic
<p>Given an array of $n^2$ integers, what is the most efficient way to determine whether any permutation of those integers can form a magic square? "Magic square" being an arrangement of those integers on a square grid such that all rows, columns and diagonals sum to the same value.</p>&#xA;&#xA;<p>Note that this isn't...
algorithms algorithm analysis matrices
1
Deciding whether there exists a permutation of the entries of an $n \times n$ matrix that is magic -- (algorithms algorithm analysis matrices) <p>Given an array of $n^2$ integers, what is the most efficient way to determine whether any permutation of those integers can form a magic square? "Magic square" being an arran...
habedi/stack-exchange-dataset
77,307
Strongly NP-hard problems and Dynamic Programming
<p>Dynamic Programming seems to result in good performance algorithms for <a href="https://en.wikipedia.org/wiki/Weak_NP-completeness" rel="noreferrer">Weakly NP-hard Problems</a>. Two examples are <a href="http://crystal.uta.edu/~gdas/Courses/Courses/Spring2011/6311SubsetSum.pdf" rel="noreferrer">Subset Sum Problem</a...
np complete dynamic programming np hard
1
Strongly NP-hard problems and Dynamic Programming -- (np complete dynamic programming np hard) <p>Dynamic Programming seems to result in good performance algorithms for <a href="https://en.wikipedia.org/wiki/Weak_NP-completeness" rel="noreferrer">Weakly NP-hard Problems</a>. Two examples are <a href="http://crystal.uta...
habedi/stack-exchange-dataset
77,312
Best combination of values pulled from a matrix
<p>What is the fastest way to select $n$ values from an $n$ by $n$ matrix such that each value comes from a different row and column and the sum of those n values is minimized?</p>&#xA;&#xA;<p>For example, given the matrix: </p>&#xA;&#xA;<p>$$A=\begin{bmatrix}0 &amp; 1 &amp;5 \\1 &amp; 4 &amp; 3\\2 &amp; 7 &amp; 0\end{...
optimization time complexity combinatorics efficiency
1
Best combination of values pulled from a matrix -- (optimization time complexity combinatorics efficiency) <p>What is the fastest way to select $n$ values from an $n$ by $n$ matrix such that each value comes from a different row and column and the sum of those n values is minimized?</p>&#xA;&#xA;<p>For example, given t...
habedi/stack-exchange-dataset
77,316
Applicabilty of master theorem (case 1) for T(n)=9T(n/3)+nlogn
<p>I want to know if the recurrence equation $T(n) = 9T(\frac{n}{3}) + nlogn$, can or cannot be solved using master theorem. </p>&#xA;&#xA;<p>At first, I naively went for $O(n^2)$ applying case 1 of master theorem. But then someone pointed out that $f(n)=nlogn$ and $n^{\log_3 9}$ do not have <a href="https://stackoverf...
asymptotics recurrence relation master theorem
1
Applicabilty of master theorem (case 1) for T(n)=9T(n/3)+nlogn -- (asymptotics recurrence relation master theorem) <p>I want to know if the recurrence equation $T(n) = 9T(\frac{n}{3}) + nlogn$, can or cannot be solved using master theorem. </p>&#xA;&#xA;<p>At first, I naively went for $O(n^2)$ applying case 1 of master...
habedi/stack-exchange-dataset
77,319
Can all programs with mutable state be refactored in programs without?
<p>Given the space A of all programs that could be possibly written in a given language and given the space B of all programs that could be possibly written in the same language but without any mutable state: can we be sure that with just B we can solve all the same problems we could solve with A ?</p>&#xA;
computability
1
Can all programs with mutable state be refactored in programs without? -- (computability) <p>Given the space A of all programs that could be possibly written in a given language and given the space B of all programs that could be possibly written in the same language but without any mutable state: can we be sure that w...
habedi/stack-exchange-dataset
77,330
Algorithm to find k elements following the median in sorted order
<p>I have the following problem:</p>&#xA;&#xA;<p>Given an unsorted array A of size n, print the first k elements in A larger than its median.</p>&#xA;&#xA;<p>Here's my approach to the problem:</p>&#xA;&#xA;<pre><code> 1. Create a minHeap and a maxHeap&#xA; 2. Iterate over elements in A // O(n)&#xA; - if ...
algorithms sorting arrays heaps
1
Algorithm to find k elements following the median in sorted order -- (algorithms sorting arrays heaps) <p>I have the following problem:</p>&#xA;&#xA;<p>Given an unsorted array A of size n, print the first k elements in A larger than its median.</p>&#xA;&#xA;<p>Here's my approach to the problem:</p>&#xA;&#xA;<pre><code>...
habedi/stack-exchange-dataset
77,339
What is the most efficient algorithm to get percentile distribution from histogram distribution?
<p>So let's say you have a histogram distribution represented as an array where each element is equal to the number of numbers from the underlying data set that are equal to that element's index.</p>&#xA;&#xA;<p>For example, if your underlying data had 5 0's, 18 1's, 11 2's, 0 3's, etc., then the array representing thi...
algorithms data structures
1
What is the most efficient algorithm to get percentile distribution from histogram distribution? -- (algorithms data structures) <p>So let's say you have a histogram distribution represented as an array where each element is equal to the number of numbers from the underlying data set that are equal to that element's in...
habedi/stack-exchange-dataset
77,341
CFG problem solved with PDA - looking for alternative solution
<p>I'm trying to find CFG for the language <span class="math-container">$$L = \{ a^nb^mc^kd^l | n + k = m + l, (n,m,k,l) \in \mathbb{N} \}$$</span>&#xA;and what I have done so far is to make PDA which simply does the following:</p>&#xA;&#xA;<ul>&#xA;<li><p>If on the stream there is "a" -> push <span class="math-contain...
formal languages context free pushdown automata
1
CFG problem solved with PDA - looking for alternative solution -- (formal languages context free pushdown automata) <p>I'm trying to find CFG for the language <span class="math-container">$$L = \{ a^nb^mc^kd^l | n + k = m + l, (n,m,k,l) \in \mathbb{N} \}$$</span>&#xA;and what I have done so far is to make PDA which sim...
habedi/stack-exchange-dataset
77,345
Generating words in given format
<p>i am looking for an algorithm that will generate all possible combinations of words from given dictionary that satisfy given format.</p>&#xA;&#xA;<p>Let me explain what i mean with format: </p>&#xA;&#xA;<p>For example, if the format is "abcd" means that we are looking for one word, length of the word must be 4 and b...
algorithms strings enumeration
1
Generating words in given format -- (algorithms strings enumeration) <p>i am looking for an algorithm that will generate all possible combinations of words from given dictionary that satisfy given format.</p>&#xA;&#xA;<p>Let me explain what i mean with format: </p>&#xA;&#xA;<p>For example, if the format is "abcd" means...
habedi/stack-exchange-dataset
77,354
Calculating the information density of an encoding system
<p>How do I calculate the information density of an encoding system?</p>&#xA;&#xA;<p>This question came up as I was reading several papers about encoding data in DNA (I think I have gone through just about every major paper on encoding data in DNA after Church's). All of them mention the information density of their en...
reference request efficiency information theory encoding scheme
1
Calculating the information density of an encoding system -- (reference request efficiency information theory encoding scheme) <p>How do I calculate the information density of an encoding system?</p>&#xA;&#xA;<p>This question came up as I was reading several papers about encoding data in DNA (I think I have gone throug...
habedi/stack-exchange-dataset
77,362
Is Datalog negation and the built-in predicate $ \neq $ similar?
<p>I was reading "Principles of Database &amp; Knowledge-Base Systems, Vol. 1" by Jeffrey D. Ullman. There is a chapter about Datalog negation and as I was seeing the problems of negation I kept thinking that using the predicate $ \neq $ would solve those problems but then I see the following:</p>&#xA;&#xA;<p>p(X) :- r...
database theory relational algebra fixed point datalog
1
Is Datalog negation and the built-in predicate $ \neq $ similar? -- (database theory relational algebra fixed point datalog) <p>I was reading "Principles of Database &amp; Knowledge-Base Systems, Vol. 1" by Jeffrey D. Ullman. There is a chapter about Datalog negation and as I was seeing the problems of negation I kept ...
habedi/stack-exchange-dataset