instruction stringlengths 0 29.8k ⌀ |
|---|
Do you know the [urn problem](https://en.wikipedia.org/wiki/Urn_problem)? You usually consider two kinds of marbles (i.e. $n=2$), which gives rise to the [binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) $\binom{N}{k}$ as the number of sequences of length $N$ with $k$ marbles of one kind (and $... |
> **Possible Duplicate:**
> [Restricted version of vertex cover](http://cs.stackexchange.com/questions/2302/restricted-version-of-vertex-cover)
<!-- End of automatically inserted text -->
Suppose we have a $(A,B,E)$ bipartite graph and a positive integer k. Suppose that k is smaller than $|A|$ and we want to find... |
{"OriginalQuestionIds":[2302],"Voters":[{"Id":98,"DisplayName":"Raphael"}]} |
|terminology|type-theory| |
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... |
|logic|terminology|type-theory| |
null |
How can i prove that the cover time for a directed graph G can be exponential in the size of G.
Thanks! |
Prove: cover time for directed graph is exponential |
|graphs| |
>For a given planar graph $G(V,E)$ embedded in the plane, defined by list of sergments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for the planar subdivision, describe an algorithm, prove it's correctness and sho... |
Constructing of Double Connected Edge List (DCEL) |
|algorithms|computational-geometry| |
You can actually decide if a language is regular using fairly straightforward calculations, rather than doing a full proof. You simply need to apply one very powerful criterion: A language is regular if and only if it has finitely many quotients.
Intuitively, a quotient is what you need to complete a word after havi... |
|algorithms|computational-geometry| |
>For a given planar graph $G(V,E)$ embedded in the plane, defined by list of segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for the planar subdivision, describe an algorithm, prove it's correctness and show... |
|algorithms|data-structures|computational-geometry|lists| |
Finally I found my answer in [this video about reduction](http://www.youtube.com/watch?v=TK8KHnUoelg) which gives a clear explanation for my struggle.
[This video](http://www.youtube.com/watch?v=i6Qry474nJs&feature=relmfu) and [this](http://www.youtube.com/watch?v=A72Tc_XI2_8&feature=relmfu) are about the regular e... |
>For a given planar graph $G(V,E)$ embedded in the plane, defined by list of segments $E= \left \{ e_1,...,e_m \right \} $, each segment $e_i$ is represented by its endpoints $\left \{ L_i,R_i \right \}$. Construct a DCEL data structure for the planar subdivision, describe an algorithm, prove it's correctness and show... |
null |
I have been investigating parallel algorithms to compute certain two-dimensional dynamic programming recursions (on natural parameters); see also [here](http://cs.stackexchange.com/questions/196/a-case-distinction-on-dynamic-programming-example-needed). Under certain assumptions, cases one and two can actually be compu... |
Beating fair colorings with few edges |
|graphs|colorings| |
>Given a set $S$ of points $p_1,..,p_2$ give the most efficient algorithm for determining if any 3 points of the set are collinear.
The problem is I started with general definition but I cannot continue to actually solving the problem.
What can we say about collinear points in general, 3 points $a,b,c$ are collin... |
If any 3 points are collinear |
|algorithms|computational-geometry| |
You do it in two steps:
1. First you think of a graph which you can expect to be difficult.
2. Then you prove your suspicion.
Let's start with the first step - do you have any graph in mind? |
The idea in problems like this is to create an ordered structure from one of the sets that allows efficient queries of Nearest Neighbor. The classic paper that presented an O(log n) query structure for arbitrary dimension was:
[Shamos and Hoey on Voronoi solutions][1]
A number of other space partitions based on ... |
The idea in problems like this is to create an ordered structure from one of the sets that allows efficient queries of Nearest Neighbor. The classic paper that presented an O(log n) query structure for arbitrary dimension was:
[Shamos and Hoey on Voronoi solutions][1]
A number of other space partitions based on ... |
One simple way is to fix a point $x$, compute the slope of the line $xy$ and store it in a hash table for every other point $y$. If there is a collision, then we have collinear points involving $x$. This takes $O(n)$ (if we assume hash table operations take $O(1)$). We then do this for every point $x$ in time $O(n^2)$ ... |
One simple way is to fix a point $x$, compute the slope of the line $xy$ and store it in a hash table for every other point $y$. If there is a collision, then we have collinear points involving $x$. This takes $O(n)$ (if we assume hash table operations take $O(1)$). We then do this for every point $x$ in time $O(n^2)$.... |
You can adapt the "closest pair" [linesweep algorithm][1] which is $O(n \log n)$.
The only change you will have to do is to ignore pairs that belong to the same set.
**Edit:** This is actually not simple (or even possible) as I described. See comments for discussion.
[1]: http://community.topcoder.com/tc?... |
One simple way is to fix a point $x$, compute the slope of the line $xy$ and store it in a hash table for every other point $y$. If there is a collision, then we have collinear points involving $x$. This takes $O(n)$ (if we assume hash table operations take $O(1)$). We then do this for every point $x$ in time $O(n^2)$.... |
null |
Apologies for another Markov Chain question but this one is best given its own question to avoid confusion. I am using a Markov Chain to get the 10 best search results from the union of 3 different search engines. The top 10 results are taken from each engine to form a set of 30 results.
The chain starts at State x,... |
Improve Markov Chain results |
|algorithms|machine-learning|markov-chains| |
I have been investigating parallel algorithms to compute certain two-dimensional dynamic programming recursions (on natural parameters); see also [here](http://cs.stackexchange.com/questions/196/a-case-distinction-on-dynamic-programming-example-needed). Under certain assumptions, cases one and two can actually be compu... |
> A reduction is a transformation from an unknown but easier problem to a harder problem but already known. If the harder problem is solvable, so is the easier one. Otherwise, it's not.
Your characterisation of reduction is a bit misleading. You don't start with an "easy" problem and reduce it to a "harder" problem ... |
Let $\mathcal{S}$ be the state space of your Markov chain, and assume that we start at some state $i \in \mathcal{S}$. Let $\mathcal{Y}_i$ be the set of states (pages) that are ranked lower than $i$ by two of the three engines. According to your description, the probability of transition to state $j$ can be defined as ... |
Let $\mathcal{S}$ be the state space of your Markov chain, and assume that we start at some state $i \in \mathcal{S}$. Let $\mathcal{Y}_i$ be the set of states (pages) that are ranked lower than $i$ by two of the three engines. According to your description, the probability of transition to state $j$ can be defined as ... |
null |
The idea in problems like this is to create an ordered structure from one of the sets that allows efficient queries of Nearest Neighbor. The classic paper that presented an O(log n) query structure for arbitrary dimension was:
[Shamos and Hoey on Voronoi solutions][1]
A number of other space partitions based on ... |
null |
I've been given the following problem :
Given a data structure `M` that is based on comparisons and supports the following methods on a group
of numbers `S` :
* Insert(x) - add `x` to `S`
* Extract_min() - remove the minimal element is `S` and return it
We can implement with a heap the above methods in `... |
Prove that exists a data structure that supports Extract_min() and Insert(x) in Ω(log(n))? |
|algorithms|binary-trees|search-trees| |
I've been given the following problem :
Given a data structure $M$ that is based on comparisons and supports the following methods on a group
of numbers $S$ :
* Insert(x) - add $x$ to $S$
* Extract_min() - remove the minimal element is $S$ and return it
We can implement with a heap the above methods in $... |
Prove that exists a data structure that supports Extract_min() and Insert(x) in $\Omega(\log n)$? |
null |
I've been given the following problem :
Given a data structure $M$ that is based on comparisons and supports the following methods on a group
of numbers $S$ :
* Insert(x) - add $x$ to $S$
* Extract_min() - remove the minimal element in $S$ and return it
We can implement with a heap the above methods in $... |
Prove that for a general data structure - operations Extract_min() and Insert(x) cost $\Omega(\log n)$? |
I don't think your proof is valid, because it only considers trees, and a certain type of trees at that. If there were an algorithm with a lower lower bound for what you describe, we'd have a sorting algorithm faster than `Omega(n log n)` no matter which of the two operations is `log n`. So the problem reduces to provi... |
There's a reason it's called a Turing Machine, and it's because it was invented by Alan Turing. He did a 1936 paper on it, establishing these concepts. If you want to know more about Turing Machines, check the paper. It was seriously doubted, before he designed and built one that cracked the Enigma, that this concept c... |
I am using a digital computer to write this message. Such a machine has a property which, if you think about it, is actually quite remarkable: It is _one machine_ which, if programmed appropriately, can perform _any possible computation_.
Of course, calculating machines of one kind or another go back to antiquity. P... |
Why is Turing completeness right? |
|untagged| |
I don't think your proof is valid, because it only considers trees, and a certain type of trees at that. But, if there were an algorithm with a lower bound for what you described, we'd have a sorting algorithm faster than $\Omega(n \log n)$ no matter which of the two operations is $\log n$. So the problem reduces to pr... |
null |
I don't think your proof is valid, because it only considers trees, and a certain type of trees at that. If there were an algorithm with a smaller lower bound for what you describe, we'd have a sorting algorithm faster than $\Omega(n \log n)$ no matter which of the two operations is $\log n$. So the problem reduces to ... |
[{"Id":98,"DisplayName":"Raphael"}] |
[{"Id":98,"DisplayName":"Raphael"}] |
Do you know the [urn problem](https://en.wikipedia.org/wiki/Urn_problem)? You usually consider two kinds of marbles (i.e. $n=2$), which gives rise to the [binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) $\binom{N}{k}$ as the number of sequences of length $N$ with $k$ marbles of one kind (and $... |
|computability|turing-machines|history| |
Here is a well-known problem.
Given an array $A[1\dots n]$ of positive integers, output the smallest number not in the array.
The problem can be solved in $O(n)$ space and time: read the array, keep track in $O(n)$ space whether $1,2,\dots,n+1$ occured, scan for smallest element.
I noticed you can trade space ... |
Time-space tradeoff for missing element problem |
|complexity-theory| |
null |
I've been given the following problem :
Given a data structure $M$ that is based on comparisons and supports the following methods on a group
of numbers $S$ :
* Insert(x) - add $x$ to $S$
* Extract_min() - remove the minimal element in $S$ and return it
We can implement with a heap the above methods in $... |
A concrete example about string w and string x used in the proof of Rice's Theorem |
null |
I've been given the following problem:
Given a data structure $M$ that is based on comparisons and supports the following methods on a group of numbers $S$:
* $\text{Insert}(x)$ – add $x$ to $S$
* $\text{Extract_min}()$ – remove the minimal element in $S$ and return it
We can implement with a heap the above ... |
null |
Mankind formalized computation and developed two system for it in 1936 with the seminal papers of [Alonzo Church](http://en.wikipedia.org/wiki/Alonzo_Church) on [$\lambda$-calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and [Alan Turing](http://en.wikipedia.org/wiki/Alan_Turing) (who today, June 23rd 2012, woul... |
null |
There's an algorithm named after Manacher's algorithm, which is really fast, a linear time algorithm.
See [Wikipedia's reference](http://en.wikipedia.org/wiki/Longest_palindromic_substring#CITEREFManacher1975)
------
Postscript: If you're really familiar with [Z Algorithm](http://codeforces.com/blog/entry/3107... |
I'm probably missing something, because it seems rather trivial to me: Try to pair each character with an equal character. Then put the first character of each pair on the left side, the other character on the right side, and if there are any characters remaining (ie, characters not paired with another one), then pick ... |
Hiho,
I have got some hard algorithm problem to solve for my China university.
First of all we must read a number given by user - size of our word.
Then we need to find the max palindrome created by character in this world.
For example for size = 7 and word = "abcababac" the answer is 7 ("abababa").
Tha... |
The fastest algorithm for finding the longest palindrome *subsequence* |
|homework|algorithms| |
First of all we must read a word, and a desired size.
Then we need to find the longest palindrome created by characters in this word used in order.
For example for size = 7 and word = "abcababac" the answer is 7 ("abababa").
Postscript: the size of the word is smaller than 3000. |
Fastest algorithm for finding the longest palindrome subsequence |
|algorithms|strings| |
null |
Do you know the [urn problem](https://en.wikipedia.org/wiki/Urn_problem)? You usually consider two kinds of marbles (i.e. $n=2$), which gives rise to the [binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient) $\binom{N}{k}$ as the number of sequences of length $N$ with $k$ marbles of one kind (and $... |
null |
Recently I sort of stumbled on a problem of finding an efficient topology given a weighted directed graph. Consider, the following scenario;
1) Node 1 is connected to 2,3,4 at 50 Mbps. Node 1 has 100 Mbps network card.
2) Node 3 is connected to 5 at 50 Mbps. Node 3 has 100 Mbps card.
3) Node 4 is connected to ... |
Efficient bandwidth algorithm |
|algorithms|graphs| |
Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x|a\leq x, x\leq b\}$.
What is a fast algorithm to find $\{[a_i..b_i]\}$ such that
$\{ k\oplus x| x\in [a..b]\} = \bigcup_{i=1}^n [a_i..b_i]$? |
What is the bitwise xor of an interval? |
|algorithms| |
Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x\mid a\leq x, x\leq b\}$.
What is a fast algorithm to find
$\{ k\oplus x\mid x\in [a..b]\}$? |
Let $\oplus$ be bitwise xor. Let $k,a,b$ be non-negative integers. $[a..b]=\{x\mid a\leq x, x\leq b\}$, it is called a integer interval.
What is a fast algorithm to find
$\{ k\oplus x\mid x\in [a..b]\}$ as a union of set of integer intervals.
One can prove that $[a+k..b-k]\subseteq \{ k\oplus x\mid x\in [a..b]\... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.