instruction stringlengths 0 29.8k ⌀ |
|---|
How many minimal spanning trees are there when all edge costs are distinct? |
|graphs|discrete-mathematics|greedy-algorithms|spanning-trees|weighted-graphs| |
There are 3 processors: $P_1$, $P_2$, $P_3$. $P_1$ can execute only one job while the other two can execute any number of jobs in parallel.
Each job consists of 3 parts, and each part is processed by their respective processor (eg. part 1 by $P_1$). Furthermore part 2 can be executed only after $P_1$ finishes execut... |
Minimize the total execution time of jobs executed by 3 processors in sequence |
|algorithms|dynamic-programming|scheduling| |
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... |
If the number of citizens is large enough, such that the effect of one citizen changing his/her selection is negligible, then an envy-free division is equal to a Nash equilibrium in a congestion game:
http://en.wikipedia.org/wiki/Congestion_game
Specifically, Igal Milchtaich's papers are relevant to this problem:
... |
null |
I have this problem which is described as follows:
Input:
You are given a multi-set M (a set that can contain duplicates), and two numbers P and T.
$ M = {(x_1,y_1), (x_2,y_2), ..., (x_n,y_n)}$.
Each x and y is an integer >= 0.
P in an integer >= 0.
T is an integer > 0.
Question:... |
How to reduce from subset-sum problem? |
|np-complete|proof-techniques|np-hard|np| |
Just an extended **hint** (let me know if you need more details); suppose that you have an instance of SUBSET SUM:
$0 \leq x_1, x_2, ..., x_n$ and an integer $0 \leq t$
You must find $b_i \in \{0,1\}$ such that $b_1*x_1+b_2*x_2+...+b_n*x_n = t$
Which is equivalent to:<br>
$b_1*x_1+b_2*x_2+...+b_n*x_n \geq t$ ... |
Suppose that you have an instance of SUBSET SUM:
$0 \leq x_1, x_2, ..., x_n$ and an integer $0 \leq t$
You must find $b_i \in \{0,1\}$ such that $b_1*x_1+b_2*x_2+...+b_n*x_n = t$
Which is equivalent to:<br>
$b_1*x_1+b_2*x_2+...+b_n*x_n \geq t$ AND $b_1*x_1+b_2*x_2+...+b_n*x_n \leq t$
$b_1*x_1+b_2*x_2+...+b... |
null |
[This](http://isabelle.in.tum.de/website-Isabelle2011-1/dist/Isabelle2011-1/doc/intro.pdf) introduction to Isabelle is pretty exhaustive.
Also see [this introduction](https://www.google.co.il/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&ved=0CEgQFjAD&url=http%3A%2F%2Fwww.informatik.uni-bremen.de%2F~cxl%2Flehre%2Fisakur... |
I think to be the same problem as with the sum of the series.<br/>
So, for example, if there is a set $G_1$, such that the sum of all x > P ($G_1:\{(x,y): \sum{x} > P\}$) and then a set of $G_2$ such that the sum of all y < T ($G_2:\{(x,y): \sum{y} < T\}$), then i think the set of G is the intersection of these two se... |
I have this problem which is described as follows:
Input:
You are given a multi-set $M$ (a set that can contain duplicates), and two numbers $P$ and $T$.
$M = {(x_1,y_1), (x_2,y_2), ..., (x_n,y_n)}$.
Each $x$ and $y$ is an integer $>= 0$.
$P$ in an integer $>= 0$.
$T$ is an integer $> 0$.... |
I think to be the same problem as with the sum of the series.<br/>
So, for example, if there is a set $G_1$, such that the sum of all x > P ($G_1=\{(x,y): \sum{x} > P\}$) and then a set of $G_2$ such that the sum of all y < T ($G_2=\{(x,y): \sum{y} < T\}$), then i think the set of G is the intersection of these two se... |
I think to be the same problem as with the sum of the series.<br/>
So, for example, if there is a set $G_1$, such that the sum of all x > P ($G_1=\{(x,y): \sum{x} > P\}$) and then a set of $G_2$ such that the sum of all y < T ($G_2=\{(x,y): \sum{y} < T\}$), then i think the set of G is the intersection of these two se... |
I think to be the same problem as with the sum of the series.<br/>
So, for example, if there is a set $G_1$, such that the sum of all x > P ($G_1=\{(x,y): \sum{x} > P\}$) and then a set of $G_2$ such that the sum of all y < T ($G_2=\{(x,y): \sum{y} < T\}$), then i think the set of G is the intersection of these two se... |
|algorithms|scheduling| |
null |
Unfortunately there aren't many textbooks on the topic. I think the best way to learn program analysis today is to survey different courses that are available, play with a few implementations and then look at a few research papers for your specific needs. What follows is a very small sampling of what's out there. Since... |
Suppose I have a graph $G$ with a set of perfect matchings $M(G)$. Suppose this set is non-empty, then how difficult is it to sample uniformly at random from $M$? What if I am okay with a distribution that is close to uniform, but not quiet uniform, then is there an efficient algorithm? |
Sampling perfect matching uniformly at random |
|algorithms|complexity-theory|randomized-algorithms|matching| |
I need an efficient algorithm that takes input a collection of intervals and outputs the largest subset of non-intersecting intervals.
i.e. Given a set of intervals $I = \{I_1, I_2, \ldots, I_n\}$ of the real line, we need to output a set of intervals $O = \{O_1, O_2, \ldots, O_k\}$ such that
- $O$ is a subset... |
null |
There is a classical paper of [Jerrum and Sinclair][1] on sampling perfect matchings from dense graphs. Another classical paper of [Jerrum, Sinclair and Vigoda][2] discusses sampling perfect matchings from bipartite graphs.
Both these papers uses rapidly mixing Markov chains, and so the samples are only almost unifo... |
null |
null |
You've asked two questions:
* Why is the tree height Θ(log n)?
* Why is the runtime Θ(m log n)?
This answer addresses both questions. I'll start off with a review of the ranks of the different trees to go over some basics, then discuss these time bounds.
----
One trick that might be useful her... |
If you have a forest implementation of disjoint sets, and have the union by weight/rank heuristic where you append the smaller one. Then why is the worst case running time Θ(m log n)? (m is the number of disjoint sets and n is the number of Make Set operations.) |
Get the running time of forest disjoint sets |
|data-structures| |
null |
How can someone synchronize two or more threads using serialization. According to my professor's slides and code assignments you can use serialization to solve the synchronization problem. (He doesn't explain what serialization is).
I tried to do my research but serialization means that you put data in a specific or... |
Synchronization using serialization |
|computer-architecture|kernel| |
null |
Can anyone suggest an algorithm faster than $O(n^{2})$ for computing the following function:
$$||n||:=\frac{1}{\max\{k \in \mathbb{N}: 1|n, 2|n,\ldots,k|n\}}$$ |
Faster Algorithm for Computing Norm |
|algorithms| |
The classic Hindley-Milner type inference algorithm requires each literal value to be unambiguously inferable to a type: `0` is an `int`, while `0.0` is a `real`. Haskell's type system has been enhanced to include a certain kind of bounded polymorphism, so that `0` can have any type that is a number (more precisely, of... |
null |
null |
null |
The worst case running time of insertion sort is Ө(n^2) , we don’t write it as O(n^2).
O-notation is used to give upper bound on function . if we use it to bound a worst case running time of insertion sort, it implies that O(n^2) is upper bound of algorithm no matter what type of input is , means it doesn’t matter w... |
why Ө-notation is suitable to insertion sort to describe its worst case running time? |
|algorithms|time-complexity|recursion| |
null |
I have a question have to answer, so that, if anyone have the answer, please help me.
The problem is: Give a self-contained proof that **L≠PSPACE**
where: L = `L| L is a language decidable in logarithmic space`
PSPACE = `L| L is a language decidable in polynomial space`
Thank you in advance. |
Relationship between L and PSPACE |
|complexity-theory| |
You are confusing two different notions.
The definition of $\theta$ that you give is correct, and indeed the running time of insertion sort, in the worst case, is $\theta(n^2)$, since it has a quadratic running time.
The fact that this is the worst running time is somewhat irrelevant here. You have some function, a... |
You might start with wikipedia: [Space hierarchy theorem][1].
[1]: http://en.wikipedia.org/wiki/Space_hierarchy_theorem#Proof |
You are confusing two different notions.
The definition of $\Theta$ that you give is correct, and indeed the running time of insertion sort, in the worst case, is $\Theta(n^2)$, since it has a quadratic running time.
The fact that this is the worst running time is somewhat irrelevant here. You have some function, a... |
The worst case running time of insertion sort is $\Theta(n^2)$ , we don’t write it as $O(n^2)$.
$O$-notation is used to give upper bound on function . if we use it to bound a worst case running time of insertion sort, it implies that $O(n^2)$ is upper bound of algorithm no matter what type of input is , means it doe... |
null |
|algorithms|time-complexity|algorithm-analysis|asymptotics| |
The worst case running time of insertion sort is $\Theta(n^2)$ , we don’t write it as $O(n^2)$.
$O$-notation is used to give upper bound on function . if we use it to bound a worst case running time of insertion sort, it implies that $O(n^2)$ is upper bound of algorithm no matter what type of input is , means it doe... |
Just a quick question,
If i were to alter the general DFS algorithm to do this:
minDFS(Vertex v)
{
if (!v.getVisted())
{
v.setVisited();
Vertex temp = findClosestVertex();
graph.addEdge(v, temp);
minDFS(temp);
}
}
Would I e... |
|programming-languages| |
|complexity-theory|reductions|proof-techniques|np-hard| |
I am facing problem in understanding the KMP algorithm as given in the book "Introduction to Algorithm" by Cormen et. al. (Chapter 32):
![enter image description here][1]
![enter image description here][2]
With respect to the above algorithm, I have following question:
1. In both the algorithms, where ... |
|algorithms|terminology| |
|graphs|spanning-trees| |
Assume there were at least two distinct minimal spanning trees. What can you deduce?
>! Consider an edge $e_1$ in one tree and the [cut](https://en.wikipedia.org/wiki/Cut_%28graph_theory%29) it induces. What can you say about the edges that are both in this cut and in the other tree?
The ultimate hint:
>! With t... |
|data-structures| |
How can someone synchronize two or more threads using serialization? According to my professor's slides and code assignments you can use serialization to solve the synchronization problem. (He doesn't explain what serialization is).
I tried to do my research but serialization means that you put data in a specific or... |
|concurrency|synchronization| |
Can anyone suggest an algorithm faster than $\Theta(n^{2})$ for computing the following function:
$$||n||:=\frac{1}{\max\{k \in \mathbb{N}: 1|n, 2|n,\ldots,k|n\}}$$ |
|algorithms|discrete-mathematics|number-theory| |
I have a question have to answer, so that, if anyone have the answer, please help me.
The problem is: Give a self-contained proof that $\mathsf{L} \neq \mathsf{PSPACE}$
where:
$\qquad \mathsf{L} = \{ L \mid L \text{ is a language decidable in logarithmic space} \}$ and
$\qquad \mathsf{PSPACE} = \{ L \m... |
|complexity-theory|space-complexity| |
I was wondering, since <code>a*</code> is itself a star-free language, is there a star-free language that is not a regular language? Could you give an example?
$\emptyset$ is star-free $\Longrightarrow$
$\Sigma=\bar{\emptyset}$ is star-free $\Longrightarrow$
$A\subseteq\Sigma\Rightarrow\Sigma^*A\Sigma^*$ is... |
star free language vs. regular language |
|formal-languages|regular-languages|automata| |
Star free languages are described by regular expressions that include concatenation, complementation, union, intersection, but no Kleene-star.
Since regular languages are closed under all these operations (where complementation is the crucial point), then every star-free language is also regular.
Perhaps you mean... |
Star free languages are described by regular expressions that include concatenation, complementation, union, intersection, but no Kleene-star.
Since regular languages are closed under all these operations (where complementation is the crucial point), then every star-free language is also regular.
Perhaps you mean... |
I was wondering, since <code>a*</code> is itself a star-free language, is there a regular language that is not a star-free language? Could you give an example?
$\emptyset$ is star-free $\Longrightarrow$
$\Sigma=\bar{\emptyset}$ is star-free $\Longrightarrow$
$A\subseteq\Sigma\Rightarrow\Sigma^*A\Sigma^*$ is... |
Two or more threads executing *concurrently* require synchronization if and only if at least one of the threads accesses and modifies one or more variables (write access) accessed by the remaining threads (either read or write access). Therefore, if all of the threads access the same set of variables only for reading t... |
|complexity-theory|reductions|np-hard| |
I have this problem which is described as follows:
Input:
You are given a multi-set $M$ (a set that can contain duplicates), and two numbers $P$ and $T$.
$M = {(x_1,y_1), (x_2,y_2), ..., (x_n,y_n)}$.
Each $x$ and $y$ is an integer $>= 0$.
$P$ in an integer $>= 0$.
$T$ is an integer $> 0$.... |
My preference is for Coq, but I imagine that others prefer Isabelle. One of the strange things I found about Isabelle is that there is a two-level syntax, where some of your definitions need to be inside double quote. No such nonsense is present in Coq.
Ultimately, the one that is most suitable for you may depend on... |
Assuming I understand your definition, your problem is related to the optimisation version of LONGEST PATH:
>**LONGEST PATH**<br/>
>*Input*: A graph $G=(V,E)$, an integer $k$.<br/>
>*Question*: Is there a path with at least $k$ vertices in $G$
This problem is NP-complete, there's a fairly obvious reduction from... |
null |
null |
I have this question:
Input:
G(V, E) = an undirected graph, V={v1, v2, ..., vn} (V = set of nodes, E = set of edges)
where there is a path connecting from v1 to vn.
Question:
What is the maximum number of nodes you can visit when starting from v1 and ending at vn.
(including v1 ... |
How to prove NP-hardness? |
Store a list of all "factorials" (least common multiplies of $\{1,\ldots,k\}$) and use binary search. That reduces the number of divisions in the worst case. If the numbers $n$ you are getting are "random" then you might want to start with smaller trial divisions, or perhaps with an exponentially growing $k$, i.e. try ... |
null |
There are many NP-complete decision problems that ask the question whether it holds for the optimal value that OPT=m (say bin packing asking whether all items of given sizes can fit into m bins of a given size).
Now, I am interested in the problem whether OPT>m. Is this a decision problem or an optimization problem? I... |
Polynomial time reductions using binary search |
|complexity-theory|np-complete|reductions|optimization|decision-problem| |
Two or more threads executing *concurrently* require synchronization if and only if at least one of the threads accesses and modifies one or more variables (write access) accessed by the remaining threads (either read or write access). Therefore, if all of the threads access the same set of variables only for reading t... |
|complexity-theory|terminology|np-complete|optimization|decision-problem| |
The way the question is asked you should come up with an **upper bound** and a **lower bound** on the space complexity.
The first part is usually done by presenting an algorithm for your problem but a reduction **to** some other well studied problem would also work (and indirectly yield an algorithm, too). Since you... |
Destination-based routing is the typical, most common type of routing. For this, each message that we send contains the address of the destination and the forwarding decision process makes its forwarding decision solemnly based on this address (and independent of the original sender). i.e. We don't care about who sent ... |
It is said that there are uncountably many languages but only countably many Turing Machines. Could someone make this clear to me? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.