instruction
stringlengths
0
29.8k
⌀
Has anyone seen this problem before? It's suppose to be NP-complete. >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 $V_i$ is consistent with an order...
A standard proof of the space hierarchy theorem is based on the space-efficient simulation of Turing machines. If I am not mistaken, this simulation implies that for every space-constructible function <i>f</i>: ℕ→ℕ, the following problem is in DSPACE(<i>f</i>(<i>n</i>)) (where <i>n</i> is the input length): > Given...
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 [DNF representation][1] of $f$. Anoth...
What you are looking for is "approximate near neighbor search" (ANNS) in the Levenshtein/edit distance. From a theoretical perspective, edit distance has so far turned out to be relatively hard for near-neighbor searches, afaik. Still, there are many results, see the references in this [Ostrovsky and Rabani][1] paper. ...
I wouldn't go for nerode. There is a standard proof for the equivalence of regular expressions and automata and building an automata for a given regexp is the easier part. Read it! The basic idea: For the "A|B" operation, build an automata that "guesses" if to run the automata of A or the one of B; for "A*B" build a...
The $log^2(n)$ implies that at each node in the search you probably have to do another search. This gave me an idea. Let's construct a tree from the input data: $$LeafNode = \{ x, y \}$$ $$NonLeafNode = \{ Min_x, Max_x, MinYPoint \}$$ Each node will partition the input space into two non-overlapping ranges. The ro...
The $\log^2(n)$ implies that at each node in the search you probably have to do another search. This gave me an idea. Let's construct a tree from the input data: $$\text{LeafNode} = \{ x, y \}$$ $$\text{NonLeafNode} = \{ \text{Min}_x, \text{Max}_x, \text{MinYPoint} \}$$ Each node will partition the input space int...
null
Fascinating question; I like your emphasis on objective criteria. We want freshmen to learn: **programming concepts**: The first programming language must support: function calls, iteration, recursion **fundamental ideas**: The first programming language must support arrays (for the first steps in a gentle...
The Boolean AND function can not be computed. Suppose actually that the AND function is computed by an $\text{OR} \circ \text{MOD}$ circuit. Then it follows that one of the MOD subcircuits must compute then AND function already, which is impossible.
*This answer is a summary of [Freshman's First Language](http://c2.com/cgi/wiki?FreshmansFirstLanguage) on the corporate wiki of Cunningham & Cunningham, Inc.* Fascinating question; I like your emphasis on objective criteria. We want freshmen to learn: **programming concepts**: The first programming language mu...
It is well-known that every boolean function $f:\{0,1\}^m\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 [DNF representation][1] of $f$. Anoth...
It is well-known that every boolean function $f:\{0,1\}^m\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 [DNF representation][1] of $f$. Anoth...
|logic|circuits|
|complexity-theory|circuits|
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 [DNF representation][1] of $f$. Anoth...
|algorithms|graphs|terminology|optimization|
I have the following question from Aurora (Computational Complexity - A modern Approach- Q 4.1) Prove the existence of a universal TM for space bounded computation (analogously to the deterministic universal TM of Theorem 1.9). That is, prove that there exists a a TM SU such that for every string α, and input x, i...
Space bounded Turing Machine - clarification on Computational Complexity (book: Aurora ) question 4.1.
|complexity-theory|turing-machines|space-complexity|
What you are looking for is "approximate near neighbor search" (ANNS) in the Levenshtein/edit distance. From a theoretical perspective, edit distance has so far turned out to be relatively hard for near-neighbor searches, afaik. Still, there are many results, see the references in this [Ostrovsky and Rabani][1] paper. ...
I have the following question from (Sanjeev Arora and Boaz Barak : Computational Complexity - A modern Approach- Q 4.1) Prove the existence of a universal TM for space bounded computation (analogously to the deterministic universal TM of Theorem 1.9). That is, prove that there exists a a TM SU such that for every...
Space bounded Turing Machine - clarification on Computational Complexity (book: Aurora ) question 4.1
|algorithms|graphs|terminology|optimization|
null
Space bounded Turing Machine - clarification on Computational Complexity (book: Arora-Barak ) question 4.1
null
I have the following question from [Computational Complexity - A modern Approach](http://www.cs.princeton.edu/theory/complexity/) by Sanjeev Arora and Boaz Barak: > *[Q 4.1]* > Prove the existence of a universal TM for space bounded computation (analogously to the deterministic universal TM of Theorem 1.9). T...
|complexity-theory|terminology|turing-machines|space-complexity|
Algorithms, that at each step make the locally optimal choice.
null
Questions about algorithms that make at each step the locally optimal choice.
I do not understand what you are trying to say after "--", but here is what you need to do: Hopefully you understand the idea of turing machine encoding: i.e. you can assign a unique identifier (i.e. "label") $\alpha$ to each turing machine. So by $M_\alpha$ we mean the Turing machine labeled by $\alpha$. So you nee...
From the comment above: Before processing the stream, allocate $\lceil \log_2 n \rceil$ bits, in which you write $x:= \bigoplus_{i=1}^n \mathrm{bin}(i).$ Naively, this takes $\mathcal{O}(n)$ time. Upon processing the stream, whenever one reads a number $j$, compute $x := x \oplus j$. Let $k$ be the single number...
My first programming language was a toy assembly language. The second was Fortran. In between, I was taught an "algorithms" notation, which was roughly Algol 60. I turned out quite ok. In fact, I think what I was taught was pretty much perfect. When I first looked at functional programming, in research papers th...
I only know CSP and CCS/pi-calculus (not ACP). CSP was motivated by imperative programming processes communicating via messages. Hoare then tried to abstract away a simple calculus out of it. CCS, on the other hand, was an effort to create a foundational calculus like lambda calculus. Given their original startin...
null
There is a family of random graphs $G(n, p)$ with $n$ nodes. 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)$. I know that $E(X_k)=\tbinom{n}{k}\cdot p^{\tbinom{k}{2}}$, but how do i proove it? How to show that for $n\rig...
Clique sizes in random graphs
|graphs|probability-theory|proof-assistants|random|
There is a family of random graphs $G(n, p)$ with $n$ nodes. 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)$. I know that $E(X_k)=\tbinom{n}{k}\cdot p^{\tbinom{k}{2}}$, but how do I prove it? How to show that for $n\righ...
|complexity-theory|circuits|logics|
|complexity-theory|logic|circuits|
|graphs|combinatorics|probability-theory|random-graphs|
So basically there are three questions involved. ---------- ## I know that $E(X_k)=\tbinom{n}{k}\cdot p^{\tbinom{k}{2}}$, but how do I prove it? ## You use the linearity of expectation and some smart re-writing. First of all, note that $$ X_k = \sum_{T \subseteq V, \, |T|=k} \mathbb{1}[T \text{ is clique}].$$...
I can understand the importance that computer scientists or any software development related engineers should have understood the study of basic logics as a basis. But is there any tasks/jobs that explicitly require the knowledge about these, other than the tasks that require any kind of knowledge representation us...
null
From the comment above: Before processing the stream, allocate $\lceil \log_2 n \rceil$ bits, in which you write $x:= \bigoplus_{i=1}^n \mathrm{bin}(i)$ ($\mathrm{bin}(i)$ is the binary representation of $i$ and $\oplus$ is pointwise exclusive-or). Naively, this takes $\mathcal{O}(n)$ time. Upon processing the s...
null
null
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? Forward checking or arc consistency? From what I gathered forward-checking is $O(n)$, while Arc consistency is about $O(8c)$ where c is the number of constraints (...
forward checking vs arc consistency on 3-SAT
|algorithms|search-problem|3-sat|
null
[As discussed in this question,][1] I drafted a spec algorithm that hinges on finding a specific root of a system of trigonometric equations satisfying the following recurrence: $\qquad f_{p_0} = 0\\ \qquad p_0 = 2\\ \qquad \displaystyle f_{p_n}(x) = f_{p_{n-1}}(x) + \prod_{k=2}^{p_{n-1}} (-\cos(2\pi(x+k-1)/p_{...
Computational complexity of computer algebra for systems of trigonometric equations
|complexity-theory|reference-request|computer-algebra|
Both forward checking (FC) and arc consistency (AC) are methods of inference. Regardless of the problem you are solving, choosing a specific method of inference is always a tradeoff. Basically, the more you are willing to pay in terms of time, the more you gain in terms of strength of inference. So yes, it is faster to...
Forward checking vs arc consistency on 3-SAT
Complexity of computer algebra for systems of trigonometric equations
There is a family of random graphs $G(n, p)$ with $n$ nodes ([due to Gilbert](https://en.wikipedia.org/wiki/Random_graph)). 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)$. I know that $\mathbb{E}(X_k)=\tbinom{n}{k}\cdot p^...
Number of clique in random graphs
|algorithms|satisfiability|heuristics|3-sat|constraint-satisfaction|
|reference-request|mathematical-analysis|computer-algebra|
|reference-request|runtime-analysis|mathematical-analysis|computer-algebra|
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? [Forward checking](http://en.wikipedia.org/wiki/Look-ahead_(backtracking)#Look_ahead_techniques) or [arc consistency](http://en.wikipedia.org/wiki/Arc_consistency#...
my problem is how can i form a $regular$ $grammar$ into a $linear$ $grammar$ ? I know that a linear grammar has the form A-> $w_1Bw_2$ A-> $w$ , where A,B $\varepsilon$ N, $w,w_1,w_2$ $\varepsilon$ $\Sigma$ Thanks
regular grammar in linear grammar
|formal-grammars|
My problem is how can I transform a *regular* grammar into a *linear* grammar? I know that a linear grammar has the form $\begin{align} A &\to w_1Bw_2 \\ A &\to w \end{align}$ where $A,B \in N$ and $w,w_1,w_2 \in \Sigma$.
Transform regular grammar in linear grammar
|terminology|formal-grammars|
A (right) regular grammar is one in which all production rules are of one of the following: $$B \rightarrow a$$ $$B \rightarrow aC$$ $$B \rightarrow \lambda$$ Where $B$ is a non-terminal, $a$ is a terminal and $\lambda$ is the empty word. A regular grammar is a grammar which is either right-regular xor left-reg...
I do not know where you got that "definition" but it is not the typical one. From [Wikipedia](https://en.wikipedia.org/wiki/Linear_grammar): > [A] grammar is linear if it is context-free and all of its productions' right hand sides have at most one nonterminal. So every regular grammar is linear *by definition*. ...
null
My problem is how can I transform a *regular* grammar into a *linear* grammar? I know that a linear grammar has the form $\begin{align} A &\to w_1Bw_2 \\ A &\to w \end{align}$ where $A,B \in N$ and $w,w_1,w_2 \in \Sigma^*$.
_regular_ in what sense? - If you mean _regular_ in the sense of a regular language then the question is trivial since [regular grammar][1] is [already][2] a linear grammar. - If you mean _regular_ in the sense of a _customary_ or _usual_ i.e. > How to transform an arbitrary context-free grammar into a linear ...
I've got a problem with this task. I should declare a context-free grammar to this language: $L1 := a^nb^ma^{n+m} : n,m \varepsilon N$ $\rbrace$ My idea is: We need a start symbol, for example S. I know that i can generate the first $a$ and the last $a$(S-> a a). I don't know what is the next idea to solve thi...
context-free grammar and language
|formal-grammars|
I've got a problem with this task. I should declare a context-free grammar for this language: $\qquad \displaystyle L := \{\, a^nb^ma^{n+m} : n,m \in \mathbb{N}\,\}$ 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 \to a a$. I don't know what is ...
|formal-languages|context-free|formal-grammars|
Hint: Develop grammars for the simple languages $\{a^nb^n \mid n \in \mathbb{N}\}$ and $\{a^nb^m \mid m,n \in \mathbb{N}\}$, respectively, and combine (variations of) them to generate your $L$.
Context-free grammar for $\{ a^n b^m a^{n+m} \}$
First, rewrite $a^nb^ma^{n+m}$ as $a^nb^ma^ma^n$. Now, from the outside in, you need rules to (1) add an $a$ to the front and back of your strings, and (2) to add $b$ to the front and $a$ to the back. It's also helpful to imagine building strings from the inside out... you can either add a $b$ to the front and an $a$ t...
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. Is there any part of CS that deals with Viruses and Anti Viruses ?
What is the CS justification for Anti Virus programms?
null
Knuth considered this idea in V1 of TAoCP. Ho observed that we would need a new device to replace the flip-flop, and he proposed calling it the **flip-flap-flop**. Was he serious? Well, Knuth has quite a [sense of humor](http://en.wikipedia.org/wiki/Donald_Knuth#Humor). But it looks like somebody has [implemented th...
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. Is there any part of CS that deals with Viruses and Anti Viruses ? PS : I am not asking about non CS related justification of to have A...
What is the branch of Computer Science that studies how Anti Virus programs work?
null
There is a subarea of computer security called Computer Virology. The [Journal of Computer Virology][1] is devoted to the topic. Studying how anti-virus software works only scratches the surface of what the area is about. For instance, there is even some work applying logic to malware: [_A General Definition of Ma...
Viruses and antivirus technology have a lot to do with CS. Your question reminded me of something I recently read. Here's an excerpt from the book by Williamson & Shmoys, The Design of Approximation Algorithms, page 6. It's justifying the (practical) importance of approximation algorithms, and uses the well-known [set ...
|reference-request|security|
First, rewrite $a^nb^ma^{n+m}$ as $a^nb^ma^ma^n$. Now, from the outside in, you need rules to (1) add an $a$ to the front and back of your strings, and (2) to add $b$ to the front and $a$ to the back. It's also helpful to imagine building strings from the inside out... you can either add a $b$ to the front and an $a$ t...
Questions about matters of computer, software and communication security, that is how to protect systems against attacks.