instruction stringlengths 0 29.8k ⌀ |
|---|
Note that there are more than 2 degrees of supervision. For example, see the pages 24-25 (6-7) in the PhD thesis of [Christian Biemann, Unsupervised and Knowledge-free Natural Language Processing in the Structure Discovery Paradigm, 2007.](http://wortschatz.uni-leipzig.de/~cbiemann/pub/2007/Biemann07diss_Structure-Disc... |
I have trouble understanding how to calculate the depth of a sorting network on $n$ inputs.
For example, in case of selection sort, we have:
$\qquad \displaystyle D(n)=D(n-1)+2\\\qquad D(2)=1$
which leads to
$\qquad \displaystyle D(n)=2n-3=\Theta(n)$
I have confirmed that the depth of selection sort is e... |
null |
The problem, coming from an interview question, is:
> You have a stream of incoming numbers in range 0 to 60000 and you have
> a function which will take a number from that range and return the
> count of occurrence of that number till that moment. Give a suitable
> Data structure/algorithm to implement this syst... |
null |
<b> Edited in response to comments </b>
The time to compute $f(n) = n^{n^2}$ can be decomposed into the time required to compute $f_1(n) = n^2$ and that required to perform $n ^ {f_1(n)}$. I'll assume that multiplying an $m$ bit number by an $n$ bit number takes exactly $log(mn)$ time by the school book method ; addit... |
<b> Edited in response to comments </b>
The time to compute $f(n) = n^{n^2}$ can be decomposed into the time required to compute $f_1(n) = n^2$ and that required to perform $n ^ {f_1(n)}$. I'll assume that multiplying an $m$ bit number by an $n$ bit number takes exactly $mn$ time by the school book method ; additions,... |
<b> Edited in response to comments </b>
The time to compute $f(n) = n^{n^2}$ can be decomposed into the time required to compute $f_1(n) = n^2$ and that required to perform $n ^ {f_1(n)}$. I'll assume that multiplying an $m$ bit number by an $n$ bit number takes exactly $mn$ time by the school book method ; additions,... |
null |
When testing algorithms, a common approach is random testing: generate a significant number of inputs according to some distribution (usually uniform), run the algorithm on them and verify correctness. Modern testing frameworks can generate inputs automatically given the algorithms signature, with some restrictions.
... |
Generating inputs for random-testing graph algorithms? |
|algorithms|graphs|randomness|software-testing| |
I believe the methods are quite different in general, and depend highly on the property you wish the graphs to obtain. Here's one desired property and a method to generate random graphs possessing it.
In graphs with *small world topology*, nodes are highly clustered yet the path length between them is small. A topol... |
null |
I believe the methods are quite different in general, and depend highly on the property you wish the graphs to obtain. Here's one desired property and a method to generate random graphs possessing it.
In graphs with *small world topology*, nodes are highly clustered yet the path length between them is small. A topol... |
I believe the methods are quite different in general, and depend highly on the property you wish the graphs to obtain. Here's one desired property and a method to generate random graphs possessing it.
In graphs with *small world topology*, nodes are highly clustered yet the path length between them is small. A topol... |
Is there a relatively simple way of telling if two pieces of text are semantically similar?
Some assumptions that are valid:
- It is all english
- I have a list of all the *important* nouns
Are there any strategies that I should pursue? Looking for something that is relatively computationally cheap, though ... |
Semantic similarity in text |
|algorithms|natural-language-processing| |
null |
null |
I asked myself, if the MaxSAT problem is NP hard ?
[Wiki - MaxSAT][1] :
> The MAX-SAT problem is NP-hard, since its solution easily leads to the solution of the boolean satisfiability problem, which is NP-complete
I see, that given a SAT problem can be reduced to a MaxSAT Problem: Just solve the MaxSAT problem f... |
Is MaxSAT NP hard? |
|complexity-theory|reductions| |
null |
Yesterday i asked myself a question, but i cant figure out an algoritme the solve it.
I want to make a sequence of numbers, where i pick the numbers
a_{0}, a_{1},..,a_{n} The lengte of the sequence is n.
Now i want the product of every combination of 2 numbers with no repetition in the row modulo the lengte of... |
Finding a sequence of numbers where every product of two mod lengte is unique |
|algorithms|number-theory| |
Yesterday I asked myself a question, but I can't figure out an algorithm to solve it.
I want to make a sequence of numbers, where I pick the numbers
$a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n$.
Now I want the product of every combination of 2 numbers with no repetition in the sequence modulo the l... |
Finding a sequence of numbers where every product of two mod length is unique |
Yesterday I asked myself a question, but I can't figure out an algorithm to solve it.
I want to make a sequence of numbers, where I pick the numbers
$a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n+1$.
Now I want the product of 2 numbers in the sequence modulo the number of elements in the sequence $n+1... |
Knapsack can be [solved by dynamic programming](https://en.wikipedia.org/wiki/Knapsack_problem#Dynamic_Programming_Algorithm) in *[pseudo-polynomial](https://en.wikipedia.org/wiki/Pseudo-polynomial_time)* time $O(nW)$ with $n$ the number of objects and $W$ the size of the knapsack. So, as long as your container is smal... |
|algorithms|natural-language-processing|ontologies| |
The decision problem related to MAX-SAT is, given a formula $\phi$ and a number $k$, decide whether there is an assignment satisfying at least $k$ of the clauses. This is clearly NP-hard since it can be used to solve SAT, and on the other hand, also in NP, since it is easy to verify the properties of a good assignment.... |
Here's a simple technique.
Train an LDA using something like [MALLET](http://mallet.cs.umass.edu) over your collection of texts. For each pair of documents you want to compare, obtain the topic distributions and compute the [Hellinger distance](http://en.wikipedia.org/wiki/Hellinger_distance) between them.
Things... |
I need an example to how calculate the Penetrance & Branching Factor in State-space Heuristic Search. the formula of Penetrance & Branching as the following: -
Penetrance (P) = L / T,
Where L: is the length of the path
T: is the number of nodes expanded.
Branching Factor
B/(B-1) * (B^L – 1) = T
|
Example using Penetrance & Branching Factor in State-space Heuristic Search |
|artificial-intelligence|search-algorithms| |
While I am learning a lot from others here at the Computer Science site, I must admit that I don't get as much out of some questions and answers since I typically don't understand the theorems to the level necessary. I am currently reading [How To Prove It - A Structured Approach][1] which is starting to make the theor... |
Period in postulate; what does it mean? |
|theorems-general|theorems-syntax| |
After an $\exists$ the period can be read as "such that".
For example,
$\exists x\in \mathbb{N}. x>4$ can be read as "there exists a natural $x$ such that $x$ is greater than 4."
After a $\forall$ it can be read as "it is the case that". For example,
$\forall x\in\mathbf{N}. x + 1> x$ can be read as "for all na... |
Consider a path graph, that is, a cycle graph with one edge removed. There are exactly two vertices with degree 1, one of them is your start node $s \in V$ and the other one is the goal $g \in V$. Start a search, say BFS or DFS, from $s$ and stop when you have reached $g$. Each vertex you visit is said to be expanded. ... |
Consider a path graph, that is, a cycle graph with one edge removed. There are exactly two vertices with degree 1, one of them is your start node $s \in V$ and the other one is the goal $g \in V$.
![Path graph][1]
Start the search (say, BFS, DFS or perhaps a heuristic search if you want) from $s$ and stop when y... |
In studying logic to understand verifying programs I have found that there are books on logic targeted at Computer Science e.g.
- [Logic in Computer Science: Modelling and Reasoning about Systems ][1]
- [Mathematical Logic for Computer Science ][2]
- [Computability and Logic ][3]
- [Handbook of Practical Logi... |
Looking for books on understanding theorems targeted at Computer Science |
|reference-request|theorems-general|theorems-syntax| |
While I am learning a lot from others here at the Computer Science site, I must admit that I don't get as much out of some questions and answers since I typically don't understand the theorems to the level necessary. I am currently reading [How To Prove It - A Structured Approach][1] which is starting to make the theor... |
Yesterday I asked myself a question, but I can't figure out an algorithm to solve it.
I want to make a sequence of numbers, where I pick the numbers
$a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n+1$.
Now I want the product of 2 numbers in the sequence modulo the number of elements in the sequence $n+1... |
Finding a sequence of numbers where every product of two mod k is unique |
Looking for books on creating and understanding theorems targeted at Computer Science |
Algorithm Design, by John Kleinberg and Eva Tardos looks like it may be what you want. Here's the description on Amazon:
`Algorithm Design introduces algorithms by looking at the real-world problems that motivate them. The book teaches students a range of design and analysis techniques for problems that arise in com... |
I need an example for how to calculate penetrance and branching factor in state-space heuristic search. The definitions are as following:
$\qquad \displaystyle \operatorname{Penetrance}(P) = \frac{L}{T}$
and
$\qquad \displaystyle \operatorname{BranchingFactor}(P) = \frac{B}{(B-1)} \cdot (B^L – 1) = T$
wher... |
|terminology| |
What do you expect from such a book? The comment by JeffE is a good one: sensible textbooks do this. Sorry for this is not a book recommendation, but merely a different way of thinking. Coming up with just the right properties, invariants and theorems is hard. It requires time, insight and experience. Not *everything* ... |
|reference-request|terminology|proof-techniques| |
Algorithm Design, by John Kleinberg and Eva Tardos looks like it may be what you want. Here's the description on Amazon:
> Algorithm Design introduces algorithms by looking at the real-world problems that motivate them. The book teaches students a range of design and analysis techniques for problems that arise in co... |
Consider the following search tree. Your heuristic search algorithm starts the search at the root node. Unexpanded nodes are marked gray.
![Search tree][1]
For some reason, the heuristic is being guided towards the left-most subtree, when in fact the goal node is in the right-most subtree, marked with green.
!... |
Is the [MAX-SAT problem](http://en.wikipedia.org/wiki/Maximum_satisfiability_problem) NP-hard? From the Wikipedia page:
> The MAX-SAT problem is NP-hard, since its solution easily leads to the solution of the boolean satisfiability problem, which is NP-complete
I see that a given SAT problem can be reduced to a M... |
Is MAX-SAT NP-hard? |
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.
The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing
$\begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) + n \\ &\leq cn +n \\ &=O(n) \quad \quad \quad \Leftarrow wrong!! \end{alig... |
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$ |
|algorithms|recurrence-relation| |
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.
The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing
$\begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) + n \\ &\leq cn +n \\ &=O(n) \quad \quad \quad \Leftarrow wrong!! \end{alig... |
null |
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.
The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing
$\qquad \begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) + n \\ &\leq cn +n \\ &=O(n) \quad \quad \quad \longleftarrow \tex... |
|asymptotics|recurrence-relation| |
Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$.
The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing
$\qquad \begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) + n \\ &\leq cn +n \\ &=O(n) \quad \quad \quad \longleftarrow \tex... |
The authors give the answer:
> The error is that we have not proved the *exact form* of the inductive hypothesis, that is, that $T(n) \leq cn$.
Granted, that is hard to understand if you are not used to do inductions (right), because they do not do the induction explicitly/rigorously. In short: you need to have *... |
|proof-techniques|asymptotics|recurrence-relation|landau-notation|induction| |
The [3SUM][1] problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$.
It is conjectured that there is not better solution than $\mathcal{O}(n^2)$. Or to put it differently: $\mathcal{O}(n \log(n) + n^2)$.
So I was wondering if this would apply to the generalised problem:... |
Generalised 3SUM (k-SUM) problem? |
|complexity-theory|combinatorics|complexity-classes| |
[Algorithm Design, by John Kleinberg and Eva Tardos][1] looks like it may be what you want. Here's the description on Amazon:
> Algorithm Design introduces algorithms by looking at the real-world problems that motivate them. The book teaches students a range of design and analysis techniques for problems that arise ... |
null |
Here are a few simple observations.
For $k=1$, you can do it in $\Theta(n)$ time by scanning the array for a zero. For $k=2$, you can do it without hashing in $\Theta(n \log n)$ time. Sort the array and then scan it. For each element $i$ do a binary search for $-i$. This results in total complexity of $\Theta(n \lo... |
Here are a few simple observations.
For $k=1$, you can do it in $\Theta(n)$ time by scanning the array for a zero. For $k=2$, you can do it without hashing in $\Theta(n \log n)$ time. Sort the array and then scan it. For each element $i$ do a binary search for $-i$. This results in total complexity of $\Theta(n \lo... |
null |
**Random graphs with small world topology**
In graphs with *small world topology*, nodes are highly clustered yet the path length between them is small. A topology like this can make search problems very difficult, since local decisions quickly propagate globally. In other words, shortcuts can mislead heuristics. Fu... |
Does any one know how to implement the simulation relation on two LTSs?
I know how to do it for branching bi-simulation. The signature refinement theorem is used for that purpose which has the time complexity of O(n^3) on cyclic LTSs. Is the signature refinement technique useful for simulation also?
Is there any... |
How to implement simulation on two LTSs? |
|programming-languages|semantics|formal-methods|process-algebras| |
$d$-SUM requires time $n^{\Omega(d)}$ unless k-SAT can be solved in $2^{o(n)}$ time for any constant k. This was shown in a [paper][1] by Mihai Patrascu and Ryan Williams(1).
In other words, assuming the [exponential time hypothesis][2], your algorithm is optimal up to a constant factor in the exponent (a polynomia... |
I personally didn't understand how to construct theorems and proofs at all until I took a proof-based calculus course my first year of college. I don't think much of it applies directly to computer science but the method of thinking has helped me along greatly.
You may have more success looking at math books rather... |
Here's a simple technique.
Train an LDA using something like [MALLET](http://mallet.cs.umass.edu) over your collection of texts. For each pair of documents you want to compare, obtain the topic distributions and compute the [Hellinger distance](http://en.wikipedia.org/wiki/Hellinger_distance) between them.
Things... |
null |
The authors give the answer:
> The error is that we have not proved the *exact form* of the inductive hypothesis, that is, that $T(n) \leq cn$.
Granted, that is hard to understand if you are not used to do inductions (right), because they do not do the induction explicitly/rigorously. In short: you need to have *... |
null |
The [3SUM][1] problem tries to identify 3 integers $a,b,c$ from a set $S$ of size $n$ such that $a + b + c = 0$.
It is conjectured that there is not better solution than quadratic, i.e. $\mathcal{o}(n^2)$. Or to put it differently: $\mathcal{o}(n \log(n) + n^2)$.
So I was wondering if this would apply to the gene... |
Does any one know how to implement the simulation relation on two LTSs?
I know how to do it for branching bi-simulation. The signature refinement theorem is used for that purpose which has the time complexity of $O(n^3)$ on cyclic LTSs. Is the signature refinement technique useful for simulation also?
Is there a... |
In most introductory algorithm classes, notations like $O$ (Big O) and $\Theta$ are introduced, and a student would typically learn to use one of these to find the time complexity.
However, there are other notations, such as $o$, $\Omega$ and $\omega$. Are there any specific scenarios where one notation would be pre... |
How does one know which notation of time complexity analysis to use? |
You've stumbled on the fact that inference of static invariants for higher-order languages is quite difficult in practice, in addition to being undecidable in theory. I'm not sure what the definitive answer to your question is, but note several things:
* Polymorphism and refinement types behave poorly together, as y... |
Yesterday I asked myself a question, but I can't figure out an algorithm to solve it.
I want to make a sequence of numbers, where I pick the numbers
$a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n+1$.
Now I want the product of any pair of 2 numbers in the sequence modulo k is guaranteed to be unique an... |
I want to make a sequence of numbers, where I pick the numbers $a_{0}, a_{1},..,a_{n}$. The length of the sequence is $n+1$.
Now I want the product of any pair of 2 numbers in the sequence modulo k to be guaranteed to be unique and $k$ has to be as small as it can be in such a way that the resulting set has to be $r... |
I'm trying to prove that $L_1=\{\langle M\rangle$| $M$ is a Turing machine and in running on $\epsilon$, M visits $q_0$ at list twice} $\notin R$.
I'm not sure whether to reduce the $Halt$ problem to it or not. I tried to construct new $M'$ which for $<M>,w$ $M'$ visits $q_o$ twice iff $M$ halts on $w$. This is spe... |
Showing $L_1=\{\langle M\rangle$| $M$ is a Turing machine and in running on $\epsilon$, M visits $q_0$ at list twice} $\notin R$ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.