id int64 1 141k | title stringlengths 15 150 | body stringlengths 43 35.6k | tags stringlengths 1 118 | label int64 0 1 |
|---|---|---|---|---|
1,919 | Equality testing of arrays and integers in a procedural language | <p>In terms of references and their implementation on the heap and the stack, how is
equality testing for arrays different from that for integers? </p>

<p>This is to do with Java programming, if you have a stack and a heap, would equality testing for example <code>j == i</code> be the same for arrays and f... | programming languages arrays semantics equality memory management | 1 |
1,921 | Making random sources uniformly distributed | <p>How do I build a random source that outputs the bits 0 and 1 with $prob(0) = prob(1) = 0.5$. We have access to another random source $S$ that outputs $a$ or $b$ with independent probabilities $prob(a)$ and $prob(b) = 1 - prob(a)$ that are unknown to us.</p>

<p>How do I state an algorithm that does the job a... | algorithms probability theory randomized algorithms randomness | 1 |
1,922 | Deterministic and randomized communication complexity of set equality | <p>Two processors $A, B$ with inputs $a \in \{0, 1\}^n$ (for $A$) and $b \in \{0, 1\}^n$
(for $B$) want to decide whether $a = b$. $A$ does not know $B$’s input and vice versa.</p>

<p>A can send a message $m(a) \in \{0, 1\}^n$ which $B$ can use to decide $a = b$. The communication and computation rules ... | algorithms probability theory randomized algorithms | 1 |
1,923 | Online generation of uniform samples | <p>A source provides a stream of items $x_1, x_2,\dots$ . At each step $n$ we want to save a random sample $S_n \subseteq \{ (x_i, i)|1 \le i \le n\}$ of size $k$, i.e. $S_n$ should be a uniformly chosen sample from all $\tbinom{n}{k}$ possible samples consisting of seen items. So at each step $n \ge k$ we must decide ... | algorithms probability theory randomized algorithms randomness online algorithms | 1 |
1,936 | When do structural hazards occur in pipelined architectures? | <p>I'm looking for some relatively simple examples of when <a href="http://en.wikipedia.org/wiki/Hazard_%28computer_architecture%29#Structural_hazards">structural hazards</a> occur in a pipelined architecture.</p>

<p>The only scenario I can think of is when memory needs to be accessed during different stages o... | computer architecture cpu pipelines | 1 |
1,939 | Does the language of Regular Expressions need a push down automata to parse it? | <p>I want to convert a user entered regular expression into an NFA so that I can then run the NFA against a string for matching purposes. What is the minimum machine that can be used to parse regular expresssions? </p>

<p>I assume it must be a push down automaton because the presense of brackets means the need... | formal languages parsers regular expressions pushdown automata | 0 |
1,940 | If a point is a vertex of convex hull | <p>The exercise is </p>

<blockquote>
 <p>Given a set of point $S$ and a point $p$. Decide in $O(n)$ time if $p$ is a vertex of convex polygon formed from points of $S$.</p>
</blockquote>

<p>The problem is I am a little bit confused with time complexity $O(n)$. The more naive solution would b... | algorithms computational geometry | 1 |
1,949 | Use closure properties to transform languages to $L := \{ a^nb^n : n\in \mathbb N \}$ | <p>For the purpose of proving that they are not regular, what closure properties can I use to transform the languages</p>

