instruction
stringlengths
0
29.8k
⌀
What is the TAK function for?
|algorithms|recursion|
I was able to track the first occurences of interval graphs down to **G. Hajos, Über eine Art von Graphen, Int. Math. Nachr. 11 (1957) Problem 65** However, I couldn't access the paper. So I would be happy if somebody could check the above citation.
|graphs|reference-request|history|
In Java, there is no 'static type of an object' - there is the type of the object, and there is the type of the reference. All Java methods are 'virtual' (to use C++ terminology), i.e. they are resolved based on the object's type. And btw. '@Override' has no effect whatsoever on the compiled code - it is just a saf...
(Not a comp.scientist, but have the basic research. Please excuse me if I've overlooked anything obvious.) In my variant of the problem I have a set A of agents and a set (of possibly different cardinality) T of tasks. Each agent needs to be assigned exactly n or n+1 tasks, and each task needs to be assigned to exac...
A variant of the assignment problem (?)
|optimization|linear-programming|
If edge weights are integers in $\{0,1,\ldots,K\}$, you can implement Dijkstra's to run in $O(K|V|+|E|)$ time, following @rrenaud's suggestion. Here is a more explicit explanation. At any time, the (finite) keys in the priority queue are in some range $\{D,D+1,\ldots,D+K\}$, where $D$ is the value of the last key re...
If edge weights are integers in $\{0,1,\ldots,K\}$, you can implement Dijkstra's to run in $O(K|V|+|E|)$ time, following @rrenaud's suggestion. Here is a more explicit explanation. At any time, the (finite) keys in the priority queue are in some range $\{D,D+1,\ldots,D+K\}$, where $D$ is the value of the last key re...
I have a bunch of databases, each having different access patterns, such that each puts a different amount of load on its database cluster. I would like to distribute them around my set of database clusters such that the workload for the clusters is evenly distributed. I looked at the [_k_-partition problem](http:/...
How to distribute items of varying sizes into bins of varying sizes, such that percent utilization across all bins is minimized?
|partitions|
null
(Not a comp.scientist, but have the basic research. Please excuse me if I've overlooked anything obvious.) In my variant of the problem I have a set $A$ of agents and a set (of possibly different cardinality) $T$ of tasks. Each agent needs to be assigned exactly $n$ or $n+1$ tasks, and each task needs to be assigned...
I was able to track the first occurences of interval graphs down to **G. Hajos, [Über eine Art von Graphen](http://www.oemg.ac.at/IMN/imn047-48-teil2.pdf), Int. Math. Nachr. 11 (1957) page 65** This reference refers to a book of (talk) abstracts. In the abstract of Hajos interval graphs are defined, without actu...
While you might use it to evaluate the performance of programming languages when it comes to recursion: http://en.wikipedia.org/wiki/Tak_%28function%29 you will need it to solve ballot problems: http://mathworld.wolfram.com/BallotProblem.html or just to generate Takeuchi Numbers: 0, 1, 4, 14, 53, 223, 1034,...
I'm currently studying for an algorithms midterm in about 2 days and am reading from the beginning of the course, and stumbled upon this when I actually looked at the examples. The question equation: $f(n) = 6n^3 + n^2\log n$ The exact line written for the answer is: $f(n) \leq 6n^3 + n^2 \centerdot n \text{, for...
Why is this $f(n) \leq 6n^3 + n^2 \log n \in O(n^3)$ for all $n \geq 1$?
|algorithms|asymptotics|
The problem that $LL$ variants have with left recursion is inherent to the way $LL$ works: it is a top-down type parser, which means it replaces nonterminals by their productions. An $LL$-style parser works as follows. It traverses the input from left to right in one go. If we are at some point in the input, then we...
null
So I've been working on an algorithm. The task I'm trying to accomplish is: consider a 2D plane there are targets that are randomly distributed between a y upper bound and lower bound. This set is T. T1 is marked with coordinates(X,Y). there is a set S of sensors that are guaranteed to cover every target. Each targ...
Recursive Relation Help for dinamic programming 2d Plane algorithm
|algorithms|dynamic-programming|
First of all, it is not a "question equation" but the **definition** of $f$. The task at hand is to show that $f(n) \in O(n^3)$. By the definition of $O(n^3)$ this means that we need to find $n_0$ and $C$ such that $f(n) \leq C n^3$ for all $n \geq n_0$. There may be many $n_0$ and $C$ that work, we just need to fin...
So I've been working on an algorithm. The task I'm trying to accomplish is: consider a 2D plane there are targets that are randomly distributed between a y upper bound and lower bound. This set is T. T1 is marked with coordinates(X,Y). there is a set S of sensors that are guaranteed to cover every target. each sensor...
> **Possible Duplicate:** > [A variant of the Assignment Problem](http://cs.stackexchange.com/questions/6186/a-variant-of-the-assignment-problem) <!-- End of automatically inserted text --> (Not a comp.scientist, but have the basic research. Please excuse me if I've overlooked anything obvious.) In my variant ...
{"OriginalQuestionIds":[6186],"Voters":[{"Id":19,"DisplayName":"Nicholas Mancuso"},{"Id":39,"DisplayName":"Gilles"}]}
I assume here that $K$ is an integer and the edge weights are integral. Otherwise it doesn't really buy you anything, you can always rescale weights so that the min edge has cost $1$ and the max has cost $K$, so the problem is identical to the standard shortest path problem. Algorithm/proof sketch: Implement the pr...
null
If we let the physical memory size remain constant, - What effect does the size of the page have on the number of frames? - What effect does the number of frames have on the number of page faults? Also, please provide reference strings as an example.
How does increasing the page size affect the number of page faults?
null
|operating-systems|memory-management|virtual-memory|paging|
null
So I've been working on an algorithm. The task I'm trying to accomplish is: consider a 2D plane there are targets that are randomly distributed between a y upper bound and lower bound. This set is T. T1 is marked with coordinates(X,Y). there is a set S of sensors that are guaranteed to cover every target. each sensor h...
Recursive Relation Help for dynamic programming 2d Plane algorithm
null
Why not bin and chain? The idea is to store positive integers representable by $n = k+m$ bits in an array $A$ of $2^k$ entries representing ranges of values: entry $A[y]$, $y \ge 0$, represents the range $[2^m y, 2^m(y+1)-1]$. For any $1 \le x \lt 2^n$ we may write $x = 2^m y + z$ where $y$ has $k$ bits and $z$ has...
First of all, it is not a "question equation" but the **definition** of $f$. The task at hand is to show that $f(n) \in O(n^3)$. By the definition of $O(n^3)$ this means that we need to find $n_0$ and $C$ such that $f(n) \leq C n^3$ for all $n \geq n_0$. There may be many $n_0$ and $C$ that work, we just need to fin...
null
Since the number of frames is equal to the size of the memory divided by the page size, increasing the page size will proportionately decrease the number of frames. Having fewer frames will tend to increase the number of page faults because of the lower freedom in replacement choice. Imagine a system with four fram...
Consider a 2D plane. There are targets that are randomly distributed between a $y$ upper bound and lower bound. This set is $T$. $T_1$ is marked with coordinates $(X,Y)$. There is a set $S$ of sensors that are guaranteed to cover every target. Each sensor has a radius $1$ and an $(X,Y)$ coordinate. Each target has a co...
Recursive relation help for dynamic programming 2D plane algorithm
Assume that we are given a real life graph, DBLP network in my case, where degree distribution of nodes follows a power law (many nodes have 1, 2 neighbors, and only a few nodes have hundreds of neighbors). A random walk ends when it returns to the initial node or when the walk takes 3 steps. If we start random wal...
How many random walks to start from each node?
I'm looking for an efficient algorithm to find the longest repeated pattern in a string. For example, consider the following string of numbers: `5431428571428571428571428571427623874534`. As you can see, `142857142857` is the longest pattern which is repeated for a couple of times (at least twice) in this st...
Find the longest repeated pattern in a string
Could anyone please explain Cantor's diagonalization principle in simple terms?
Cantor's diagonal method in simple terms?
Given a set $A=\{a_{1},a_{2},a_{3},\ldots,a_{n}\}$, then construct a set $P=\{p_{1}, p_{2}, p_{3}, \ldots , p_{n}\}$ such that 1. $|p_{i}|=a_{i}$, and 2. $\sum_{i = 1,}^{n}p_{i} = 0$. This problem is NP-complete, which I want to prove. How do I do it? I am thinking of a reduction from the subset sum p...
Showing a partition-like problem is NP-complete
Given a [binary expresion tree](http://en.wikipedia.org/wiki/Binary_expression_tree), with addition and multiplication operations, how can we optimize it's evaluation? Can we learn from [matrix chain multiplication](http://en.wikipedia.org/wiki/Matrix_chain_multiplication)? A [generalization](http://en.wikipedia.o...
Consider a straight highway in the plane which can be modelled by a horizontal strip in the plane. A finite set T of targets are located on the highway, and a finite set S of wireless sensors are located outside of the highway. A sensor s can monitor a target t if and only if the Euclidean distance between s and t is a...
[Thue](http://catseye.tc/projects/thue/) language is based on string rewriting and it's just 179 lines of c code. [Pure](https://code.google.com/p/pure-lang/) is an LGPL'd functional language based on term rewriting. Not an example, but course: www.cs.vu.nl/~tcs/trs with really complete slides on the theory of te...
[Thue](http://catseye.tc/projects/thue/) language is based on string rewriting and it's just 179 lines of c code. [Pure](https://code.google.com/p/pure-lang/) is an LGPL'd functional language based on term rewriting. Not an example, but course: [Term Rewriting Systems](http://www.cs.vu.nl/~tcs/trs) with really co...
null
[Thue](http://catseye.tc/projects/thue/) language is based on string rewriting and it's just 179 lines of c code. [Pure](https://code.google.com/p/pure-lang/) is an LGPL'd functional language based on term rewriting. Not an example, but a [course](http://www.cs.vu.nl/~tcs/trs/) with really complete slides on the ...
After careful reading i have come to understand that this is a complex behavior when the page size is doubled the page faults is reduced also when the page size is halved. The replacement algorithm considered is FIFO. note: page fault is denoted by `p` and no page fault by `n` `number of frames = physical memor...
I have ordered a few leather sheets from which I would like to build juggling balls by sewing edges together. I'm using the Platonic solids for the shape of the balls. I can scan the leather sheets and generate a polygon that approximates the shape of the leather sheet (as you know, it's animal skin, and it doesn't ...
|optimization|computational-geometry|packing|
|asymptotics|landau-notation|
I have ordered a few leather sheets from which I would like to build juggling balls by sewing edges together. I'm using the Platonic solids for the shape of the balls. I can scan the leather sheets and generate a polygon that approximates the shape of the leather sheet (as you know, it's animal skin, and it doesn't ...
$T(n)=2T(n/2) + n\lg^2(n)$ If I try to substitute $m = \lg(n)$ I end up with $T(2^m)=T(2^{m-1}) + 2^m\lg^{2}(2^m)$ Which isn't helpful to me. Any clues? Ps. hope this isn't too localized. I specified that the problem was a squared logarithm which should make it possible to find for others wondering abput t...
Solving recursion with logarithm squared ($T(n)=2T(n/2) + nlg^2n$)
|recurrence-relation|
Solving recurrence with logarithm squared $T(n)=2T(n/2) + nlg^2n$
$T(n)=2T(n/2) + n\log^2(n)$ If I try to substitute $m = \log(n)$ I end up with $T(2^m)=2 T(2^{m-1}) + 2^m\log^{2}(2^m)$ Which isn't helpful to me. Any clues? PS. hope this isn't too localized. I specified that the problem was a squared logarithm which should make it possible to find for others wondering ab...
This is indeed the second case in the [Master Theorem](http://en.wikipedia.org/wiki/Master_theorem). For the standard recursion form $$T(n)=a\;T(n/b)+f(n),$$ you get $a=b=2$, and therefore $f(n)=\Theta(n^{\log_b a} \log^2 n)=\Theta(n \log^2 n)$. Applying the Master theorem yields $T(n)=\Theta(n\log^3 n)$.
|asymptotics|proof-techniques|recurrence-relation|
I am not sure what bothers you but as I see it you are confused about the following two facts 1. If a graph is connected then $e \geq n-1.$ 2. If a graph has more than $e > \frac{(n-1)(n-2)}{2}$ then it is connected. Notice that the implications in 1 and 2 are in opposite directions. For a proof of 2. you ...
Questions about simulating one model in another. This includes simulating reality in any model, or simulating a machine model with Turing machines.
|formal-grammars|parsers|
Every simple undirected graph with more than $(n-1)(n-2)/2$ edges is connected
null
I have ordered a few leather sheets from which I would like to build juggling balls by sewing edges together. I'm using the Platonic solids for the shape of the balls. I can scan the leather sheets and generate a polygon that approximates the shape of the leather sheet (as you know, it's animal skin, and it doesn't ...
Why LL(k) and LL(∞) are incompatible with left-recursion? I understand that a LL(k) language can support left-recursivity provided that with k-overahead tokens can be resolved any ambiguity. But, with a LL(∞) grammar, which type of ambiguities can't be solved?
Since the number of frames is equal to the size of the memory divided by the page size, increasing the page size will proportionately decrease the number of frames. Having fewer frames will tend to increase the number of page faults because of the lower freedom in replacement choice. Imagine a system with four fram...
$T(n)=2T(n/2) + n\log^2(n)$. If I try to substitute $m = \log(n)$ I end up with $T(2^m)=2 T(2^{m-1}) + 2^m\log^{2}(2^m)$. Which isn't helpful to me. Any clues? PS. hope this isn't too localized. I specified that the problem was a squared logarithm which should make it possible to find for others wondering ...
Solving recurrence with logarithm squared $T(n)=2T(n/2) + n \log^2n$
Given a [binary expresion tree](http://en.wikipedia.org/wiki/Binary_expression_tree), with addition and multiplication operations, how can we optimize it's evaluation? Can we learn from [matrix chain multiplication](http://en.wikipedia.org/wiki/Matrix_chain_multiplication)? A [generalization](http://en.wikipedia.o...
i am unsure if i have even identified the problem correctly, but reading up on Knapsack problem seems the closest to what i am trying to solve: A cook has several ingredients of varying quantities. for example: 8 eggs 3 sausages 500 mL milk 12 strawberries There is a finite list of recipes, each consisting var...
knapsack problem with multiple constraints
|algorithms|knapsack-problems|
The problem that $LL$ variants have with left recursion is inherent to the way $LL$ works: it is a top-down type parser, which means it replaces nonterminals by their productions. An $LL$-style parser works as follows. It traverses the input from left to right in one go. If we are at some point in the input, then we...
You can do this in $O(n^2)$ time using an advanced version of Earley. [See this answer][1] for this advanced version. This algorithm can parse any $LR(k)$ grammar in linear time. While doing so, it also parses all prefixes of the string (if no lookahead is used - for lookahead you would need to also perform actions ...
I have a question in dynamic programming, If I have a set of sensors covering targets ( a target might be covered by mutiple sensors) how can I find the minimum cost subset of sensors knowing that each sensors has its own cost? I thought a lot about this, but I cant reach the recursive forumla to write my program? gree...
Minimum cost subset of sensors covering targets
|algorithms|dynamic-programming|
null
Are there programming languages(or logic) that can implement(or express) a function $f:\mathbb{N}\to \mathbb{N}$ if and only if $f$ is a computable bijective functions?
A programming language that can only implement computable bijective functions?
|reference-request|logic|programming-languages|
We are interested in reductions (relative hardness) because of our inability to prove absolute hardness results. For example, say you give me a problem to solve. After spending time on it, I am unable to come up with an efficient algorithm for it. Maybe I'm too dumb to come up with an algorithm, or maybe a (fast) a...
When takes it the longest to build up a suffix? Is it for a really small alphabet size, because it has to go deep into the tree? Or for a large alphabet size? Or is it dependent on the algorithm you use? If yes, how does the alphabet size affect the well-known Ukkonen algorithm?
What are the effects of the alphabet size on construct algorithms for suffix trees?
|algorithms|search-trees|