instruction
stringlengths
0
29.8k
⌀
I'm reading [this][1] slides from a MIT course on parallel software performance. They introduced the concepts of Work $T_1$, Span $T_\infty$ and Parallelism (ratio $T_1/T_\infty$). What is called ''Parallelism'' here can be interpreted, according to the same authors, as *the maximum possible speedup that can be achieve...
Super-linear parallelism or speedup in matrix parallel algorithms
|parallel-computing|performance|matrix-multiplication|
Super-linear parallelism or speedup in parallel matrix multiplication algorithms
null
Roughly speaking, I expect the answer will be yes, this can be done efficiently, but the longer answer is that I believe it takes some care to define what you mean by simulating. First, we must define what we mean by "classical physics". I will assume you mean (deterministic) Newtonian physics. Second, we must d...
null
null
If the order matters and the $p_k$ are distinct, $$N(C)=\begin{cases}C=p_1\to1\\C=p_2\to1\\\cdots\\C=p_n\to1\\\text{else}\to\displaystyle\sum_{p_k\le C}N(C-p_k)\end{cases}$$
The speedup cannot be superlinear in the number of processors (because a single processor can always simulate $p$ of them with no loss of efficiency). As said by @Dmitry, $S_\infty$ corresponds to an infinity of processors so there is no contradiction. Now you are trying to generalize $$S_\infty=\frac{n^3}{\log^2...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
null
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
null
As far as we know, space and time are continuous and exact physical simulations are impossible. Approximate resolution by ODE's or PDE's are in indeed in P.
You could argue that something like Swift kind of fits into this category - because the language is actually quite small, but with a massive standard library. Not even +, -, *, / are part of the language - the fact that they are binary or sometimes unary operators, left associative, with certain priorities is defined i...
I have a problem that can be reduced to an assignment problem. (this is related to some [cryptography problems][1]) Which means we have a set $A$ of $n$ agents and an equal size set $T$ of tasks as well as a cost function $c(i,j)$, and one wants to find a bijection $\sigma: A\to T$ that maximizes the satisfaction of...
Balanced Assignment Problem with updatable cost
|dynamic-programming|assignment-problem|
|dynamic-programming|linear-programming|assignment-problem|
I have a problem that can be reduced to an assignment problem. (this is related to some [cryptography problems][1]) Which means we have a set $A$ of $n$ agents and an equal size set $T$ of tasks as well as a cost function $c(i,j)$, and one wants to find a bijection $\sigma: A\to T$ that maximizes the satisfaction of...
I have a problem that can be reduced to an assignment problem. (this is related to some [cryptography problems][1]) Which means we have a set $A$ of $n$ agents and an equal size set $T$ of tasks as well as a cost function $c(i,j)$, and one wants to find a bijection $\sigma: A\to T$ that maximizes the satisfaction of...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
When you multiply two n x n matrices using the naive algorithm, your problem size is not n, but n^2. The number of operations is not n, but n^3. Unless someone is more clever than I am, an infinite number of processors could calculate the product in time O (log n), since you need to add sums of n numbers and you do...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
null
$L \in Co-NP$ $=> \overline{L} \in NP $ $=> \overline{L} \in Co-NP $ $=> L \in NP $ $=> Co-NP ⊆ NP $ $=> NP = Co-NP $
I've been working with Bresenham’s Algorithm in 2D and understand it is derived from the following logic: y = mx+c To get the slope error at a given point, the following equation is used: d2 is the distance from value Y to the whole integer above. d1 is the distance from value Y to the whole integer below. ...
How slope error factored in when for Bresenham’s Algorithm from 2D to 3D?
|algorithms|computer-graphics|
Let's start from the definitions, in order to clarify things. The *work* of a computation executed by $p$ processors is the total number of operations performed. Ignoring the parallel overhead, the work is equal to $T_1$ which is the time used to run the computation on a single processor. Think about this: the wo...
null
According to the [Wiki article on NP-Completeness][1], NP-Complete problems can be solved in $O(c^{n^k})$ time (I'll call this EXP-POLY time). However, shouldn't the bound on all their run times be the tighter $O(c^n)$ time (I'll call this simply EXP time)? I ask because, for example, for the Traveling Salesman Prob...
Do all NP-Complete problems run in $O(c^n)$ time, as opposed to $O(c^{n^k})$?
|complexity-theory|time-complexity|np-complete|reductions|traveling-salesman|
Suppose, for the sake of argument, that it was proved that $P \not= NP$. Then, this would imply that for every $NP$-complete problem, there is a "hardest instance" of the problem that cannot be solved in polynomiall time. Then, if $P$ were to not equal $NP$, what properties would be known about the hardest instances ...
Unpacking the notion of "hardest instances" for NP-complete problems
|complexity-theory|np-complete|decision-problem|p-vs-np|
I will explain a closely related algorithm in 2D and 3D. The parametric equation of a continuous line can be written vectorially P = P0 + t.∆P where `t` runs from `0` to `1`. If we want to discretize in such a way that the pixels are contiguous, the increment of `t` must be the smallest of `1/∆x` and `1...
Suppose, for the sake of argument, that it was proved that $P \not= NP$. Then, this would imply that for every $NP$-complete problem, there is a "hardest instance" of the problem that cannot be solved in polynomiall time. Then, if $P$ were to not equal $NP$, what properties would be known about the hardest instances ...
I will first explain a closely related line drawing algorithm in 2D. The parametric equation of a continuous line can be written vectorially P = P0 + t.∆P where `t` runs from `0` to `1`. If we want to discretize in such a way that the pixels are contiguous, the increment of `t` must be the smallest of `...
Suppose, for the sake of argument, that it was proved that $P \not= NP$. Then, this would imply that for every $NP$-complete problem, there is a "hardest instance" of the problem that cannot be solved in polynomiall time. Then, if $P$ were to not equal $NP$, what properties would be known about the hardest instances ...
According to the [Wiki article on NP-Completeness][1], NP-Complete problems can be solved in $O(c^{n^k})$ time (I'll call this EXP-POLY time). However, shouldn't the bound on all their run times be the tighter $O(c^n)$ time (I'll call this simply EXP time)? I ask because, for example, for the Traveling Salesman Prob...
null
> This would imply that for every NP-complete problem, there is a "hardest instance" of the problem that cannot be solved in polynomiall time. No. This is incorrect. For every single instance, there is a polynomial-time algorithm that solves that instance correctly. The algorithm can hardcode a check to check for...
null
null
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
Is there a way to find the subsequence sum in an N by M array that is closest to a given N-dimensional vector?
|dynamic-programming|linear-algebra|diophantine-equation|
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
Is there a way to find the subsequence sum in an N by M array that is the closest to a given N-dimensional vector?
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
Is there a way to find the fixed size subsequence sum in an N by M array that is the closest to a given N-dimensional vector?
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
>Prove that the unique language $A\subseteq \Sigma^*$ such that $AB$ is context free for all languages $\subseteq \Sigma^*$ is the empty set. If $A$ is not the empty set, there should be a way to construct a language $B$ so that $AB$ is not context-free. I'm not sure how to generalize this for arbitrary nonempty lan...
prove that the unique language $A$ such that $AB$ is context free for all languages B is the empty set
|formal-languages|context-free|formal-grammars|
If $AB$ is context-free, so should be the set of all its suffixes. Those include the suffixes of $B$, and if $B$ is complicated enough prefixing $A$ does not change the complexity of the set of suffixes. Your solution $B = \{0^n1^n0^n \mid \dots \}$ seems to work, but if $A$ ends in $0^*$ the reasoning becomes a lit...
>Prove that the unique language $A\subseteq \Sigma^*$ such that $AB$ is context free for all languages $\subseteq \Sigma^*$ is the empty set. If $A$ is not the empty set, there should be a way to construct a language $B$ so that $AB$ is not context-free. I'm not sure how to generalize this for arbitrary nonempty lan...
Basically, I need to solve the multivariate case of the "closest subsequence sum to a given value K" problem, which is solved with dynamic programming as far as I understand. Let's say I have M rows of integer data. ``` A = [ [a11, a12, .., a1n], ... [ai1, ai2, .., ain], ... [am1, am2, .., amn] ] ``` And I h...
This can be formulated as an instance of the [closest vector problem](https://en.wikipedia.org/wiki/Lattice_problem#Closest_vector_problem_(CVP)) in a lattice. In particular, replace the vector $(a_{i1},\dots,a_{in})$ with the vector $(a_{i1},\dots,a_{in},c,0,0,\dots,K,0,\dots,0)$, where the $K$ is in the $i$th posi...
null
I have learnt about both articulation points and bridges and I have understood the algorithm used to find the number of bridges in O(n) time which is Tarjan's algorithm. But now, can I simply say that the vertices connecting the bridges are the articulation points with the additional condition that they should have deg...
Finding articulation points
|algorithms|graphs|
null
Let $G$ be a vertex-labeled directed graph with unique labels $L$. Let $G_P$ be a path graph with the same vertex labels and the same number of vertices as $G$. I know that in the general case computing the Graph Edit Distance is NP-hard (if approximations are excluded) and APX-hard to approximate. I'm interested...
Fast algorithm for Graph Edit Distance to vertex-labeled Path Graph
|algorithms|graphs|edit-distance|
null
Let $G$ be a vertex-labeled directed graph with unique labels $L$. Let $G_P$ be a [path graph](https://en.wikipedia.org/wiki/Path_graph) with the same vertex labels and the same number of vertices as $G$. I know that in the general case computing the [Graph Edit Distance](https://en.wikipedia.org/wiki/Graph_edit_dis...
I am trying to understand the reason as given in [this answer][1] >If an ε-free grammar is not LR(0), then there is some state with both a shift and a reduce action. Since the grammar is ε-free, that state was reached by way of a shift or a goto. The previous state must then have had two different productions with...
Argument for an $\epsilon$ free LL(1) grammar not being in LR(0)?
|parsers|lr-k|
Yes, it is true that <!-- in an undirected graph without loop --> an endpoint of a bridge is an articulation point if it has degree > 1. Be careful, however. There could be articulation points that are not not endpoints of any bridge. For example, the red vertex in the graph below is an articulations point. However...
I am reading the book "Cracking the coding interview". In Chapter 4 they cover basic tree concepts. It said there that a complete binary tree is a binary tree in which every level of the tree is fully filled, except for perhaps the last level. To the extent that the last level is filled, it is filled left to right....
The relationship between a perfect binary tree and complete & full binary tree
|trees|binary-trees|
Yes, <!-- in an undirected graph without loop --> an endpoint of a bridge is an articulation point iff it has degree > 1. Be careful, however. There could be articulation points that are not endpoints of any bridge. For example, the red vertex in the graph below is an articulations point. However, there is no bridg...
I am trying to understand the reason as given in [this answer][1] >If an ε-free grammar is not LR(0), then there is some state with both a shift and a reduce action. Since the grammar is ε-free, that state was reached by way of a shift or a goto. The previous state must then have had two different productions with...
Here is the full text on that book, sixth edition. > Perfect Binary Trees > > A perfect binary tree is one that is both full and complete. All leaf nodes will be at the same level, and this level has the maximum number of nodes. As you have observed, the statement quoted above is somewhat ambiguous and confusing...
Here is the relevant text on that book, sixth edition. > Perfect Binary Trees > > A perfect binary tree is one that is both full and complete. All leaf nodes will be at the same level, and this level has the maximum number of nodes. As you have observed, the statements quoted above is somewhat ambiguous and conf...
Here is the relevant text on that book, sixth edition. > Perfect Binary Trees > > A perfect binary tree is one that is both full and complete. All leaf nodes will be at the same level, and this level has the maximum number of nodes. As you have observed, the statements quoted above is somewhat ambiguous and conf...
Here is the relevant text on that book, sixth edition. > Perfect Binary Trees > > A perfect binary tree is one that is both full and complete. All leaf nodes will be at the same level, and this level has the maximum number of nodes. As you have observed, the statements quoted above is somewhat ambiguous and conf...
null
I am reading the book "*Cracking the coding interview*". In Chapter 4 they cover basic tree concepts. It says there that a complete binary tree is a binary tree in which every level of the tree is fully filled, except for perhaps the last level. To the extent that the last level is filled, it is filled left to righ...
|terminology|trees|binary-trees|
The relationship between a perfect binary tree and a complete & full binary tree
If $A\to\epsilon ~or~ A\to.$ is the only $\epsilon$-production in $I_0$ state creates always shift-reduce conflict because $A\to\epsilon ~or~ A\to.$ is already reduced in $I_0$ state and any production like $A\to.a$ in $I_0$ creates shift-reduce conflict in initial state $I_0.$ If more than one $\epsilon$-product...
null
Your question is a loaded question. The example of the message digest doesn't prove that these functions do not exist. It only proves that there is no discernable system key from which to construct the entire message from the message digest. For example consider a system that uses check digits for license plates or soc...
I'm learning about computability problems e.g. reducing the general halting problem to the halting problem on a blank tape. But before I can understand this problem I first have to understand what exactly $M_w$, $M_w[\epsilon]$, and $M_w[w]$ are. I know the concept of encoding a Turing machine $M$ e.g. by generatin...
How should I imagine $M_w[\epsilon]\downarrow$ for the empty halting problem or $M_w[0]\downarrow$
|turing-machines|computability|halting-problem|