<ol>
<li>$L_a = \{ a^*cw \mid w \in \{a,b \}^* \land |w|_a = |w|_b \}$ and</li>
<li>$L_b = \{ab^{i_1}ab^{i_2}\ldots ab^{i_n} \mid i_j∈\mathbb N \land \exists j∈[1,n] \ i_j \not=... | formal languages context free closure properties | 1 |
1,954 | Criteria for selecting language for first programming course | <p>As a university-level CS educator, the issue of which programming language to teach in the first programming course often comes up for discussion. There are thousands of languages to choose between, and lots of religious fever (or fevour) supporting one language camp over another. All of this subjective bias surroun... | programming languages education | 0 |
1,957 | Master theorem not applicable? | <p>Given the following recursive equation</p>

<p>$$ T(n) = 2T\left(\frac{n}{2}\right)+n\log n$$ we want to apply the Master theorem and note that</p>

<p>$$ n^{\log_2(2)} = n.$$</p>

<p>Now we check the first two cases for $\varepsilon > 0$, that is whether</p>

<ul>
<li>$n\log n... | proof techniques asymptotics recurrence relation master theorem | 1 |
1,958 | Relation between simple and regular grammars | <p>I am reading "An Introduction to Formal Languages and Automata" written by Peter Linz and after reading the first five chapters I face below problem with
simple and regular (especially right linear) grammars which are very similar to each other.</p>

<p>What relation exists between these? What is the dif... | regular languages automata context free formal grammars | 1 |
1,959 | How to go from a recurrence relation to a final complexity | <p>I have an algorithm, shown below, that I need to analyze. Because it's recursive in nature I set up a recurrence relation. </p>

<pre><code>//Input: Adjacency matrix A[1..n, 1..n]) of an undirected graph G 
//Output: 1 (true) if G is complete and 0 (false) otherwise 
GraphComplete(A[1..n, 1..n]) {... | algorithms algorithm analysis runtime analysis recursion | 1 |
1,970 | Data structure with search, insert and delete in amortised time $O(1)$? | <p>Is there a data structure to maintain an ordered list that supports the following operations in $O(1)$ amortized time? </p>

<ul>
<li><p><strong>GetElement(k)</strong>: Return the $k$th element of the list.</p></li>
<li><p><strong>InsertAfter(x,y)</strong>: Insert the new element y into the list imme... | data structures time complexity asymptotics amortized analysis | 1 |
1,972 | Decide whether a context-free languages can be accepted by a deterministic pushdown automaton | <p>Given a context-free grammar G, there exists a Nondeterministic Pushdown Automaton N that accepts exactly the language G accepts. (and visa versa)</p>

<p>There <strong>may</strong> also exist a Deterministic Pushdown Automaton D that accepts exactly the language G accepts too. It depends on the grammar.</p... | automata context free pushdown automata | 1 |
1,974 | Compare-and-Swap in an RDBMS for custom locks and lock escalation | <p>I'm applying the Compare-and-Swap technique to a SQL database to create custom row-level locking in my dataset, allowing for safe READ UNCOMMITTED isolation at the database level.</p>

<p>The Resource table includes a LockOwner <code>GUID</code> and a IsLocked <code>BIT</code> field. To acquire a lock, a di... | concurrency database theory | 1 |
1,979 | Proof that $\{⟨M⟩ ∣ L(M) \mbox{ is context-free} \}$ is not (co-)recursively enumerable | <p>I would like to use your help with the following problem:</p>

<p>$L=\{⟨M⟩ ∣ L(M) \mbox{ is context-free} \}$. Show that $L \notin RE \cup CoRE$.</p>

<p>I know that to prove $L\notin RE$, it is enough to find a language $L'$ such that $L'\notin RE$ and show that there is a reduction from $L'$ to $L... | formal languages computability context free turing machines | 1 |
1,980 | Optimizing a join where each table has a selection | <p>Consider the following query:</p>

<pre><code>SELECT Customer.Name FROM Customer
INNER JOIN Order on Order.CustomerId = Customer.Id
WHERE Customer.Preferred = True AND
 Order.Complete = False
</code></pre>

<p>Let's suppose all of the relevant attributes (Customer.Preferred, Orde... | optimization database theory relational algebra databases | 0 |
1,983 | Transforming an NFA into an NFA of similar size but without $\epsilon$-transitions | <p>I'm learning for the exam and have problems with this task:</p>

<blockquote>
 <p>Describe an algorithm that transforms a given NFA $A = (Q, \Sigma, \delta, q_0, F)$ (which may have $\epsilon$-transitions) into an equivalent NFA without $\epsilon$-transitions with the same condition number. And then det... | algorithms automata finite automata | 0 |
1,984 | Proving the (in)tractability of this Nth prime recurrence | <p>As follows <a href="https://cs.stackexchange.com/questions/1828/polytime-and-polyspace-algorithm-for-determining-the-leading-intersection-of-n-d">from my previous question</a>, I've been playing with the <a href="http://en.wikipedia.org/wiki/Riemann_hypothesis" rel="nofollow noreferrer">Riemann hypothesis</a> as a m... | complexity theory reference request recurrence relation mathematical analysis | 0 |
1,986 | Prove that regular languages are closed under the cycle operator | <p>I've got in a few days an exam and have problems to solve this task.</p>

<p>Let $L$ be a regular language over the alphabet $\Sigma$. We have the operation 
$\operatorname{cycle}(L) = \{ xy \mid x,y\in \Sigma^* \text{ and } yx\in L\}$
And now we should show that $\operatorname{cycle}(L)$ is also reg... | formal languages regular languages finite automata closure properties | 1 |
1,988 | Is open adressing with prime steps bijective? | <p>Who can help me with this topic: <a href="https://en.wikipedia.org/wiki/Open_addressing" rel="nofollow">Probing</a> with a step width that is a prime number.</p>

<p>I am struggling with this question about defining a hashing function $h(k, i)$ for open addressing on a table of length m, that is, with slots ... | algorithms hash tables hash | 0 |
1,990 | Is there an undecidable finite language of finite words? | <p>Is there <em>a need</em> for $L\subseteq \Sigma^*$ to be <em>infinite</em> to be undecidable?</p>

<p>I mean what if we choose a language $L'$ be a <em>bounded finite version of</em> $L\subseteq \Sigma^*$, that is $|L'|\leq N$, ($N \in \mathbb{N}$), with $L' \subset L$. Is it possible for $L'$ to be an unde... | formal languages computability undecidability | 1 |
1,993 | Why absence of surjection with the power set is not enough to prove the existence of an undecidable language? | <p>From this statement </p>

<blockquote>
 <p>As there is no surjection from $\mathbb{N}$ onto $\mathcal{P}(\mathbb{N})$, thus there must exist an undecidable language.</p>
</blockquote>

<p>I would like to understand why similar reasoning does not work with a <em>finite</em> set $B$ which also... | formal languages computability undecidability | 1 |
1,998 | Low-degree nodes in sparse graphs | <p>Let $G = (V,E)$ be a graph having $n$ vertices, none of which are isolated, and $n−1$ edges, where $n \geq 2$. Show that $G$ contains at least two vertices of degree one.</p>

<p>I have tried to solve this problem by using the property $\sum_{v \in V} \operatorname{deg}(v) = 2|E|$. Can this problem be solve... | graphs proof techniques | 1 |
2,002 | Is the set of LL(*) grammars the same as the set of CFG grammars? | <p>Is the set of LL(*) grammars the same as the set of context-free grammars?</p>
 | formal languages formal grammars | 1 |
2,005 | Optimal path - best career | <p>I am new and I have to develop an algorithm with a 2d integer array as input to compute the best career path.
Lets consider a network with n nodes, which are numbered from $1$ to $n$.
All are connected one to the other. </p>

<p>To move from node $i$ to node $j$ can have different costs (classical ex... | algorithms | 0 |
2,006 | Machine Learning algorithms based on "structural risk minimization"? | <p>Which machine learning algorithms (besides SVM's) use the principle of <a href="https://en.wikipedia.org/wiki/Structural_risk_minimization">structural risk minimization</a>?</p>
 | reference request machine learning | 1 |
2,011 | DLOGTIME complexity class and testing the length of the input string | <p>I read that testing the length of the input string is in DLOGTIME.</p>

<p>The question is how can testing the length of the input string be in DLOGTIME?</p>

<p>$\text{DLOGTIME} = O(\log n)$, so what number would be in $n$? (as it seems that $n$ is definitely not the length of the input string..... ... | complexity theory | 1 |
2,016 | How to convert finite automata to regular expressions? | <p>Converting regular expressions into (minimal) NFA that accept the same language is easy with standard algorithms, e.g. <a href="http://en.wikipedia.org/wiki/Thompson%27s_construction_algorithm">Thompson's algorithm</a>. The other direction seems to be more tedious, though, and sometimes the resulting expressions are... | algorithms formal languages finite automata regular expressions reference question | 1 |
2,019 | Area of the union of rectangles anchored on the x-axis | <p>I am trying to solve the following computational geometry problem.</p>
<blockquote>
<p>Let <span class="math-container">$S$</span> be a set of <span class="math-container">$n$</span> axis-parallel rectangles in the plane, so that the bottom edge of each rectangle in <span class="math-container">$S$</span> li... | algorithms computational geometry | 0 |
2,022 | regular expression | <blockquote>
 <p><strong>Possible Duplicate:</strong><br>
 <a href="https://cs.stackexchange.com/questions/2008/construction-of-a-regular-expression">Construction of a regular expression</a> </p>
</blockquote>



<p>can someone help me with the following exercise?
In the formation of ... | formal languages | 0 |
2,024 | construct regular expression | <p>I need help with the following exercise:</p>

<p>Construct an $\varepsilon$-NFA for the following regular expression $(a|\varepsilon)(ba)^*(c^*a|bc)^*$.</p>

<p>i already tried this exercise with nerode but i didnt come to a solution please help me
thank you guys</p>

<p>Source wiki
N... | formal languages finite automata regular expressions | 0 |
2,028 | Finding small node sets that can not be avoided on paths from source to sink | <p>In a directed graph with a starting node and an ending node, how to find a small (doesn't have to be smallest. <10 for example) set S of nodes such that every possible path from the starting node to the ending node contains at least one member of set S. The graph may have loops. This may be NP hard. Is there an a... | algorithms graphs | 1 |
2,030 | How can encryption involve randomness? | <p>If an encryption algorithm is meant to convert a string to another string which can then be decrypted back to the original, how could this process involve any randomness? </p>

<p>Surely it has to be deterministic, otherwise how could the decryption function know what factors were involved in creating the e... | cryptography encryption randomness | 0 |
2,031 | Can constraint satisfaction problems be solved with Prolog? | <p>Is <a href="http://iggyfernandez.wordpress.com/2012/05/21/sql-vs-nosql-third-international-nocoug-sql-nosql-challenge-sponsored-by-pythian/">"party attendance"</a> type of problems solvable in Prolog? For example:</p>

<blockquote>
 <p>Burdock Muldoon and Carlotta Pinkstone both said they would come if ... | logic constraint programming prolog logic programming | 1 |
2,039 | Bellman-Ford variation | <p>I have a "smarter" version of Bellman-Ford here; this version is more clever about choosing the edges to relax.</p>

<pre><code>//Queue Q; source s; vertices u, v; distance to v d(v)
Q ← s // Q holds vertices whose d(v) values have been updated recently.
While (Q !empty) {
 u ← Dequeue(Q)
 ... | algorithms graphs runtime analysis shortest path | 0 |
2,040 | Ternary processing instead of Binary | <p>Most of the computers available today are designed to work with binary system. It comes from the fact that information comes in two natural form, <strong>true</strong> or <strong>false</strong>.</p>

<p>We humans accept another form of information called "maybe" :)</p>

<p>I know there are ternary pr... | computer architecture | 1 |
2,046 | How to prove every well-balanced orientation of an Eulerian graph is Eulerian? | <p>I'm trying to prove that every well-balanced <a href="https://en.wikipedia.org/wiki/Strong_orientation" rel="nofollow">orientation</a> of an <a href="https://en.wikipedia.org/wiki/Eulerian_graph" rel="nofollow">Eulerian graph</a> is Eulerian.</p>

<p>I want to prove it by showing that for any two vertices $u... | graphs | 0 |
2,047 | Probabilistic poly-time machine always halts on all inputs? | <p>In the usual definition of probabilistic poly-time machine it is said that the machine halts in polynomial time for all inputs. </p>

<p>Is the intention really to say that the machine halts for all inputs, or that if it halts it must be in polynomial time?</p>
 | complexity theory terminology turing machines probabilistic algorithms | 0 |
2,049 | How many layers should a neural network have? | <p>Are there any advantages of having more than 2 hidden layers in a Neural Network?</p>

<p>I've seen some places that recommend it, others prove that there is no advantage.</p>

<p>Which one is right?</p>
 | artificial intelligence neural networks neural computing | 1 |
2,052 | In s-t directed graph, how to find many small cuts? | <p>Solving the <a href="https://en.wikipedia.org/wiki/Maximum_flow_problem" rel="nofollow">maximum flow problem</a> yields one qualified minimal cut. But I want several (maybe hundreds) small cuts as candidates. The cuts don't have to be minimum cuts, as long as they are small (in weight). How do I do that?</p>
 | algorithms graphs optimization approximation | 0 |
2,053 | After implementing a novel encryption algorithm, how would one go about analyzing its security or get help from others in doing so? | <p><strong>Preface:</strong> This question was originally asked on <a href="https://cstheory.stackexchange.com/questions/11521">Theoretical Computer Science</a>, and the kind people there referred me to this web site. It is being repeated here in an attempt to find a satisfying answer.</p>

<hr>

<p>Ove... | cryptography encryption | 0 |
2,057 | When can I use dynamic programming to reduce the time complexity of my recursive algorithm? | <p>Dynamic programming can reduce the time needed to perform a recursive algorithm. I know that dynamic programming can help reduce the time complexity of algorithms. Are the general conditions such that if satisfied by a recursive algorithm would imply that using dynamic programming will reduce the time complexity of ... | algorithms dynamic programming efficiency algorithm design | 0 |
2,059 | How do you check if two algorithms return the same result for any input? | <p>How do you check if two algorithms (say, Merge sort and Naïve sort) return the same result for any input, when the set of all inputs is infinite?</p>

<p><strong>Update:</strong> Thank you <a href="https://cs.stackexchange.com/a/2062/1638">Ben</a> for describing how this is impossible to do algorithmically i... | computability formal methods software engineering software verification | 0 |
2,064 | Block detection in repeated stream | <p>I need to recover a data block from a repeated stream of data. I'm looking to see what algorithms may already exist for this as it does not feel like a novel situation.</p>

<p>Here are the specifics:</p>

<ol>
<li>There is an N-length block of data contained in a stream</li>
<li>The block is... | algorithms online algorithms communication protocols | 1 |
2,067 | What does this performance formula mean? | <p>I have to make a quick clustering program but the following formula is gibberish to me:</p>

<blockquote>
 <p>$\operatorname{Perf}(X,C) = \sum\limits_{i=1}^n\min\{||X_i-C_l||^2 \mid l = 1,...,K\}$</p>
 
 <p>where $X$ is a set of multi-dimensional data and $C$ is a set of centroids for each d... | algorithms terminology evolutionary computing | 1 |
2,069 | Coverage problem (transmitter and receiver) | <p>I try to solve the following coverage problem.</p>

<blockquote>
 <p>There are $n$ transmitters with coverage area of 1km and $n$ receivers. Decide in $O(n\log n)$ that all receivers are covered by any transmitter. All reveivers and transmiters are represented by their $x$ and $y$ coordinates.</p>
... | algorithms computational geometry search problem | 0 |
2,076 | Could someone suggest me a good introductory book or an article on graph clustering? | <p>For my pet project I need to cluster some data which could be easily represented as graph, so I want to use this as an opportunity to educate myself and play with various algorithms. I'd prefer the book on graph clustering as it often more self contained but articles are fine too. Back in the days I used to work in ... | algorithms graphs reference request books | 1 |
2,079 | Determine missing number in data stream | <p>We receive a stream of $n-1$ pairwise different numbers from the set $\left\{1,\dots,n\right\}$.</p>

<p>How can I determine the missing number with an algorithm that reads the stream once and uses a memory of only $O(\log_2 n)$ bits?</p>
 | algorithms integers online algorithms | 1 |
2,081 | Is there a context free, non-regular language $L$, for which $L^*$ is regular? | <p>I know that there are non-regular languages, so that $L^*$ is regular, but all examples I can find are context-sensitive but not context free.</p>

<p>In case there are none how do you prove it?</p>
 | formal languages context free regular languages | 1 |
2,082 | Algorithm to minimize distance variance between 2D coordinates | <p>I've been looking around for an algorithm that would optimize the distance between 2 list of coordinates and choose which coordinate should go together.</p>

<p>Say I have List 1:</p>

<pre><code>205|200
220|210
200|220
200|180
</code></pre>

<p>List 2:</p>

<pre><code... | algorithms computational geometry | 0 |
2,088 | Complete Problems for $DSPACE(\log(n)^k)$ | <p>We know that the $polyL$-hierarchy doesn't have complete problems, as it would conflict with the space hierarchy theorem. But: Are there complete problems for each level of this hierarchy?</p>

<p>To be precise: Does the class $DSPACE(\log(n)^k)$ have complete problems under $L$-reductions for each $k > 0... | complexity theory reductions space complexity | 1 |
2,092 | Simple explanation as to why certain computable functions cannot be represented by a typed term? | <p>Reading the paper <a href="ftp://ftp.cs.ru.nl/pub/CompMath.Found/lambda.pdf">An Introduction to the Lambda Calculus</a>, I came across a paragraph I didn't really understand, on page 34 (my italics):</p>

<blockquote>
 <p>Within each of the two paradigms there are several versions of typed
 lambda ... | computability logic lambda calculus type theory | 0 |
2,093 | Efficient map data structure supporting approximate lookup | <p>I'm looking for a data structure that supports efficient approximate lookups of keys (e.g., Levenshtein distance for strings), returning the closest possible match for the input key. The best suited data structure I've found so far are <a href="http://en.wikipedia.org/wiki/BK-tree">Burkhard-Keller trees</a>, but I w... | data structures strings efficiency | 0 |
2,100 | Need help understanding this optimization problem on graphs | <p>Has anyone seen this problem before? It's suppose to be NP-complete.</p>

<blockquote>
 <p>We are given vertices $V_1,\dots ,V_n$ and possible parent sets for each vertex. Each parent set has an associated cost. Let $O$ be an ordering (a permutation) of the vertices. We say that a parent set of a vertex... | algorithms graphs terminology optimization | 1 |
2,101 | Finding the point nearest to the x-axis over some segment | <p>I have problem with solving the following exercise</p>

<blockquote>
 <p>Given the set $P$ on $n$ points in two dimensions, build in time $O(n\log n)$ a data structure of $P$ such that given a horizontal segment $s$ find the first point that $s$ touches when moving upwards from the x-axis in time $O(\lo... | algorithms computational geometry | 1 |
2,103 | Depth-2 circuits with OR and MOD gates are not universal? | <p>It is well-known that every boolean function $f:\{0,1\}^n\to \{0,1\}$ can be realized using a boolean circuit of depth 2 (over the variables, their negation and constant values) containing AND gates in the first level and one single OR gate in the upper level; this is simply the <a href="http://en.wikipedia.org/wiki... | complexity theory logic circuits | 1 |
2,110 | Space bounded Turing Machine - clarification on Computational Complexity (book: Arora-Barak ) question 4.1 | <p>I have the following question from <a href="http://www.cs.princeton.edu/theory/complexity/" rel="noreferrer">Computational Complexity - A modern Approach</a> by Sanjeev Arora and Boaz Barak:</p>

<blockquote>
 <p><em>[Q 4.1]</em><br>
 Prove the existence of a universal TM for space bounded computat... | complexity theory terminology turing machines space complexity | 1 |
2,118 | Number of clique in random graphs | <p>There is a family of random graphs $G(n, p)$ with $n$ nodes (<a href="https://en.wikipedia.org/wiki/Random_graph">due to Gilbert</a>). Each possible edge is independently inserted into $G(n, p)$ with probability $p$. Let $X_k$ be the number of cliques of size $k$ in $G(n, p)$.</p>

<p>I know that $\mathbb{E}... | graphs combinatorics probability theory random graphs | 1 |
2,120 | Forward checking vs arc consistency on 3-SAT | <p>If I were to let the variables be the propositions and, constraint be all clauses being satisfied, which technique would be more effective in solving 3-SAT? <a href="http://en.wikipedia.org/wiki/Look-ahead_%28backtracking%29#Look_ahead_techniques" rel="nofollow">Forward checking</a> or <a href="http://en.wikipedia.o... | algorithms satisfiability heuristics 3 sat sat solvers | 0 |
2,121 | Complexity of computer algebra for systems of trigonometric equations | <p><a href="https://cs.stackexchange.com/questions/1984/proving-the-intractability-of-this-nth-prime-recurrence">As discussed in this question,</a> I drafted a spec algorithm that hinges on finding a specific root of a system of trigonometric equations satisfying the following recurrence:</p>

<p>$\qquad f_{p_0... | reference request runtime analysis mathematical analysis computer algebra mathematical software | 0 |
2,123 | Transform regular grammar in linear grammar | <p>My problem is how can I transform a <em>regular</em> grammar into a <em>linear</em> grammar?</p>

<p>I know that a linear grammar has the form</p>

<p>$\begin{align} A &\to w_1Bw_2 \\ 
 A &\to w \end{align}$</p>

<p>where $A,B \in N$ and $w,w_1,w_2 \in \Sigma^*$.</p>... | terminology formal grammars | 0 |
2,127 | Context-free grammar for $\{ a^n b^m a^{n+m} \}$ | <p>I've got a problem with this task. I should declare a context-free grammar for this language:</p>

<p>$\qquad \displaystyle L := \{\, a^nb^ma^{n+m} : n,m \in \mathbb{N}\,\}$</p>

<p>My idea is: We need a start symbol, for example $S$. I know that I can generate the first $a$ and the last $a$ by $S \t... | formal languages context free formal grammars | 1 |
2,130 | What is the branch of Computer Science that studies how Anti Virus programs work? | <p>It is a trivial exercise in finite automata to show that there is no algorithm that can detect all the viruses, yet there are many software companies selling Anti Virus Software.</p>

<p>Is there any part of CS that deals with Viruses and Anti Viruses ?</p>

<p>PS : I am not asking about non CS relat... | reference request security | 0 |
2,149 | Any very user friendly resources on the Baum-Welch algorithm? | <p>I'd like to understand the <a href="https://en.wikipedia.org/wiki/Baum%E2%80%93Welch_algorithm" rel="nofollow">Baum-Welch algorithm</a>. I liked <a href="http://www.youtube.com/watch?v=7zDARfKVm7s&feature=related" rel="nofollow">this video</a> on the Forward-Backward algorithm so I'd like a similar one for Baum-... | algorithms reference request hidden markov models | 1 |
2,151 | Proving NP is a subset of the union of exponential DTIME | <p>I need to prove that $\mathsf{NP}$ is a subset of the union of $\mathsf{DTIME}(2^{n^c})$ for all $c > 1$.</p>

<p>Let $L$ be a language/decision problem in $\mathsf{NP}$. Then $L$ can be decided given a polynomial-size certificate in polynomial time with a turing machine $M$. So then we enumerate all poss... | complexity theory check my proof | 0 |
2,152 | How to prove correctness of a shuffle algorithm? | <p>I have two ways of producing a list of items in a random order and would like to determine if they are equally fair (unbiased).</p>

<p>The first method I use is to construct the entire list of elements and then do a shuffle on it (say a Fisher-Yates shuffle). The second method is more of an iterative method... | algorithms proof techniques randomized algorithms correctness proof randomness | 1 |
2,154 | Swap space management during pure demand paging | <p>The following is a doubt that I came across while doing a OS home assignment - however, it seems more concept-based than a straightforward coding question, so IMHO I don't think the homework tag is appropriate for this.</p>

<p>In a pure demand paging scheme for multiple processes running at the same time, g... | operating systems memory allocation virtual memory paging memory management | 1 |
2,155 | How to read typing rules? | <p>I started reading more and more language research papers. I find it very interesting and a good way to learn more about programming in general. However, there usually comes a section where I always struggle with (take for instance part three of <a href="http://math.andrej.com/wp-content/uploads/2012/03/eff.pdf">this... | logic reference request terminology type theory | 1 |
2,157 | NP-Completeness of a Graph Coloring Problem | <p><strong>Alternative Formulation</strong></p>

<p>I came up with an alternative formulation to the below problem. The alternative formulation is actually a special case of the problem bellow and uses bipartite graphs to describe the problem. However, I believe that the alternative formulation is still NP-hard... | complexity theory graphs np complete | 1 |
2,164 | Transform in linear grammar | <p>i have the following regular grammar :
$$S \rightarrow aS | cS | bQ_1$$
$$Q_1 \rightarrow bQ_2$$
$$Q_2 \rightarrow aQ_3 | cQ_3 | bQ_1$$
$$Q_3 \rightarrow aQ_4 | cQ_4$$ 
$$Q_4 \rightarrow \varepsilon$$</p>

<p>The question is to transform that into a linear grammar with less nonterminals t... | formal grammars | 1 |
2,166 | generation of linear grammar | <p>We have the following linear grammar:
$$E \rightarrow aO | bO | bbE | bb$$
$$O \rightarrow aE | bE | abaE | aba$$
Does the linear grammar generate a regular language, if yes why ?
Our alphabet is $\Sigma$ = {a,b} and our nonterminals are E and O. We begin by E.</p>
 | formal languages formal grammars | 1 |
2,175 | Constructing a data structure for a computer algebra system | <p>In thinking about how to approach this problem I think several things will be required, some tivial:</p>

<ol>
<li>An expression tree where non-leaf node is an operation (not sure if that part is redundant), but not every node has just two children.</li>
<li>All nodes for operations have a defined nu... | data structures computer algebra mathematical software | 1 |
2,184 | Massalin's Synthesis Quajects equivalent to ASM generating macros used in Game Oriented Assembly LISP? | <p><a href="http://valerieaurora.org/synthesis/SynthesisOS/abs.html" rel="nofollow">Alexia Massalin's Dissertation on Synthesis</a> was a Phd thesis on Operating Systems that contained a concept called 'Quajects' (see <a href="http://valerieaurora.org/synthesis/SynthesisOS/ch4.html" rel="nofollow">Chapter 4</a>). </p>&... | operating systems | 1 |
2,186 | Dependency Graph - Acyclic graph | <p>I have a directed acyclic graph where edge (A,B) means that vertex A depends on vertex B. </p>

<p>Vertex deletions have the following restrictions:</p>

<ol>
<li>When vertex B is removed, all dependent vertexes should also be removed. </li>
<li>When vertex A is removed and vertex A was the ... | algorithms graphs | 0 |
2,188 | How to use a greedy algorithm to find the non-decreasing sequence closest to the given one? | <p>You are given n integers $a_1, \ldots, a_n$ all between $0$ and $l$. Under each integer $a_i$ you should write an integer $b_i$ between $0$ and $l$ with the requirement that the $b_i$'s form a non-decreasing sequence. Define the deviation of such a sequence to be $\max(|a_1-b_1|, \ldots, |a_n-b_n|)$. Design an algor... | algorithms optimization greedy algorithms subsequences | 1 |
2,189 | What is the proof for the lemma "For every iteration of the Gomory-Hu algorithm, there is a representant pair for each edge"? | <p>For a given undirected graph $G$, a <a href="http://en.wikipedia.org/wiki/Gomory%E2%80%93Hu_tree" rel="nofollow">Gomory-Hu tree</a> is a graph which has the same nodes as $G$, but its edges represent the minimal cut between each pair of nodes in $G$. The Gomory-Hu algorithm finds such a tree for a graph. A represent... | algorithms graphs algorithm analysis | 0 |
2,192 | Finding lambda of Master Theorem | <p>Suppose I have a recurrence like $T(n)=2T(n/4)+\log(n)$ with $a=2, b=4$ and $f(n)=\log(n)$.</p>

<p>That should be <a href="http://en.wikipedia.org/wiki/Master_theorem#Case_1" rel="nofollow">case 1 of the Master theorem</a> because $n^{1/2}>\log(n)$. There is also a lambda in case 1: $f(n)=O(n^{(1/2)-\lam... | proof techniques asymptotics recurrence relation master theorem | 1 |
2,193 | How can I prove that a complete binary tree has $\lceil n/2 \rceil$ leaves? | <p>Given a complete binary tree with $n$ nodes. I'm trying to prove that a complete binary tree has exactly $\lceil n/2 \rceil$ leaves.
I think I can do this by induction.</p>

<p>For $h(t)=0$, the tree is empty. So there are no leaves and the claim holds for an empty tree.</p>

<p>For $h(t)=1$, the... | data structures graphs proof techniques combinatorics binary trees | 1 |
2,197 | How do I test if a polygon is monotone with respect to an arbitrary line? | <blockquote>
 <p><strong>Definition</strong>: A polygon $P$ in the plane is called monotone with respect to a straight line $L$, if every line orthogonal to $L$ intersects $P$ at most twice.</p>
</blockquote>

<p>Given a polygon $P$, is it possible to determine if there exists any line $L$ such that th... | algorithms computational geometry | 1 |
2,198 | Efficient subtype testing | <p>Languages like Java, C#, Eiffel, and C++ have subtype hierarchies which are directed acyclic graphs, due to interfaces in Java and C# and multiple inheritance in Eiffel and C++. An obvious way to check whether type $A$ is a subtype of type $B$ is to traverse the graph of the subtype hierarchy starting at $A$ to see ... | programming languages compilers typing | 0 |
2,199 | Streaming algorithm and random access | <p>Consider an array $X$ of $n$ cells, each containing a number from $\{1,..., n\}$. There is at least
one duplicate number, i.e., a number that appears at least twice. I want output <em>some</em> duplicate number. When streaming we may pass over $X$ more than once. The inspection of a cell generates cost $1$. The ... | algorithms randomized algorithms randomness streaming algorithm | 0 |
2,200 | Weighted subset sum problem | <p>Given an integer sequence $\{ a_1, a_2, \ldots, a_N \}$ that has length $N$ and a fixed integer $M\leq N$, the <a href="http://opc.iarcs.org.in/public/WEIGHTED-SUM.pdf" rel="nofollow noreferrer">problem</a> is to find a subset $A =\{i_1, \dots, i_M\} \subseteq [N]$ with $1 \leq i_1 \lt i_1 \lt \dots \lt i_M \leq N$... | algorithms optimization | 1 |
2,201 | Optimal myopic maze solver | <p>I was fooling around with <a href="http://neil.fraser.name/software/blockly/demos/maze/index.html" rel="nofollow noreferrer">Google Blocky's Maze demo</a>, and remembered the old rule that if you want to solve a maze, just keep your left hand to the wall. This works for any simple-connected maze and can be implement... | automata finite automata artificial intelligence | 1 |
2,204 | Do the minimum spanning trees of a weighted graph have the same number of edges with a given weight? | <p>If a weighted graph $G$ has two different minimum spanning trees $T_1 = (V_1, E_1)$ and $T_2 = (V_2, E_2)$, then is it true that for any edge $e$ in $E_1$, the number of edges in $E_1$ with the same weight as $e$ (including $e$ itself) is the same as the number of edges in $E_2$ with the same weight as $e$? If the s... | graphs spanning trees weighted graphs | 1 |
2,206 | Advanced placement CS A Exam | <p>What would be the standard topics covered in an 'Advanced Placement Computer Science A' test? Is there any good study reference someone can share? </p>

<p><strong>Edit: Answer</strong></p>

<p>An adjustment for my search term returned a <a href="http://en.wikipedia.org/wiki/Advanced_Placement_Comput... | reference request education | 1 |
2,208 | Reducing minimum vertex cover in a bipartite graph to maximum flow | <p>Is it possible to show that the minimum vertex cover in a bipartite graph can be reduced to a maximum flow problem? Or to the minimum cut problem (then follow max-flow min-cut theorem, the claim holds).</p>

<p>Intuitively: for each flow, pick one endpoint, then it is a minimum vertex cover in bipartite grap... | complexity theory graphs reductions network flow | 0 |
2,212 | Show that the halting problem is decidable for one-pass Turing machines | <p>$L=\{<\!M,x\!>\, \mid M's \text{ transition function can only move right and } M\text{ halts on } x \}$. I need to show that $L$ is recursive/decidable.</p>

<p>I thought of checking the encoding of $M$ first and determine whether its transition function moves only right (Can I do that?). If so then ... | formal languages computability turing machines check my proof | 1 |
2,215 | Alpha-Beta Pruning with simultaneous moves? | <p>I have a game I'm building some ai for that has 2 players making simultaneous moves. In this game there is exactly one move where, if they both make it at the same time, the outcome is different than if they'd made it separately (all other moves are pretty independent).</p>

<p>Anyway, I'm trying to find a ... | algorithms artificial intelligence search algorithms game theory | 0 |
2,216 | Show that a language is not regular using the Pumping Lemma | <blockquote>
 <p><strong>Possible Duplicate:</strong><br>
 <a href="https://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular">How to prove that a language is not regular?</a> </p>
</blockquote>



<p>Given a language $L = \{a^pb^{2p} \mid p \ge 1\}$, how cou... | formal languages regular languages pumping lemma | 0 |
2,218 | Turing machine and language decidability | <p>The document I am reading is here: <a href="http://www.cs.odu.edu/~toida/nerzic/390teched/tm/definitions.html" rel="nofollow noreferrer">Turing Machines</a></p>

<p>Before getting into the question, here is the notation used on the picture:</p>

<blockquote>
 <p>Here $\Delta$ denotes the blank a... | computability turing machines | 1 |
2,221 | Complexity class that properly included in DLOGTIME | <p>Is there any decision problem that is in a complexity class properly included in DLOGTIME? (except $O(1)$, of course)</p>

<p>If there is, can we create complete problems for DLOGTIME? So, can there be reduction by $O(\log(\log n))$ or smaller?</p>
 | complexity theory time complexity complexity classes | 0 |
2,222 | Are there complete problems for P and NP under other kinds of reductions? | <p>I know that the complexity class $\mathsf{P}$ has complete problems w.r.t. $\mathsf{NC}$ and $\mathsf{L}$ reductions.</p>

<p>Are these two classes the only possible classes of reductions under which $\mathsf{P}$ has complete problems? </p>

<p>Also, what classes of reduction can be used for $\maths... | complexity theory reductions | 1 |
2,225 | Point Location Problem in Polygon in Repetitive Mode for a Simple Polygon | <p>I consider <a href="http://en.wikipedia.org/wiki/Point_in_polygon" rel="nofollow">Point Location Problem in Polygon</a> in repetitive mode in the case of simple polygon.</p>

<p>In computational geometry,Point Location Problem in Polygon problem asks whether a given point in the plane lies inside, outside, o... | algorithms computational geometry | 1 |
2,226 | How to find spanning tree of a graph that minimizes the maximum edge weight? | <p>Suppose we have a graph G. How can we find a spanning tree that minimizes the maximum weight of all the edges in the tree? I am convinced that by simply finding an MST of G would suffice, but I am having a lot of trouble proving that my idea is actually correct. Can anyone show me a proof sketch or give me some hint... | algorithms graphs optimization spanning trees | 0 |
2,230 | Resolution complexity versus a constrained SAT algorithm | <p>EDIT: ad hoc speed-ups are excluded.</p>

<p>We have the result that <a href="http://homepages.cwi.nl/~rdewolf/resolutionlowerbound.pdf" rel="nofollow">propositional resolution requires exponential time</a>. The resolution result uses the proof of the pigeonhole principle as an example of a proof that takes ... | complexity theory logic satisfiability sat solvers | 0 |
2,233 | Automata that recognizes Kleene closure of permutations of three symbols | <p>This is an automata theory homework question.</p>

<p>I need to create DFA that meets the following criteria: </p>

<ul>
<li><p>Alphabet $\Sigma = \{ a, b, c \}$</p></li>
<li><p>Machine accepts empty string and strings of length that is a multiple of three, with every block of three containi... | formal languages automata finite automata | 1 |
2,235 | Can joins be parallelized? | <p>Suppose we want to join two relations on a predicate. Is this in NC?</p>

<p>I realize that a proof of it not being in NC would amount to a proof that $P\not=NC$, so I'd accept evidence of it being an open problem as an answer.</p>

<p>I'm interested in the general case as well as specific cases (e.g... | complexity theory time complexity parallel computing database theory descriptive complexity | 1 |
2,237 | Does Peterson's 2-process mutual exclusion algorithm account for dying processes? | <p>I think that in <a href="http://en.wikipedia.org/wiki/Peterson%27s_algorithm" rel="nofollow noreferrer">Peterson's algorithm</a> for <a href="http://en.wikipedia.org/wiki/Mutual_exclusion" rel="nofollow noreferrer">mutual exclusion</a>, if the process first to enter the critical section were to die or be cancelled, ... | programming languages concurrency mutual exclusion | 0 |
2,238 | Turing Recognisable => enumerable | <p>I get the proof of going from an enumerator to a Turing Machine (keep running enumerator and see if it matches input) but I don't see how the other way works.</p>

<p>According to my notes and the book (Intro to the Theory of Computation - Sipser), to get Turing enumerator from a Turing machine, we basically... | computability turing machines intuition | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.