instruction stringlengths 0 29.8k ⌀ |
|---|
consider the empty {P,Q}-structure ... |
The key issue here is whether switching quantifiers is okay. Turn the top-level implication around and see what happens then.
As for this formula, think about what the left- resp. the right-hand side say.
* Left: "Every $x$ has a $y$ so that... holds."
* Right: "There is a $y$ so that ... holds for all $x$."
... |
|logic|logical-validity| |
In Logic In Computer Science (2nd Edition - Michael Huth and Mark Ryan), exercise 2.4.12.k is the following:
>For each of the formulas of predicate logic below, either find a model which
does not satisfy it, or prove it is valid.
This one is difficult:
> (∀x ∃y (P(x) → Q(y))) → (∃y ∀x (P(x) → Q(y)))
Not ... |
I was trying to come up with a system that would evaluate bylaws for an organization as to determine their underlying logic.
I think a first-order predicate system would work for representing the rules, which could be translated from the text via part-of-speech tagging and other NLP techniques.
Is there a syste... |
Methods to evaluate a system of written rules |
|machine-learning|algorithms|pattern-recognition|logic| |
As the title says, has anyone found polynomial algorithm on checking whether two graphs that have a hamiltonian cycle are isomorphic?
|
Has anyone found polynomial algorithm on hamiltonian cycle isomorphism? |
|complexity-theory|time-complexity| |
null |
|complexity-theory|graphs|time-complexity| |
The key issue here is whether switching quantifiers is okay. Turn the top-level implication around and see what happens then.
As for this formula, think about what the left- resp. the right-hand side say.
* Left: "Every $x$ has a $y$ so that... holds."
* Right: "There is a $y$ so that ... holds for all $x$."
... |
As the title says, has anyone found polynomial time algorithm for checking whether two graphs having a hamiltonian cycle are isomorphic?
|
null |
null |
Mergesort with a fair random comparator is not fair. I don't have a proof, but I have VERY strong empirical evidence. (Fair means uniformly distributed.)
module Main where
import Control.Monad
import Data.Map (Map)
import qualified Data.Map as Map
import System.Random (randomIO)
... |
As the title says, has anyone found polynomial time algorithm for checking whether two graphs having a hamiltonian cycle are isomorphic?
Edit: Is this question np-complete?
|
null |
If we have an algorithm that need to run $n=2$ operations and then halt, I think we could say the problem it solves, is tractable, but if $n=10^{120}$ althought It could be theoretically solvable it seems to be intractable, and what about a problem that needs $n=10^{1000}$, or $n=10^{10^{1000}}$ operations, that's seem... |
Which is the minimal number of operations for intractability? |
|complexity-theory| |
null |
Intractability is a graphical metaphor for a notion related to asymptotic complexity.
Let me remind that in abstract terms a computational problem is to find given an input $s$ a solution $r$ to an instance of the problem specified by $s$.
A problem is tractable if for every input $s$ of size $n$ a solution can b... |
Intractability is a graphical metaphor for a notion related to asymptotic complexity.
Let me remind that in abstract terms a computational problem is to find given an input $s$ a solution $r$ to an instance of the problem specified by $s$.
A problem is tractable if for every input $s$ of size $n$ a solution can b... |
As [noted in the comments](http://cs.stackexchange.com/questions/2347/reduction-to-equipartition-problem-from-the-partition-problem#comment6299_2347), the EQUIPARTITION problem is also NP-complete. The basic idea of reducing PARTITION to it is to add elements so that they can be partitioned complementary to the origina... |
Before reading *The Art of Computer Programming (TAOCP)*, I have not considered these questions deeply. I would use pseudo code to describe algorithms, understand them and estimate the running time only about orders of growth. The *TAOCP* thoroughly changes my mind.
*TAOCP* uses English mixed with steps and *goto* t... |
The three cases of the Master Theorem that you refer to here are proved in the *Introduction to Algorithms*.
It is correctly observed that the recurrence in the OP falls between cases 2 and 3. That is $f(n) = n \log n$ grows faster than $n$ but slower than $n^{1+\varepsilon}$ for any $\varepsilon > 0$.
However th... |
If we have an algorithm that need to run $n=2$ operations and then halt, I think we could say the problem it solves, is tractable, but if $n=10^{120}$ althought It could be theoretically solvable it seems to be intractable, and what about a problem that needs $n=10^{1000}$, or $n=10^{10^{1000}}$ operations, that's seem... |
The three cases of the Master Theorem that you refer to are proved in the *Introduction to Algorithms*.
It is correctly observed that the recurrence in question falls between Case 2 and Case 3. That is $f(n) = n \log n$ grows faster than $n$ but slower than $n^{1+\varepsilon}$ for any $\varepsilon > 0$.
However t... |
The three cases of the Master Theorem that you refer to are proved in the *Introduction to Algorithms* by Thomas H. Cormen,Charles E. Leiserson,Ronald L. Rivest and Clifford Stein (2001 Edition).
It is correctly observed that the recurrence in question falls between Case 2 and Case 3. That is $f(n) = n \log n$ grows... |
There are several methods.
- The first one is easy but generates absurdly large regular expressions and is impractical if you do it by hand.
- The second one is usually the one taught in school and is very visual. I believe it is the most used. However, writing the algorithm is not a good idea.
- The last one ... |
There is a huge variety of feasible approaches. Which is best suited depends on
* *what* you are trying to show,
* how much *detail* you want or need.
If the algorithm is a widely known one which you use as a subroutine, you often remain at a higher level. If the algorithm is the main object under investigati... |
The three cases of the Master Theorem that you refer to are proved in the *Introduction to Algorithms* by Thomas H. Cormen,Charles E. Leiserson,Ronald L. Rivest and Clifford Stein (2nd Edition, 2001).
It is correctly observed that the recurrence in question falls between Case 2 and Case 3. That is $f(n) = n \log n$ ... |
Following your idea, you can do this:
* Iterate through the (sorted) list.
* For every item, flip a coin until you get a $0$. The item's level is the number of $1$s you got; create the tower of pointers and link already created towers accordingly.
For every item, the expected level is $\frac{1}{p}$ with $p$ th... |
The three cases of the Master Theorem that you refer to are proved in the *Introduction to Algorithms* by Thomas H. Cormen,Charles E. Leiserson,Ronald L. Rivest and Clifford Stein (2nd Edition, 2001).
It is correctly observed that the recurrence in question falls between Case 2 and Case 3. That is $f(n) = n \log n$ ... |
# Brzozowski algebraic method
This is the same method as the one described in [Raphael's answer][1], but from a point of view of a systematic algorithm, and then, indeed, the algorithm. It turns out to be easy and natural to implement once you know where to begin. Also it may be easier by hand if drawing all the aut... |
given L={a^n b^n c^n}, how can i say directly without looking at production rules that this language is not regular? i can use pumping lemma but some guys are saying just looking at the grammar that this is not regular one. how is it possible? |
How to feel intuitiv that the language is regular |
|formal-languages|regular-languages| |
A graph is 2∀-connected if it remains connected even if any single edge is removed. Let G = (V, E) be a connected undirected graph. Develop an algorithm as fast as possible to check 2∀-connectness of G.
I know the basic idea is to build a DFS searching tree and then check each edge is not on a circle with DFS. Any h... |
Algorithm to check the 2∀-connectness property of a graph |
|algorithms|graphs| |
# Transitive closure method
This method is easy to write in a form of an algorithm, but generates absurdly large regular expressions and is impractical if you do it by hand, mostly because this is too systematic. It is a good and simple solution for an algorithm though.
### The key idea
Let $R^k_{i,j}$ represe... |
Given a language $ L= \{a^n b^n c^n\}$, how can I say directly, without looking at production rules, that this language is not regular?
I could use pumping lemma but some guys are saying just looking at the grammar that this is not regular one. How is it possible? |
How to feel intuitively that a language is regular |
|formal-languages|regular-languages|pumping-lemma|intuition| |
null |
The main property of regular languages is the lack of unbounded memory.<br>If you look at a language and the only algorithm you can think of requires this property, that is, you feel that any algorithm that recognizes it will need to remember an arbitrary large number of things (like $n$ in your example) then that lang... |
A simple algorithm is the following:
Let $G$ be the graph you want to check for 2-connectivity.
> For each edge $xy \in E(G)$, look if there is a path from $x$ to $y$
> in $G-xy$. If for some $xy$, there is not such a path, the graph is
> not 2-edge connected. If there is such a path for each $e$, $G$ is
> 2-e... |
There are several methods. Here I will describe the one usually taught in school which is very visual. I believe it is the most used in practice. However, writing the algorithm is not such a good idea.
<!-- Some notations: $∅$/`∅` for the empty language, $ε$/`ε` for the empty word, $+$/`+` for the union, $AB$/`A.B` ... |
Raphael gave useful pointers but nothing that works before a grammar is reduced to a state-machine. I find doing as much work as possible via parse-tree -> parse-tree transformations lets grammar authors debug familiar structures.
Below I include some OCaml that does the job purely on a parse-tree in case others are ... |
Dijkstra's ["A discipline of Programming"](http://web.cecs.pdx.edu/~cs410aph/Lectures/Smalltalk%20II/Dijkstra%20on%20Hamming's%20Problem.pdf) is all about analyzing and proving algorithms and designing for provability. In the preface to that book, Dijkstra explains how a very simple constructed mini-language that is p... |
null |
In the book <a href="http://www.cs.uu.nl/geobook/">"Computational Geometry: Algorithms and Applications"</a> by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of <b>"illegal edges"</b> - edges that may not appear in a valid Delaunay... |
Brute force Delaunay triangulation algorithm complexity |
|algorithms|time-complexity|computational-geometry| |
In the book <a href="http://www.cs.uu.nl/geobook/">"Computational Geometry: Algorithms and Applications"</a> by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of <b>"illegal edges"</b> - edges that may not appear in a valid Delaunay... |
null |
Let's try to express $(\forall x, \exists y, (P(x) \rightarrow Q(y))) \to (\exists y, \forall x, (P(x) \rightarrow Q(y)))$ in English:
> Premise: suppose that for every $x$, there is a $y$ such that $P(x)$ implies $Q(y)$.
> Conclusion: then there is a $y$ such that for every $x$, $P(x)$ implies $Q(y)$.
Suppose... |
null |
null |
A simple algorithm is the following:
Let $G$ be the graph you want to check for 2-connectivity.
> For each edge $xy \in E(G)$, look if there is a path from $x$ to $y$
> in $G-xy$. If for some $xy$, there is not such a path, the graph is
> not 2-edge connected. If there is such a path for each $e$, $G$ is
> 2-e... |
null |
null |
Historically, the term "strongly typed programming language" came into use in the 70's in reaction to the existing widely used programming languages, most of which had type holes. Some examples:
- In Fortran, there were things called "COMMON" storage areas, which could be shared across modules, but there were no c... |
The main property of regular languages is the lack of unbounded memory. If you look at a language and the only algorithm you can think of requires this property, that is, you feel that any algorithm that recognizes it will need to remember an arbitrary large number of things (like $n$ in your example) then that languag... |
> I could use pumping lemma
Exactly. After you have used the Pumping lemma or any of the [other techniques](http://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular) a couple (of dozens) of times, you will start *seeing* the patterns in languages that prohibit them from being regular. $... |
In the book <a href="http://www.cs.uu.nl/geobook/">"Computational Geometry: Algorithms and Applications"</a> by Mark de Berg et al., there is a very simple brute force algorithm for computing Delaunay triangulations. The algorithm uses the notion of *illegal edges* -- edges that may not appear in a valid Delaunay trian... |
|algorithms|time-complexity|algorithm-analysis|computational-geometry|runtime-analysis| |
A graph is 2∀-connected if it remains connected even if any single edge is removed. Let G = (V, E) be a connected undirected graph. Develop an algorithm as fast as possible to check 2∀-connectness of G.
I know the basic idea is to build a DFS searching tree and then check each edge is not on a circle with DFS. Any h... |
|algorithms|graphs|efficiency| |
A simple algorithm is the following:
Let $G = (V,E)$ be the graph you want to check for 2-connectivity.
> For each edge $e = (x,y) \in E$, look if there is a path from $x$ to $y$
> in $(V, E \setminus \{e\})$. If for some $e$, there is not such a path, the graph is
> not 2-edge connected. If there is such a pat... |
The main property of DFA's/NFA's is the lack of unbounded memory. If you look at a language and the only algorithm (which should later be translated into a Finite Automaton) you can think of requires this property, that is, you feel that any algorithm that recognizes it will need to remember an arbitrary large number o... |
null |
null |
null |
null |
The main property of DFA's/NFA's is the lack of unbounded memory. If you look at a language and the only algorithm (which should later be translated into a Finite Automaton) you can think of requires this property, that is, you feel that any algorithm that recognizes it will need to remember an arbitrary large number o... |
Are there any good Discrete mathematics learning web resources with problem sets?
|
Learning Resources for Discrete Mathematics |
|discrete-mathematics| |
null |
There is a whole course being offered by Udacity<sup>*</sup>, [Logic and Discrete Mathematics](http://www.udacity.com/overview/Course/cs221/CourseRev/1), which has interactive quizzes and homework assignments.
The course description is as follows:
>This course presents key concepts in discrete mathematics, specific... |
Are there any good Discrete mathematics learning web resources with problem sets?
|
|reference-request|education|discrete-mathematics| |
Online Learning Resources for Discrete Mathematics |
null |
|algorithms|complexity-theory|time-complexity|intuition| |
There is a huge variety of feasible approaches. Which is best suited depends on
* *what* you are trying to show,
* how much *detail* you want or need.
If the algorithm is a widely known one which you use as a subroutine, you often remain at a higher level. If the algorithm is the main object under investigati... |
null |
null |
Introduction
---
**Step One**
I wrote a standard backpropegating neural network, and to test it, I decided to have it map XOR.
It is a 2-2-1 network (with tanh activation function)
X1 M1
O1
X2 M2
B1 B2
For testing purposes, I manually set up the top middle neuron (M1)... |
Must Neural Networks always converge? |
|neural-networks| |
null |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.