instruction stringlengths 0 29.8k ⌀ |
|---|
I am given an exercise unfortunately I didn't succeed by myself.
>There is a set of rectangles $R_{1}..R_{n}$ and a rectangle $R_{0}$. Using plane sweeping algorithm determine if $R_{0}$ is completely covered by the set of $R_{1}..R_{n}$.
For more details about the principle of sweep line algorithms see [here](ht... |
I have a collection $P \subseteq \mathbb{R}^3$ of $N$ particles and there is a function $f : P \to \mathbb{R}$. I want to find which configuration of the system minimizes the value of $f$.
Can this problem (or similar ones) be reduced to TSP? Could you point me to literature on the topic? |
Complexity of an optimisation problem in 3D |
|machine-learning|modelling| |
|algorithms|computational-geometry|user-interface|modelling| |
Maintaining search indices with binary trees |
|data-structures|binary-trees|data-mining| |
Distribute objects in a cube so that they have maximum distance between each other |
Proving a specific language is regular |
There are many methods to prove that [a language is not regular](http://cs.stackexchange.com/q/1031/157), but what do I need to do to prove that some language *is* regular?
For instance, if I am given that $L$ is regular,
how can I prove that the following $L'$ is regular, too?
$\qquad \displaystyle L' := \{w... |
To give you a use case that is less arcane than those given in the other answers: recursion mixes very well with tree-like (Object Oriented) class structures deriving from a common source. A C++ example:
class Expression {
public:
// The "= 0" means 'I don't implement this, I let my subclasses do t... |
|algorithms|arrays|integers|numerical-analysis| |
Let A and B be languages with A ⊆ B, and B is Turing-recognizable. Can A be not Turing-recognizable? If so, is there any example?
|
I am trying to learn Lambda calculus from [here][1]
[1]: http://www.cse.chalmers.se/research/group/logic/TypesSS05/Extra/geuvers.pdf
and while trying to solve some problems, I got stuck. I was trying to solve the following problem (page 14, excercise 2.6 part (i):
Simplify $M \equiv (\lambda xyz.zyx) aa (\... |
Lambda Calculus beta reduction |
|lambda-calculus| |
I have taught C++ to undergraduates for about two years and covered recursion. From my experience, your question and feelings are *very* common. At an extreme, some students see recursion as difficult to understand while others want to use it for pretty much everything.
I think Dave sums it up well: use it where it ... |
No, your reduction is wrong. The function $(\lambda x y z. z y x)$ is applied to three arguments: $a$, $a$ and $(\lambda p q. q)$. It is not, as you wrote, a the function $(\lambda x y z. z y x)$ applied to the term $a a (\lambda p q. q)$; that second term does not appear in $M$. Strictly speaking, functions in the lam... |
null |
Suppose I am given an array of $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$. I want to compute the sum $S = a_1 + \ldots + a_n$ on a machine with 2's complement arithmetic, which performs additions modulo $2^w$ with wraparound semantics. That's easy — but the sum may overfl... |
|operating-systems|virtual-memory|paging| |
null |
Thread a binary search tree into an array, and use certain techniques to keep the rotations in $\mathcal{O}(1)$.
Insertions will still take $\mathcal{O}(log\text{ }n)$, but get-min and extract-min will be in $\mathcal{O}(1)$ without having to invent a new structure like [Raphael][1] is [attempting][2] to do.
On h... |
I have a collection $P \subseteq \mathbb{R}^3$ of $N$ particles and there is a function $f : P \to \mathbb{R}$. I want to find which configuration of the system minimizes the value of $f$.
Can this problem (or similar ones) be reduced to TSP? Could you point me to literature on the topic?
PS: the function is the... |
An accumulator of size $\lceil \log n\rceil + w$ bits won't overflow and will perform better than anything I can thing of now. If $\lceil \log n\rceil \leq w$ that means using double precision arithmetic and I would not be surprised if that cost nothing in the inner loop on a super-scalar processor (i.e. it would simpl... |
An accumulator of size $\lceil \log n\rceil + w$ bits won't overflow and will perform better than anything I can thing of now. If $\lceil \log n\rceil \leq w$ that means using double precision arithmetic and I would not be surprised if that cost nothing in the inner loop on a super-scalar processor (i.e. it would simpl... |
Suppose I am given an array of $n$ fixed width integers (i.e. they fit in a register of width $w$), $a_1, a_2, \dots a_n$. I want to compute the sum $S = a_1 + \ldots + a_n$ on a machine with 2's complement arithmetic, which performs additions modulo $2^w$ with wraparound semantics. That's easy — but the sum may overfl... |
|algorithms|time-complexity|terminology| |
Questions about how specific notions have to be understoof as well as conventions of notation. |
I have a logistic problem that can be seen as a variant of $\text{TSP}$. It is so natural, I'm sure it has been studied in Operations research or something similar. Here's one way of looking at the problem.
I have $P$ warehouses on the Cartesian plane. There's a path from a warehouse to every other warehouse and the... |
What is the name of this logistic variant of TSP? |
|optimization|reference-request|approximation| |
Because "efficient parallel" falls inside [$\mathsf{NC}$][1] (“Nick's Class” of problems decidable in polylogarithmic time with a polynomial number of processors), and it is widely *believed* that [$\mathsf{NC} \neq \mathsf{P}$][2]. So any $\mathsf{P\text{-}complete}$ problem is not *believed* to have an efficient para... |
I have a collection $P \subseteq \mathbb{R}^3$ of $N$ particles and there is a function $f : P^2 \to \mathbb{R}$. I want to find which configuration of the system minimizes the value of $f$.
Can this problem (or similar ones) be reduced to TSP? Could you point me to literature on the topic?
In my application, $f... |
|information-theory|terminology|kolmogorov-complexity| |
|logic|proof-techniques|formal-methods|terminology| |
Questions about how specific notions have to be understood as well as conventions of notation. |
I have a logistic problem that can be seen as a variant of $\text{TSP}$. It is so natural, I'm sure it has been studied in Operations research or something similar. Here's one way of looking at the problem.
I have $P$ warehouses on the Cartesian plane. There's a path from a warehouse to every other warehouse and the... |
When to use recursion? |
null |
|complexity-theory|proof-techniques| |
|compilers|terminology| |
|computational-geometry|user-interface|modelling| |
Questions on how to model real-world or non computer science problems with computer science tools. |
|machine-learning|modelling|social-networks|knowledge-representation| |
|algorithms|optimization|reference-request|approximation| |
|complexity-theory|terminology|nondeterminism| |
|complexity-theory|np-complete|proof-techniques|reductions| |
|algorithms|education|reference-request| |
|empirical-research|modelling|hci| |
|logic|lambda-calculus| |
|complexity-theory|terminology|decision-problem| |
|machine-learning|artificial-intelligence|modelling|recommendation-systems| |
|probability-theory|empirical-research|modelling|hidden-markov-models| |
This is something that confuses many students. The point here is that being subset of another language does not imply much about their difficulty of computation. You can always consider the trivial language $\emptyset$ and $\Sigma^*$ and any other language is between them w.r.t. set inclusion.
Therefore just knowing... |
|operating-systems|terminology|process-scheduling| |
|operating-systems|terminology|concurrency|os-kernel| |
|machine-learning|modelling|pattern-recognition| |
|complexity-theory|np-complete|terminology| |
|terminology|security|stack-inspection| |
|terminology|discrete-mathematics|order-theory| |
|education|reference-request| |
|logic|terminology|lambda-calculus|type-theory| |
|computer-architecture|empirical-research|data-sets| |
|machine-learning|modelling| |
Questions on how to represent real-world or non computer science problems with computer science tools. |
|modelling|concurrency|process-algebras| |
|logic|discrete-mathematics|didactics| |
|algorithms|data-structures|terminology| |
|computability|education|reference-request|soft-question| |
|algorithms|machine-learning|modelling|social-networks| |
|algorithms|complexity-theory|terminology|efficiency| |
|combinatorics|modelling|information-theory|sudoku| |
|logic|modelling|concurrency|process-algebras| |
Suppose i have the given data set of length 11 of scores p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1]
I want to select 6 ,5 , 5 , 4 , 2 , 2 scores from the data set.
How many ways are there?
For the above example answer is:: 6 ways
{p1, p2, p4, p5, p7, p8 }
{p10, p2, p4, p5, p7, p8 }
{p1, p2, p10, p5, p... |
How many possible ways are there? |
|algorithms| |
|algorithms|combinatorics| |
DCT is both discrete and finite, it has a limited range in both the space and frequency domains. If the change in a certain location is large or the location changes a lot, the results of the transform will be beyond the sampling range in the frequency domain.
Since as you mentioned MPEG is based on blocks, the resu... |
Suppose i have the given data set of length 11 of scores p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1]
I want to select scores 6 ,5 , 5 , 4 , 2 , 2 from the data set.
How many ways are there?
For the above example answer is: 6 ways
{p1, p2, p4, p5, p7, p8 }
{p10, p2, p4, p5, p7, p8 }
{p1, p2, p10, p5, p7, ... |
|combinatorics| |
null |
Suppose I have the given data set of length 11 of scores:
p=[2, 5, 1 ,2 ,4 ,1 ,6, 5, 2, 2, 1]
I want to select scores 6, 5, 5, 4, 2, 2 from the data set. How many ways are there?
For the above example answer is: 6 ways
{p[1], p[2], p[4], p[5], p[7], p[8]}
{p[10], p[2], p[4], p[5], p[7], p[8]}
... |
Say you want to pick, out of a multiset $S$ the numbers $x_1$, $x_2$, ..., $x_n$ with multiplicity $m_1$, $m_2$, $m_n$ (that you want to pick $x_1$ exactly $m_1$ times).
Furthermore, assume that in $S$ the numbers $x_1$, $x_2$, ..., $x_n$ have multiplicity $s_1$, $s_2$,..., $s_n$.
Then,
you have exactly $s_1 \ch... |
Say you want to pick, out of a multiset $S$ the numbers $x_1$, $x_2$, ..., $x_n$ with multiplicity $m_1$, $m_2$, $m_n$ (that you want to pick $x_1$ exactly $m_1$ times).
Furthermore, assume that in $S$ the numbers $x_1$, $x_2$, ..., $x_n$ have multiplicity $s_1$, $s_2$,..., $s_n$.
Then,
you have exactly $s_1 \ch... |
I know that Euclid's algorithm is the best algorithm for get the GCD (great common divisor) for a list the positive integer numbers.
But, in the practice, you can write two codes por evaluate the gcd (for my case, i decided use java, but c/c++ may be another option).
I need to get the most efficient code of two... |
What is most efficient for GCD? |
|algorithms|efficiency| |
I have taught C++ to undergraduates for about two years and covered recursion. From my experience, your question and feelings are *very* common. At an extreme, some students see recursion as difficult to understand while others want to use it for pretty much everything.
I think Dave sums it up well: use it where it ... |
The first example used to teach recursion in my beginning programming class was a function to list all the digits in a number separately in reverse order.
void listDigits(int x){
if (x <= 0)
return;
print x % 10;
listDigits(x/10);
}
Or something like that (I'm g... |
As I know java doesn't supports tail recursion optimization in general, but you can test it for your case, if it doesn't supports, simple for loop should be faster else they are same as each other, but these are bit optimization, choose the one you think is easier and more readable. I should note that fastest GCD algor... |
Say you want to pick, out of a multiset $S$, the numbers $x_1$, $x_2$, ..., $x_n$ with multiplicity $m_1$, $m_2$, ..., $m_n$ (i.e., you want to pick $x_1$ exactly $m_1$ times).
Furthermore, assume that in $S$ the numbers $x_1$, $x_2$, ..., $x_n$ have multiplicity $s_1$, $s_2$,..., $s_n$. (we assume for every $i$, $... |
null |
So I have a problem that I'm looking over for an exam that is coming up in my Theory of Computation class. I've had a lot of problems with the *pumping lemma*, so I was wondering if I might be able to get a comment on what I believe is a valid proof to this problem. From what I have seen online and in our review I do... |
Prime number CFG and Pumping Lemma |
|proof-techniques|pumping-lemma| |
Your proof is incomplete, there are many cases you don't cover. You are not ruling out, for example, $u = 0^{m/2-3}$, $v=0$, $x=00$, $y=00$, $z=0^{m/2-2}$.
A good hint that your proof is wrong is that all you're using about prime numbers is that they're odd¹. Odd numbers do form a context-free language.
The pumpi... |
So I have a problem that I'm looking over for an exam that is coming up in my Theory of Computation class. I've had a lot of problems with the *pumping lemma*, so I was wondering if I might be able to get a comment on what I believe is a valid proof to this problem. From what I have seen online and in our review I do... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.