instruction
stringlengths
0
29.8k
⌀
As JeffE mentions in a comment, a [grid graph][1] is an example of a [bipartite graph][2]. If you take a bipartite graph, and remove some of the vertices, it will still be a bipartite graph. [Königs Theorem][3] states, that for bipartite graphs, the number of vertices in a [minimum covering][4], equals the number of...
The idea is quite simple. Write your function `run` and analyze its time complexity $r(n)$. Is it then so that you can find *any* nonnegative constant $c$ and input size $n_0$ such that from which $r(n_0) \leq cg(n_0)$, where $g(n)$ is any particular function you desire? This idea comes from the [formal definition of B...
null
When you are given a problem statement there will be an input.The given input has to be countable in some way. In order to get the answer or output you got to manipulate the input in some way are the other in programming. The question is ,how many operation are you going to do on your inputs ... it depends on problem r...
Say you have m boolean inputs. You need to construct a boolean circuit (using gates that map two booleans to one, e.g.: AND, OR, NOT, XOR, ...) that evaluates to true if at least n (n < m) are true. Asymptotically how small can you make this circuit? EDIT: Any reasonably tight upper bound would be appreciated. I ke...
Have a look at Ray Reiter's ["A Theory of Diagnosis from First Principles"][1] where he gives an algorithm for computing hitting sets, and this additional note ["A correction..."][2]. The algorithm is generally known as "hitting set tree" algorithm, it shouldn't be too hard to find an implementation. You mentio...
The idea is quite simple. Write your function `run` and analyze its time complexity $r(n)$. Is it then so that you can find *any* nonnegative constant $c$ and input size $n_0$ such that from which $r(n_0) \leq cg(n_0)$, where $g(n)$ is any particular function you desire? This idea comes from the [formal definition of B...
The problem is the well-known NP-complete problem [Hitting Set](http://en.wikipedia.org/wiki/Set_cover_problem#Hitting_set_formulation). It is closely related to [Set-Cover](http://en.wikipedia.org/wiki/Set_cover_problem). The NP-completeness proof can found in the classic [book of Garey and Johnson](http://dl.acm.org/...
I am coding a neural network implementation, but a I have problems in the design. I was wondering about how to compare the <em>output</em> with the <em>target</em>, my neural networks has three outputs <code> groups = {'Iris-virginica':[0,0,1], 'Iris-setosa':[0,1,0], 'Iris-versicolor':[1,0,0]}</code> I know I mus...
How to compare the output of a neural network with his target?
|algorithms|neural-networks|
The easy answer: Take the predicted class to be the argmax of your output vector. The longer answer: Since you're doing multiclass classification you should probably be using [softmax][1] output units (if I had to guess, I would guess you're using sigmoid output units). If $\mathbf{x} \in \mathbb{R}^n$ is the input...
Practically speaking, one of the better ways (certainly one of the easiest) to solve instances of Set Cover/Hitting Set is mixed integer programming. This involves communicating the [integer programming formulation](http://en.wikipedia.org/wiki/Set_cover_problem) to the [solver](http://plato.asu.edu/ftp/milpc.html) of ...
null
everyone. Please consider the following triple-nested loop: for (int i = 1; i <= n; ++i) for (int j = i; j <= n; ++j) for (int k = j; k <= n; ++k) // statement The statement here is executed exactly $n(n+1)(n+2)\over6$ times. Could someone please explain how this formul...
Time complexity of a triple-nested loop
|time-complexity|algorithm-analysis|
Network structure inspired by simplified models of biological neurons (brain cells). Neural networks are trained to "learn" by supervised and unsupervised techniques, and can be used to solve optimization problems, approximation problems, classify patterns, and combinations thereof.
null
Neural networks have many practical applications within the software realm. An application of supervised learning would be the use of a [Backpropagation](http://en.wikipedia.org/wiki/Backpropagation) network for optical character recognition or handwriting recognition. The network would be trained on exemplars of...
null
You can count the number of times the innermost for loop is executed by counting the number of triplets (i,j,k) for which it is executed. By the loop conditions we know that: $1 \leq i \leq j \leq k \leq n$ . We can reduce it to the following simple combinatorics problem. - Imagine $n+2$ boxes of red colour plac...
Please consider the following triple-nested loop: for (int i = 1; i <= n; ++i) for (int j = i; j <= n; ++j) for (int k = j; k <= n; ++k) // statement The statement here is executed exactly $n(n+1)(n+2)\over6$ times. Could someone please explain how this formula was obtai...
You can count the number of times the innermost for loop is executed by counting the number of triplets $(i,j,k)$ for which it is executed. By the loop conditions we know that: $1 \leq i \leq j \leq k \leq n$ . We can reduce it to the following simple combinatorics problem. - Imagine $n+2$ boxes of red colour pl...
In computer vision, scales are important when we carry out a scene analysis. Choosing different scales affect the result of the analysis. For example, if a face is relatively small in the scene, then the details including nose, eyes will be omitted. On the other hand, details on larger faces become relatively more sali...
Which Is a Better Way of Obtaining Scales, Gaussian Blur or Down Sampling?
|machine-learning|computer-vision|image-processing|
null
Is the following FOL-problem (equality is a logical symbol) effectively decidable? **Given.** A finite equation system $E$ and an equation $s = t$. **Question.** Is there a substitution $\sigma$, such that $\sigma(E) \models \sigma(s = t)$?
Is the validity of some instance of an equational problem decidable?
|computability|logic|decision-problem|equality|
null
|algorithms|time-complexity|algorithm-analysis|
I am about to implement a domain specific language for representation of social learning conventions. Part of the implementation is a formal description of a language - its 'calculus', symbols and logical expressions. My approach would be to describe the language by describing its grammar but there are also concepts...
Formally describing a new programming language
|formal-languages|
Formally describing a new domain-specific programming language
Formally describing a new domain specific programming language
The rules are that you can only build from an existing part, so in the example below, B is the only option for the first move = A. A mechanical assembly might be represented as follows: E | C | A-B | D | F Where the valid assembly paths when starting ...
Given a mechanical assembly as a graph, how to find an upper bound on number of assembly paths
|graphs|
Is Huffman coding **always** optimal since it uses Shanon's ideas ? What about text, image, video, ... compression? Please name papers or books discussing these algorithms. Thanks
Is there any theoretically proven optimal compression algorithm?
|data-compression|
Huffman coding is optimal for a symbol-to-symbol coding where the probabilities of every symbol are independent and known before-hand. However, when these conditions are not satisfied (as in image, video), other coding techniques such as LZW, JPEG, etc. are used. For more details, you can go through the book "Introduct...
Just thinking of Counter Strike as a canonical example, if you have a coordinate representation of the map and for every player you have a complete history of everything you might need for every moment of time, say every 10 miliseconds or something and you just recorded where the players went around the map, and what t...
What could you learn from studying player movement and behaviour on online FPS games?
|algorithms|game-theory|
Down sampling may discard relevant features, while blurring should not. As a toy example, a down sample may remove a pixel which is a local maxima, while a blur operation will preserve the maxima by increasing the values of nearby pixels. If the local maxima corresponds to an interesting feature, it may still be dis...
Is the following FOL-problem (equality is a logical symbol) effectively decidable? **Given.** A finite equation system $E$ and an equation $s = t$. **Question.** Is there a substitution $\sigma$, such that $\sigma(E) \models \sigma(s = t)$? **Some useful information.** 1. Obviously one can restrict...
Is the following FOL-problem (equality is a logical symbol) effectively decidable? **Given.** A finite equation system $E$ and an equation $s = t$. **Question.** Is there a substitution $\sigma$, such that $\sigma(E) \models \sigma(s = t)$? **Some useful information.** 1. Obviously one can restrict...
There are many semantic formalisms to consider as your basis: * denotational semantics --- gives meaning in terms of semantic domains * operational semantics --- gives meaning in terms changes to an abstract machine states * axiomatic semantics --- gives meaning in terms of assertions about the state of t...
|formal-languages|programming-languages|semantics|
Is the following FOL-problem (equality is a logical symbol) effectively decidable? **Given.** A finite equation system $E$ and an equation $s = t$. **Question.** Is there a substitution $\sigma$, such that $\sigma(E) \models \sigma(s = t)$? **Some useful information.** 1. Obviously one can restrict...
Say we're given n sets and the size of their union is m. We would like to construct a small set which contains at least k of the n given sets. Lets assume that m is less than some polynomial in n, i.e.: m < P(n). In this case is there an efficient (polynomial) algorithm for the optimization problem: find the sma...
Find small superset of at least k of n given sets
|complexity-theory|np-complete|np-hard|polynomial-time|
for me, it's easier to notice the inner loop is executed $n-i$ times and the total number of executions in the inner loop is $(n-i)+(n-i-1)+(n-i-2)+\ldots+1$ this can be rewritten as $\sum_{j=0}^{n-i} n-i-j$ and is executed $n$ times, so the total number of executions is $$ \sum_{i=0}^{n}\sum_{j=0}^{n-i} n-i-...
Just thinking of Counter Strike as a canonical example, if you have a coordinate representation of the map and for every player you have a complete history of everything you might need for every moment of time, say every 10 miliseconds or something and you just recorded where the players went around the map, and what t...
null
Probably if you apply [machine learning][1] methods to the basic movements/fire actions of a specific player you can develop an AI bot that plays well against that player. But adding more high level actions like targets, waypoints, coordinated team actions, terrain features, and so on, you'll probably end up with mo...
Just thinking of Counter Strike as a canonical example, if you have a coordinate representation of the map and for every player you have a complete history of everything you might need for every moment of time, say every 10 miliseconds or something and you just recorded where the players went around the map, and what t...
I got one grammar: re2: re1 $ re1: expr == expr | expr != expr | expr < expr | expr <= expr | expr >= expr | expr > expr | expr expr: expr + term | expr - term | term term: term * factor | term / factor | factor factor: (expr) | num | id num: (0|1|2|3|4|5|6|...
Ambiguous grammar? Could the grammar be parsed by SLR parser?
|parsing|
|algorithms|computer-games|
|formal-languages|formal-grammars|compilers|parsing|
|algorithms|information-theory|data-compression|
|algorithms|graphs|
When we calculate the time-complexity of some algorithm we make many simplifications (or assumptions) on our calculation. For instance we say that assume basic arithmetic operations are all constant time and we assume reading/writing to a memory location is constant time. I've worked on some algorithms where these a...
Complexity calculations, assumptions on basic costs
|complexity-theory|time-complexity|
There are two parts of the semantics you will need to describe: * **static semantics**: structure of well formed programs * **dynamic semantics**: meaning of running programmings **Static semantics** usually take the form of type systems. I'd recommend looking at the books by [Benjamin C Pierce][1] and [Robert...
I was not able to find a mentioned search engine, but I was able to make it myself with a help of Google Custom Search. In general, search over a limited group of high quality sites and domain zones returns much better results, than it does ordinary unscoped search engine. See [http://neatserpent.com/][1] [1]...
null
This problem is known as *rigid E-unification*. This problem is NP-complete. The first proof was given by Gallier, Narendran, Plaisted and Snyder [1]. However a related problem, the *Simultaneous rigid E-unification* that is to find a substitution that simultaneously satisfies several instances of rigid E-unificati...
The simple answer is you're using the wrong approach. It's much easier to construct a regular expression or finite automation to prove that a language is regular. This language is expressible using the following regular expression: (aa)* I think your issue is your assumption that the pumping length is 4. Y...
L={a<sup>n</sup> : n is even}<br> <b>This is regular but fails in pumping Lemma</b><br> assuming m=4,<br> w=aaaaaa,|w|=6(even)<br> let w=xyz<br> x=a, <br> y=aaa,<br> |y|>0<br> |xy|<=m<br> w<sub>i</sub>=xy<sup>i</sup>z<br> for i=2,<br> w<sub>2</sub>=xy<sup>2</sup>z=aaaaaaaaa<br> |w<sub>2</sub>|=9<br> th...
Pumping Lemma for regular language for a^n where n is even fails
|finite-automata|pumping-lemma|
null
|automata|finite-automata|pumping-lemma|
$$L=\{a^n \mid \text{\(n\) is even}\}$$ This is regular but fails in the pumping Lemma. Assuming $m=4$, $w=aaaaaa$, $|w|=6$ (even). Let $w=xyz$, $x=a$, $y=aaa$. We have $|y|>0$ and $|xy| \le m$. Let $w_i=xy^iz$. For $i=2$, $w_2=xy^2z=aaaaaaaaa$. $|w_2|=9$ therefore it is not regular. Where am I going...
|regular-languages|finite-automata|pumping-lemma|
The pumping lemma states that: there exists a pumping length $p$ such that for any word $w \in L$ of length $|w| \ge p$, there exists a decomposition $w = xyz$ meeting certain properties. There are two errors in your proof. The first is that the lemma states that there exists a pumping length $p$ but doesn...
The pumping lemma states that: there exists a pumping length $p$ such that for any word $w \in L$ of length $|w| \ge p$, there exists a decomposition $w = xyz$ meeting certain properties. There are two errors in your proof. The first is that the lemma states that there exists a pumping length $p$ but doe...
It is generally referred to as "Random Access Machine" or RAM model. This model assumes that accessing any unit of data, irrespective of its position or type, takes the same constant amount of time. Now, what you take as a "unit" of data is important. For all practical purposes, we may consider the primitive data types...
I was not able to find a mentioned search engine, but I was able to make it myself with a help of Google Custom Search. I made a custom search engine with *.edu, *.ac.uk, *.edu.au and so on sites and domain zones, 145 in a total at this moment. From my point of view that search engine gives much better result pages, th...
null
null
null
null
Say we're given $n$ sets and the size of their union is $m$. We would like to construct a small set which contains at least $k$ of the $n$ given sets. Lets assume that $m$ is less than some polynomial in $n$, i.e.: $m < P(n)$. In this case is there an efficient (polynomial) algorithm for the optimization problem: ...
null
null