instruction stringlengths 0 29.8k ⌀ |
|---|
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
* generate one or more points on the surface given the values on the matrix,
* make this or those point as big as the value can be.
F... |
How to correlate a matrix of values to get a coordinated point? |
|algorithms|matrices| |
This is my idea for a proof although I am not quite sure whether it works:
Consider $r$, the number of symbols on all right-hand sides and $n$, the number of distinct nonterminals. Each grammar has a specific tuple $(r-n,n)$. Let's define an order on grammars. We first sort by $r-n$ and in case the values are equal ... |
null |
we know that the clique-problem is NP-complete. Is the restriction of the problem to bipartite graphs or planar graphs still NP-complete?
Thanks! |
Clique np complete also with a bipartite graph or an planar graph |
|graphs|np-complete| |
For planar graphs, the problem is in $\mathsf{P}$. For an algorithm, see [Norishige Chiba and Takao Nishizeki, Arboricity and Subgraph Listing Algorithms, SIAM Journal on Computing 14(1): 210–223, 1985](http://epubs.siam.org/doi/abs/10.1137/0214017). |
In a bipartite graph there can be no clique of size three. Not much of a problem that is left I guess? |
We know that the clique problem is NP-complete. Is the restriction of the problem to bipartite graphs or planar graphs still NP-complete? |
Is the clique problem NP-complete also on bipartite or planar graphs? |
In a bipartite graph there can be no clique of size three. Not much of a problem that is left I guess?
(edit) Sorry, that was too fast, I realize thanks to comment by Nicholas below. To make up for it I googled a reference.
The maximum edge biclique problem is NP-complete by Ren*e Peeters. Discrete Applied Mathem... |
|complexity-theory|graphs|np-complete| |
In a bipartite graph there can be no clique of size three. Not much of a problem that is left I guess?
(edit) Sorry, that was too fast, I realize thanks to comment by Nicholas below. To make up for it I googled a reference.
The maximum edge biclique problem is NP-complete by Ren*e Peeters. Discrete Applied Mathem... |
For planar graphs, the problem is in $\mathsf{P}$. This follows already from [Kuratowski's theorem](http://en.wikipedia.org/wiki/Kuratowski%27s_theorem#Kuratowski.27s_and_Wagner.27s_theorems): a clique is at most of size 4. The naive algorithm can just check every combination.
For a more clever algorithm, see [Noris... |
null |
null |
I am confused, according to some sources such as http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/binarySearchTree.htm
the time complexity of calling a successor function is O(h), so if it was a well balanced tree it is O(logn). Then according to this http://stackoverflow.com/questions/12447499/time-co... |
what is the time complexity of calling successor n times? |
|binary-trees|search-trees| |
null |
I am working on problem (15-11) Inventory planning from *Introduction to Algorithms* (3rd Ed).
15-11: Inventory Planning, p.411
The Rinky Dink Company makes machines that resurface ice rinks. The demand for such products varies from month to month, and so the company needs to develop a strategy to plan its manufa... |
Inventory planning problem solved through dynamic programming |
|dynamic-programming| |
I am working on problem (15-11) Inventory planning from *Introduction to Algorithms* (3rd Ed).
15-11: Inventory Planning, p.411
The Rinky Dink Company makes machines that resurface ice rinks. The demand for such products varies from month to month, and so the company needs to develop a strategy to plan its manufa... |
other answers are valid, just want to add one that emphasizes this is really a very deep (largely still open/unresolved) question at the heart of much modern research into complexity class separations and quantum vs classical computing. they are _functionally_ equivalent as far as TMs and QM computers are both proven [... |
I am confused, according to some sources such as [this](http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/binarySearchTree.htm), the time complexity of calling a successor function is `O(h)`. So, if it was a well balanced tree it is `O(logn)`.
Then according to [this](http://stackoverflow.com/questions/1... |
null |
null |
The data structure you are looking for is called a range tree. Range trees are usually used for geometric data, but they can be used here as well. In 1d, a range tree is simply a balanced binary search tree with the data stored at the leaves and the internal nodes augmented with the min and max element stored in the su... |
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
* generate one or more points on the surface given the values on the matrix,
* make this or those point as big as the value can be.
F... |
I'm writing a JavaScript library for calculating graph measurements such as degree centrality, eccentrality, closeness and betweenness.
In order to validate my library I use two exist applications [Gephi][1] and [NodeXL][2] to run calculation with them.
The problem is I got what looks like different results.
I b... |
Graph Closeness - Different result with gephi and NodeXL |
|graphs| |
Gist: **The time complexity of calling the sucessor function multiple times is not merely the product of the worst case**. Rather, if it's going to be called from every node, then the expected case is going to be far more useful! Simply multiply the expected case by the number of calls to get the precise total number o... |
According to some [sources](http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/binarySearchTree.htm), the time complexity of finding the successor of a node in a tree is $O(h)$. So, if the tree is well balanced, the height $h=\log n$, and the successor function takes time $O(\log n)$.
Yet, according to th... |
What is the time complexity of calling successor $n$ times during tree traversal? |
null |
The **closeness** of a node in a graph is defined as the reciprocal of the sum of all distances to other nodes.
Since your example is completely symmetric, we only calculate the closeness centrality of $A$.
* distance $A\to B$ is 1
* distance $A\to C$ is 1
* distance $A\to D$ is 2
Therefore the sum of the di... |
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
* generate one or more points on the surface given the values on the matrix,
* make this or those point as big as the value can be.
F... |
null |
Firstly little Introduction : I learned that there is no more "power" for turing machine with multiple tapes against turing machine with single tape .lets say k tape turing machine called $ MT_k $ and single tape turing machine called $ MT $
The proof of $$ MT_k \equiv MT$$ based on the idea that define a unique... |
multiple tapes turing machine against single tape turing machine |
|time-complexity|turing-machines| |
We throw two coins in a row and thus get the event space $\{ZZ, WW, ZW, WZ\}$.
Each of the 4 elementary events has a probability $1/4$.
how can I construct 3 binary random variable $x_1$, $x_2$, $x_3$ about this event space, which are 2-fold independent, but not independent. |
Construction of binary random variable |
|probability-theory|random-number-generator| |
Look at the original paper by Hennie and Stearns:
[F.C. Hennie and R.E. Stearns, "Two-Tape Simulation of Multitape Turing Machines"][1], Journal of the ACM (JACM), Volume 13 Issue 4, Oct. 1966, pp. 533-546
The construction is a little bit elaborate, but not extremely difficult to understand. If you need further h... |
Multitape Turing machines against single tape Turing machines |
Look at the original paper by Hennie and Stearns:
[F.C. Hennie and R.E. Stearns, "Two-Tape Simulation of Multitape Turing Machines"][1], Journal of the ACM (JACM), Volume 13 Issue 4, Oct. 1966, pp. 533-546
The construction is a little bit elaborate, but not extremely difficult to understand. The basic idea is to ... |
|algorithms|dynamic-programming|check-my-algorithm| |
I am working on problem (15-11) Inventory planning from *Introduction to Algorithms* (CLRS, 3rd Ed).
> **15-11: Inventory Planning, p.411**
> The Rinky Dink Company makes machines that resurface ice rinks. The demand for such products varies from month to month, and so the company needs to develop a strategy to p... |
CLRS give plenty of implementations in their chapter on dynamic programming, e.g. in the section on Rod cutting
* recursive top-down (p363),
* memoized (p365f) and
* bottom-up (p366).
I suggest you try to adapt one of these. |
|graphs|terminology| |
|probability-theory| |
|time-complexity|turing-machines|simulation| |
Given $w_1,\ldots,w_n,t$, let $X$ be the set of assignments such that $\sum_i w_i x_i \geq t$, and consider the linear program with variables $z_1,\ldots,z_n$ and the $2^n$ constraints
$$
\begin{align*}
\sum_i z_i x_i \geq +1 & (x_1,\ldots,x_n) \in X \\
\sum_i z_i x_i \leq -1 & (x_1,\ldots,x_n) \notin X
\end{align... |
I wonder what relations are between [the knapsack problem][1], [the bin packing problem][2] and [the set packing problem][3]?
From their mathematical formulations, I don't see the first two belong to the third one i.e. the set packing problem, although I feel the third one sounds more general than the other two.
... |
Relations between the knapsack problem, the bin packing problem, and the set packing problem? |
|knapsack-problems|packing| |
Gist: **The time complexity of calling the sucessor function multiple times is not merely the product of the number of calls and the worst-case bound**, though that product does encompass the worst case. Rather, if the function going to be called from every node, a more sophisticated analysis can establish a tighter wo... |
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
* generate one or more points on the surface given the values on the matrix,
* make this or those point as big as the value can be.
F... |
The probabilistic method is typically used to show that the probability of *some* random object having a certain property is non-zero, but doesn't exhibit any examples. It does guarantee that a "repeat-until-success" algorithm will eventually terminate, but does not give an upper bound on the runtime. So unless the pro... |
_Introduction_: I recently learned that a multi-tape Turing Machine $TM_k$ is no more "powerful" than a single tape Turing machine $TM$. The proof that $ TM_k \equiv TM$ is based on the idea that a $TM$ can simulate a $TM_k$ by using a unique character to separate the respective areas of each of the $k$ tapes.
Giv... |
null |
_Introduction_: I recently learned that a multi-tape Turing Machine $\text{TM}_k$ is no more "powerful" than a single tape Turing machine $\text{TM}$. The proof that $\text{TM}_k \equiv \text{TM}$ is based on the idea that a $\text{TM}$ can simulate a $\text{TM}_k$ by using a unique character to separate the respecti... |
|probability-theory|sampling| |
Not sure what you mean, but here is an idea.
First you have to express $p_3$ as a linear combination of $p_1$ and $p_2$. This can be done by solving a linear system say
$$
\lambda p_1 +\mu p_2 =p_3.
$$
In your case you want to solve
$$
\begin{align}
\lambda + 4\mu &= 2 \\
3\lambda + 4\mu &= 3
\end{align... |
How can one formally prove
$L \cdot L^{*} = L^{+}$
It looks obvious to me since with the concatenation you get rid of $\varepsilon$, but I cannot think of a formal proof through induction or something. |
How to prove $L \cdot L^{*} = L^{+}$ |
|formal-languages|regular-languages| |
Does anybody know a good definition of 2 decision / optimization problems being equivalent?
I am asking since for example allowing polynomial time computations any 2 problems in NP could be considered equivalent.
|
Equivalent problems |
|optimization|decision-problem| |
null |
Suppose $L_1$ and $L_2$ are two decision problems, and $\mathcal{A}$ is a class of algorithms (like $P$). Say that $L_1$ is $\mathcal{A}$-reducible to $L_2$ if there is an $f \in \mathcal{A}$ such that $x \in L_1$ iff $f(x) \in L_2$. Say that $L_1$ and $L_2$ are $\mathcal{A}$-equivalent if each is $\mathcal{A}$-reducib... |
For each node $v$ with height 1 (all its children are leaves): If $v$ has degree $d$ and $d - 1$ children, then the $d-2$ smallest edges are added to the cut. These cuts are required to separate the children of $v$ from each other. Now, all but one child (leaf) of $v$ has been separated from the rest of the tree.
N... |
null |
Let $E = \{ZZ,WW,ZW,WZ\}$. A *binary random variable* is a mapping $X\colon E \rightarrow \{0,1\}$. The *probability* of an event, say $X=0$, is defined as
$$ \Pr[X = 0] =\frac{|\{e \in E : X(e) = 0\}|}{4}. $$
For example, let $C_1(ZZ)=C_1(ZW) = 0$, $C_1(WZ)=C_1(WW) = 1$. Then $\Pr[C_1=0]=1/2$.
Two (binary) random... |
When are 2 decision/optimization problems equivalent? |
null |
The following equation is a matrix expression where $B_i$ and $C_i^T$ are $n\times n$ matrices and k is a positive integer:
$$P = \sum_{i=1}^k B_i C_i^T $$
So $P = B_1 C_1^T + B_2 C_2^T + \cdots +B_k C_k^T $
If $B_i $ and $C_i$ are $n\times n$ matrices themselves, we have a total of 2 $\times$ k matrices t... |
I can not understand the following equality $$\langle ij|(|0\rangle \langle 0|\otimes I)kl \rangle= \langle i|0\rangle \langle 0|k \rangle \langle j|I|l \rangle?$$
Also to estimate phase $\phi$ in Nielsen & Chuang book, I can not understand why
$(|0 \rangle + e^{2\pi i 2^{t-1}\phi} |1 \rangle)(|0 \rangle + e^{2... |
To summarize the comments.
A. Sometimes $L^+$ is **defined** to be $L\circ L^*$, where '$\circ$' is the concatenations operator.
B. Assume the following definitions,
> $L^* \equiv \{\varepsilon\} \cup L \cup L^2 \cup \cdots$
> $L^+\equiv L \cup L^2 \cup \cdots$
Then, by the properties of the concatenation... |
null |
Ycbcr just has one component (y) for luminance and two for chrominance and it is less light variation sensitive than HSI, and for face detection Ycbcr comes to better result
|
Show that $L_2=\{a^nb^k|n\not= k-1\}$ is not regular by Pumping Lemma. |
Show that a language is not regular by Pumping Lemma |
|formal-languages|automata|regular-languages|pumping-lemma| |
> **Possible Duplicate:**
> [How to prove that a language is not regular?](http://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular)
<!-- End of automatically inserted text -->
Show that $L_2=\{a^nb^k|n\not= k-1\}$ is not regular by Pumping Lemma. |
{"OriginalQuestionIds":[1031],"Voters":[{"Id":98,"DisplayName":"Raphael"}]} |
null |
I got a n*m matrix updated in realtime (i.e. about every 10ms) with values between 0 and 1024, and I want to work out from that matrix a multitouch trackpad behaviour, which is:
* generate one or more points on the surface given the values on the matrix,
* make this or those point as big as the value can be.
F... |
|complexity-theory|terminology|undecidability| |
null |
|algorithms|time-complexity|dynamic-programming|efficiency|scheduling| |
Use a dynamic programming algorithm that answers the question: suppose you wish to schedule $j$ out of the first $k$ jobs. What is the earliest time you can complete processing these? |
null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.