instruction
stringlengths
0
29.8k
⌀
|formal-grammars|context-free|
Hint: Start with a CFG for the language $\{ a^{n+t} b^n : n \geq 0, t \geq 1 \}$.
This problem is equivalent to the following, and it's trivial to construct reduction both ways. Given a list of bit vectors, find the minimum number of them such that `and` all of them result the $0$ bit vector. $(*)$ Then we show set cover reduces to $(*)$. By set cover, I mean given a list of sets $S_1,\ldots,S...
null
null
I've learned that a while loop such as int i = 100; while (i >= 1){ ... ///Stuff i = i/2 } will run in logarithmic time, specifically, `O(logn)`, since it keeps dividing in half each time (like a binary search). However, what if my while loop looks like this ...
Complexity of a while loop that divides by parameter by three each iteration
|complexity-theory|
Hint: The number of times the loop is run, assuming it starts at $n$ and divides by $b$ each time, is exactly $\lfloor \log_b n \rfloor + 1$.
I'm trying to determine the complexity of this for loop: for (int j =3; j <= n-2; j+=2) { .... } By trying out lots of examples, I came up with $\frac{n-4}{2} + 1$. This seems to work with every number now. However, I am looking for a systematic and quick way to find these sorts of complexitie...
Complexity of slightly tricky for loop
|complexity-theory|algorithm-analysis|
null
{"OriginalQuestionIds":[9804],"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
I am not sure if this is the right forum to ask this. I have some data of the houses, like their size(in square meters), if they use aircondition, how many residents live in, I have their electricity consumption as well. I want to train any Machine Learning Algorithm to the dataset above, in order to create a model...
Problem in using the appropriate machine learning algorithm
|algorithms|machine-learning|artificial-intelligence|
|algorithm-analysis|asymptotics|runtime-analysis|
|algorithm-analysis|runtime-analysis|
I am studying computational theory with Sisper's textbook. I can`t quite understand the definition of "reduction" This problem can be reduced to ATM ... bula bula ... What is the exact reduce mean ? I can`t draw the picture in my head. Anyone can help me to understand this definition clearly ? thanks...
Mapping reduction ? reduction?
|turing-machines|automata|reductions|
This is kind of a broad question, and there are a lot of well-written references. This answer is just a basic starting point. Intuitively, when we reduce a problem $A$ to a problem $B$, we mean that if we know how to solve $B$, this somehow induces a solution to $A$ (the "somehow" is the reduction). Taking the contr...
This is kind of a broad question, and there are a lot of well-written references. This answer is just a basic starting point. Intuitively, when we reduce a problem $A$ to a problem $B$, we mean that if we know how to solve $B$, this somehow induces a solution to $A$ (the "somehow" is the reduction). Taking the contr...
As already suggested by Yuval Filmus and Steven Stadnicki, (3) works for $\mathrm{P}$. I'll elaborate on this: Let $\Sigma(L)=\{a\mid\exists i\exists w_1,\dots,w_k \in L:\, w_i = a \}$ the set of symbols used by any word in $L$. Now take a symbol $\#\notin\Sigma(L)$ and a function $f:\mathbb{N}\rightarrow\mathbb{N}$...
I am learning about information theory and mutual information. However, I am quite confused with MI(Mutual information) vs. PMI(Pointwise mutual information) especially signs of MI and PMI values. Here are my questions. - Is MI values a non-negative value or it can be either positive or negative? If it is alway...
Pointwise mutual information vs. Mutual information?
|probability-theory|information-theory|entropy|
$\frac{1}{2}$-answer: The example is somewhat incomplete, since it doesn't say what's the premise and conclusion for this instance of **E-IFTRUE**: premise: - There is no premise, this rule is an axiom (or rather a set of axioms for all terms $t_2$,$t_3$). conclusion: - `if true then true else (if f...
This question arises from my reading of ["Types and Programming Languages"][1] ([WorldCat][2]) by Benjamin C. Pierce. On page 36 is the definition for *satisfied* > A rule is *satisfied* by a relation if, for each instance of the rule, > either the conclusion is in the relation or one of the premises is > not. ...
CSP is used for the description and representation of concurrent systems, how it is used in practice (theoretically and programmatically) ? What are the application areas (other than concurrent & parallel systems) where it is used ?
what are some of the pratical applications of CSP process algebra?
|process-algebras|
null
Using the appropriate machine learning algorithm
This question arises from my reading of ["Types and Programming Languages"][1] ([WorldCat][2]) by Benjamin C. Pierce. On page 36 is the definition for *satisfied* > A rule is *satisfied* by a relation if, for each instance of the rule, > either the conclusion is in the relation or one of the premises is > not. ...
I am trying to understand how to do the amortized cost for a dynamic table. Suppose we are using the accounting method. Let A of size m be an array of n elements. When n = m, then we create a new array of size 4m, and then copy the elements of A to the new array. When n = m/4, then you create a new array of size m/4...
How to compute amoritized cost for a dynamic array?
|amortized-analysis|
CSP is used for the description and representation of concurrent systems, how it is used in practice (theoretically and programmatically)? What are the application areas (other than concurrent and parallel systems) where it is used?
What are some of the pratical applications of CSP process algebra?
I am studying computational theory with Sisper's textbook. I can`t quite understand the definition of "reduction" This problem can be reduced to ATM ... bula bula ... What is the exact reduce mean ? I can`t draw the picture in my head. Anyone can help me to understand this definition clearly ?
Mapping reduction? Reduction?
null
CSP is the formal basis of the programming language [Occam][1] which compiled to INMOS Transputers. Transputers appeared in all sorts of devices, such as set-top boxes for satellite TV. Eventually, however, the company doing all of this work failed to achieve commercial success, and was eventually absorbed by another c...
What are some of the practical applications of CSP process algebra?
null
PMI can clearly be negative, since if $p(x,y)<p(x)p(y)$, then taking $\log \frac{p(x,y)}{p(x)p(y)}$ gives a negative number. But MI is always non-negative, as it can be written as $d_{KL}(p(x,y)||p(x),p(y))$, where $d_{KL}$ is the [Kullback–Leibler divergence](http://en.wikipedia.org/wiki/Kullback-Leibler_divergence...
$\frac{3}{4}$-answer: The example is somewhat incomplete, since it doesn't say what's the premise and conclusion for this instance of **E-IFTRUE**: premise: - There is no premise, this rule is an axiom (or rather a set of axioms for all terms $t_2$,$t_3$). conclusion: - the pair $($ `if true then tr...
One way of reading the definition of _satisfied_ that might help is to change > A rule is satisfied by a relation if, for each instance of the rule, either the conclusion is in the relation or one of the premises is not. to the logically equivalent statement > A rule is satisfied by a relation if, for each insta...
One way of reading the definition of _satisfied_ that might help is to change > A rule is satisfied by a relation if, for each instance of the rule, either the conclusion is in the relation or one of the premises is not. to the logically equivalent statement > A rule is satisfied by a relation if, for each insta...
null
$\frac{7}{8}$-answer: As Dave Clark pointed out the Definition of *satisfied* is actually an implication, remember in propositional logic: $$(A\rightarrow B)\equiv (\neg A \vee B)$$ This is no coincidence, inference rules are also used to define provability in formal logic. <hr/> Example for **E-IFTRUE**: ...
|operational-semantics|small-step-semantics|term-rewriting|
$\frac{7}{8}$-answer: As Dave Clarke pointed out the Definition of *satisfied* is actually an implication, remember in propositional logic: $$(A\rightarrow B)\equiv (\neg A \vee B)$$ This is no coincidence, inference rules are also used to define provability in formal logic. <hr/> Example for **E-IFTRUE**: ...
null
To quote user Martin Berger Term rewriting is a general model of computation that investigates a wide range of (potentially non-deterministic) methods of replacing subterms of syntactic expression, more precisely an element of a term-algebra (over some set of variables) with other terms.
null
Term rewriting is a general model of computation that investigates a wide range of (potentially non-deterministic) methods of replacing subterms of syntactic expression, more precisely an element of a term-algebra (over some set of variables) with other terms.
Maybe the transfers in t1 and t2 share some component in the datapath, such as a bus for making the transfer. Where does Save_address come from?
You can simulate the architecture using a **hardware-description language**. Try VHDL (http://esd.cs.ucr.edu/labs/tutorial/) or Verilog ( http://www.asic-world.com/verilog/veritut.html) two of the most popular hardware description languages.
null
Based on my experience as well as the Wikipedia article, there are several kinds of [finite state machines](http://en.wikipedia.org/wiki/Finite_state_machine), including * [finite automata](http://en.wikipedia.org/wiki/Nondeterministic_finite_automata), * [transducers](http://en.wikipedia.org/wiki/Finite_state_tr...
|data-structures|algorithm-analysis|amortized-analysis|
null
One of the most celebrated applications of CSP and was the use of the CSP tool FDR in the analysis of the Needham-Schroeder protocol. It has had other applications in analyzing protocols and software design. > [Breaking and fixing the Needham-Schroeder Public-Key Protocol using FDR][1], Gavin Lowe, TACAS 1996 > ...
There are not an appropiate algorithm for each problem, you must to research and compare results between your algorithms or techniques with an error measure (MSE, etc.). In general, machine learning algorithms are empiric models (approximated functions). There are arised from the problem itself and a set of supposit...
I am studying MIT OCW lecture notes but they do not have solutions. I got stuck at questions $ b , c, d. $ I have no idea how to solve it. I tried induction on $b$ without a luck but still induction does not even help for infinite DAG cases. ***DAG: Directed Acyclic Graph*** In a round-robin tournament, ever...
Acyclic Tournament Digraphs and Hamiltonian Paths
|graphs|
null
As Dave Clarke pointed out the Definition of *satisfied* is actually an implication, remember in propositional logic: $$(A\rightarrow B)\equiv (\neg A \vee B)$$ This is no coincidence, inference rules are also used to define provability in formal logic. <hr/> Example for **E-IFTRUE**: premise(s): - Ther...
So I've been doing some reading on community detection in graphs as I'm planning on working on my thesis for it. I've been reviewing papers regarding the same and came across the Girvan-Newman algorithm (http://www.pnas.org/content/99/12/7821.abstract). I've read the paper and have a doubt which I couldn't really figur...
Community Detection in Graphs
|graphs|
So I've been doing some reading on community detection in graphs as I'm planning on working on my thesis for it. I've been reviewing papers regarding the same and came across the [Girvan-Newman algorithm](http://www.pnas.org/content/99/12/7821.abstract). I've read the paper and have a doubt which I couldn't really figu...
How do we know to what community an edge belongs to in the Girvan-Newman algorithm?
How do we know to what community a vertex belongs to in the Girvan-Newman algorithm?
Let $T= (V,E)$ be a tournament. 1. A simple directed cycle clearly gives a tournament with more than one ranking. 2. Let $a \leq b$ denote the fact that $(a,b) \in E$. Now suppose there is more than one ranking. Then there exists $a \leq b$ and $b \leq a$ in their respective paths. This implies a cycle in the ori...
I am studying MIT OCW lecture notes but they do not have solutions for the following problem. **Directed Acyclic Tournaments** In a round-robin tournament, every two distinct players play against each other just once. For a round-robin tournament with no tied games, a record of who beat whom can be described w...
|graphs|proof-techniques|
Let $T= (V,E)$ be a tournament. 1. A simple directed cycle clearly gives a tournament with more than one ranking. 2. Suppose there is more than one ranking. Then there exists subpaths $a \rightsquigarrow b$ and $b \rightsquigarrow a$ in their respective rankings. This implies a cycle in the original tournament $T...
For clarity let $T= (V,E)$ be a tournament and let $a \rightsquigarrow b$ denote a path from $a$ to $b$ in $T$. 1. A simple directed cycle clearly gives a tournament with more than one ranking. 2. Suppose there is more than one ranking. Then there exists subpaths $a \rightsquigarrow b$ and $b \rightsquigarrow a$ ...
suppose f(x) is one way function, what about h(x)=f(x1) X-OR f(x2), where x=x1 concatenate x2 and |x1|=|x2|
if xor-ing a one way function with different input, is it still a one way function?
|cryptography|encryption|
|cryptography|one-way-functions|
|cryptography|one-way-functions|
|proof-techniques|cryptography|one-way-functions|
|cryptography|hash|one-way-functions|
One-way functions (OWF) are easy to compute, but hard to invert. They exists only if P$\ne$NP. Many cryptographic primitives are based on (or are implied by) the existence of one-way functions.
Hint: fix $x_2$ to some value. Is the restricted function one-way? What does this imply on $h()$?
null
Suppose $f(x)$ is a one way function, what about $h(x)=f(x_1) \, \mathrm{X-OR} \,f(x_2)$, where $x=x_1 \, \mathrm{concatenate} \, x_2$ and $\lvert x_1 \rvert = \lvert x_2\rvert$
If xor-ing a one way function with different input, is it still a one way function?
null
I am completing Nicholas's answer because I think there are problems with his answers to 3 and 4 and explaining why is a bit too long for comments. For 3. you need to show there is a simple path in the tournament that visits every vertex (this is called a hamiltonian path). You can do this simply by induction. Clear...