instruction
stringlengths
0
29.8k
⌀
I think it is impossible to figure out one-way latency just by comparing stopwatches. $A$ sends $B$ his clock $C_{A1}$, let's say its value is 5. $B$ acknowledges the message at time $C_{B1}=1$ $A$ sends his clock again, $C_{A2}=9$ (initial + round-trip latency). $B$ receives at time $C_{B2}=5$. And so ...
null
null
There are two possible bugs in this proof: 1. When you say "decider" - you mean a deterministic TM. In this case, the best translation (to our knowledge) from an NP machine to a deterministic machine may yield a machine that runs in exponential time, so after complementing you will have a decider for the complement ...
I have this very simple "proof" for NP = CoNP and I think I did something wrongly somewhere, but I cannot find what is wrong. Can someone help me out? Let A be some problem in NP, and let M be the decider for A. Let B be the complement ie B is in CoNP. Since M is a decider, you can use it to decide B as well (just f...
Flaw in my NP = CoNP Proof?
|complexity-theory|
null
null
null
null
If there is no resource bound for the reduction and you want to reduce problem A to problem B then there is a trivial "reduction" algorithm for any computable A - simply compute the answer for problem A.
In order to fully understand this, think about the purpose of reductions. Ideally, given a language (or problem) $L$, you would design an algorithm deciding $L$ and prove that no other algorithm can do better than your algorithm. The latter part implies proving a lower bound for the problem $L$. Designing an algorithm ...
A decision problem is NP-complete if it is in NP and all other problems in NP can be reduced to it by a reduction that runs in polynomial time. Why it is important to require that the reduction runs in polynomial time, as opposed to accepting any computable reduction.
NP-complete and polynomial time reduction
|np-complete|
I have some questions regarding local search / optimization as explained in chapter 4 of the book : http://aima.cs.berkeley.edu/ In classical search (Chap 3), the search starts from an initial node, then the search continues based on strategies of BFS, DFS, etc. What I am unsure of is the process of local search (Ch...
Local Search vs Classical Search
|artificial-intelligence|search-algorithms|
There are two possible bugs in this proof: 1. When you say "decider" - you mean a deterministic TM. In this case, the best translation (to our knowledge) from an NP machine to a deterministic machine may yield a machine that runs in exponential time, so after complementing you will have a decider for the complement ...
That depends on context. In theoretical computer science, usually every polynomial time algorithm is considered 'efficient'. In approximation algorithms for example a runtime of $n^{1/\epsilon^{1/\epsilon}}$ would be considered efficient, even though it won't be usable in practice for any reasonable value of $\epsilon$...
Here's another way of looking at the point that Shaull makes with respect to "deciders". A problem is in **NP** if and only if there is an algorithm $V: \{0,1\}^n \times \{0,1\}^{\mathrm{poly}(n)} \to \{0,1\}$ such that * for every YES instance $x \in \{0,1\}^n$, there is a certificate $p \in \{0,1\}^{\mathrm{po...
Given any graph $G$ on $V(G)=\{1,\dots,n\}$ and its adjacency matrix $$A(G)=\left(\matrix{ A_{1,1} & A_{1,2} & \dots & A_{1,n}\\ A_{2,1} & A_{2,2} & \dots & A_{2,n}\\ &&\dots&\\ A_{n,1} & A_{n,2} & \dots & A_{n,n} }\right)$$ any permutation on $\{1,\dots,n\}$ defines a new isomorphic graph $G'$. A common approa...
Complexity of computing the first bits of a minimal permuted adjacency matrix
|complexity-theory|graphs|graph-isomorphism|
Given any graph $G$ on $V(G)=\{1,\dots,n\}$ and its adjacency matrix $$A(G)=\left(\matrix{ A_{1,1} & A_{1,2} & \dots & A_{1,n}\\ A_{2,1} & A_{2,2} & \dots & A_{2,n}\\ &&\dots&\\ A_{n,1} & A_{n,2} & \dots & A_{n,n} }\right)$$ any permutation on $\{1,\dots,n\}$ defines a new isomorphic graph $G'$. A common approa...
Given any graph $G$ on $V(G)=\{1,\dots,n\}$ and its adjacency matrix $$A(G)=\left(\matrix{ A_{1,1} & A_{1,2} & \dots & A_{1,n}\\ A_{2,1} & A_{2,2} & \dots & A_{2,n}\\ &&\dots&\\ A_{n,1} & A_{n,2} & \dots & A_{n,n} }\right)$$ any permutation on $\{1,\dots,n\}$ defines a new isomorphic graph $G'$. A common approa...
null
I've been looking into the math behind converting from any base to any base. This is more about confirming my results than anything. I found what seems to be my answer on mathforum.org but I'm still not sure if I have it right. I have the converting from a larger base to a smaller base down okay because it is simply t...
I think the best way to understand this is in discussion with an alien (at least as an analogy). **Definition** *$x$ is a number in base $b$* means that $x$ is a string of digits $<b$. **Examples** The string of digits 10010011011 is a number in base 2, the string 68416841531 is a number in base 10, BADCAFE is ...
I've been looking into the math behind converting from any base to any base. This is more about confirming my results than anything. I found what seems to be my answer on mathforum.org but I'm still not sure if I have it right. I have the converting from a larger base to a smaller base down okay because it is simply t...
I have a set of observations of real data, and a set of Random Variables I produce my self. The goal is to generated Random Variables with the same Distribution as the real data. To investigate the simliarity the two distributions, I use the Kullback-Leibler Divergence. Now with the genetic algorithm of Matlab, I try t...
Stochasticity of Genetic Algorithm
|genetic-algorithms|
I think the best way to understand this is in discussion with an alien (at least as an analogy). **Definition** *$x$ is a number in base $b$* means that $x$ is a string of digits $<b$. **Examples** The string of digits 10010011011 is a number in base 2, the string 68416841531 is a number in base 10, BADCAFE is a ...
null
Mapreduce does not seem to have received significant academic attention and/or widespread enthusiasm nor does it seem to have yet been integrated into much of the large previously-existing literature and theory on parallelism. this is partly due to it being relatively new, but there may be other reasons. one possibl...
Mapreduce does not seem to have received significant academic attention and/or widespread enthusiasm nor does it seem to have yet been integrated into much of the large previously-existing literature and theory on parallelism. this is partly due to it being relatively new, but there may be other reasons. one possibl...
I think the best way to understand this is in discussion with an alien (at least as an analogy). **Definition** *$x$ is a number in base $b$* means that $x$ is a string of digits $<b$. **Examples** The string of digits 10010011011 is a number in base 2, the string 68416841531 is a number in base 10, BADCAFE is a ...
Mapreduce does not seem to have received significant academic attention and/or widespread enthusiasm nor does it seem to have yet been integrated into much of the large previously-existing literature and theory on parallelism. this is partly due to it being relatively new, but there may be other reasons. one possibl...
Mapreduce does not seem to have received significant academic attention and/or widespread enthusiasm nor does it seem to have yet been integrated into much of the large previously-existing literature and theory on parallelism. this is partly due to it being relatively new, but there may be other reasons. one possibl...
If I have a hash table of 1000 slots, and I have an array of n numbers. I want to check if there are any repeats in the array of n numbers. The best way to do this that I can think of is storing it in the hash table and use a hash function which assumes simple uniform hashing assumption. Then before every insert you ju...
How to get expected running time of hash table?
|algorithms|algorithm-analysis|hash-tables|hash|probabilistic-algorithms|
Classical local search works as follows. We're trying to optimize some function under some constraints. We start with some feasible point (a point satisfying all constraints). At each step, we consider small changes to the current point which (1) keep it feasible, (2) improve the objective function. If we find such a s...
If you think of $1000$ as a constant, then yes, the running time is terrible. The idea of hash tables is that if the hash table is moderately bigger than the amount of data stored in it, then operations are very fast. Suppose for example that the hash table has size $m = 2n$. Then each operation takes constant time in ...
null
If I have a hash table of 1000 slots, and I have an array of n numbers. I want to check if there are any repeats in the array of n numbers. The best way to do this that I can think of is storing it in the hash table and use a hash function which assumes simple uniform hashing assumption. Then before every insert you ju...
How to get expected running time of hash table?
|algorithms|
Why not sort the array, then iterate over the sorted array, comparing the current number to the previous number. n*log(n) for the sort, n for the iteration = 2n*log(n)
null
I am looking for an example of the "iterative lengthening search". I have searched and I was only able to find definitions like > iterative lengthening search an iterative analog to uniform cost > search. The idea is to use increasing limits on path cost. If a node > is generated whose path cost exceeds the curr...
iterative lengthening search example
|artificial-intelligence|search-algorithms|
null
Your reasoning implies that RE=coRE, but this is provably false. You could try to figure out a proof of that and then see where your reduction fails. Recall that RE is the complexity class of recursively enumerable languages, which are languages of the form $\{ x : P \text{ halts on input } x \}$. You can also think...
A full binary tree seems to be a binary tree in which every node is either a leaf or has 2 children. I have been trying to prove that its height is O(logn) unsuccessfully. Here is my work so far: I am considering the worst case of a full binary tree in which each right node has a subtree, and each left node is a l...
Height of a full binary tree
|binary-trees|trees|
Your claim is incorrect (which might make it really hard to prove...) Indeed, as you describe, you can have a full binary tree of height $O(n)$: Let every right child be a leaf, and every left child have 2 children, until some level in which it has two leaf-children. It holds that $x-1\in \theta(2x-1)$, and in part...
null
|data-structures|runtime-analysis|average-case|
{"OriginalQuestionIds":[10498],"Voters":[{"Id":683,"DisplayName":"Yuval Filmus"},{"Id":157,"DisplayName":"Ran G."},{"Id":19,"DisplayName":"Nicholas Mancuso"},{"Id":1636,"DisplayName":"Luke Mathieson"},{"Id":98,"DisplayName":"Raphael"}]}
null
Suppose $\sigma$ is a vocabulary consisting of one binary relation $E$ and let $\phi$ be a $\sigma$ sentence. Is it decidable whether there is a finite directed graph $G$, with all in- and out-degrees $0$ or $1$, such that $G\models \phi$ ?
Decidability over finite graphs of small degree
|graphs|finite-model-theory|
null
Perhaps the simplest example would be to consider DFS as a search algorithm on graphs, but to use iterative lengthening as follows: the cost of each edge is 1, and the cost of a path is the sum over the edges. So we essentially use DFS while limiting the search depth. If you start from the limit 1 and increase, then...
|complexity-theory|p-vs-np|check-my-proof|np|
I have this very simple "proof" for NP = CoNP and I think I did something wrongly somewhere, but I cannot find what is wrong. Can someone help me out? Let A be some problem in NP, and let M be the decider for A. Let B be the complement, i.e. B is in CoNP. Since M is a decider, you can use it to decide B as well (jus...
Your claim is incorrect (which might make it really hard to prove...) Indeed, as you describe, you can have a full binary tree of height $O(n)$: Let every right child be a leaf, and every left child have 2 children, until some level in which it has two leaf-children. It holds that $x-1\in \theta(2x-1)$, and in part...
|graphs|combinatorics|binary-trees|trees|
A full binary tree seems to be a binary tree in which every node is either a leaf or has 2 children. I have been trying to prove that its height is O(logn) unsuccessfully. Here is my work so far: I am considering the worst case of a full binary tree in which each right node has a subtree, and each left node is a l...
{"Voters":[{"Id":98,"DisplayName":"Raphael"}]}
null
I've found in many exercises where I'm asked to show that $f(n)=\Theta(g(n))$ where the two functions are of the same order of magnitude I have difficulty finding a constant $c$ and a value $n_0$ for the lower bound. I'm using Corman's definition of $\Theta$: $$\exists c_1,c_2>0\in\mathbb{R}:\forall n\geq n_0: 0 \...
Methods for Finding Asymptotic Lower Bounds
|complexity-theory|landau-notation|
null
You can codify your method in the following lemma. Lemma. If $f(n)/g(n) \rightarrow C$, where $C > 0$, then $f(n) = \Theta(g(n))$. The proof is the same as the one you gave. After you prove this lemma once and for all, you can use it forever. That's actually a good way of verifying $f(n) = \Theta(g(n))$. Note ...
{"Voters":[{"Id":39,"DisplayName":"Gilles"}]}
Suppose $f(x)$ is a one way function. What about $h(x)=f(x_1) \, \oplus \,f(x_2)$, where $x=x_1 || x_2$ and $\lvert x_1 \rvert = \lvert x_2\rvert$? * $\oplus$ is exclusive disjunction (xor) * $||$ is concatenation * $|u|$ is the length of $u$
null
I went to listen to a workshop and some audience asked the presenter how the moments can improve the mutual information. I am learning the MI(Mutual Information) so didn't have enough knowledge to understand what it means. Then, I have done some research but still have some confusions. I am wondering if anyone has more...
Mutual information vs moment generating functions
|probability-theory|information-theory|bioinformatics|
null
I am wondering in general if it is correct to claim that **if a special case of a problem is NP-Hard, the general case of that problem is NP- Hard too?** For example: Min Set-Cover is NP-Hard does it imply without having to prove that Min Set-k-Cover where each element needs to be covered k times is NP-Hard too?
Does hardness of a special case imply hardness of a general case?
|untagged|
null
null
To show that a general problem $G=\{(w,k)\mid \text{Property}\}$ is NP-complete you need a polynomial time computable many-one reduction function $f$ from e.g. $S_l =\{w\mid (w,l) \in G\}$ to $G$. How could $f$ look like?
If frafl's answer doesn't give it away immediately, perhaps think in the reverse direction, if the special case is NP-hard, what would be implied by the general case being in P?
I'd like to start by stating this isn't homework! I'm studying for a job interview and would appreciate a second opinion. (Well, I guess it is homework, but not for school!). I've written an algorithm (see pseudocode below) to merge two *sorted* lists into one sorted list. The problem requires that I implement it as...
Is this a divide-and-conquer algorithm?
|algorithms|algorithm-analysis|divide-and-conquer|
I'd like to start by stating this isn't homework! I'm studying for a job interview and would appreciate a second opinion. (Well, I guess it is homework, but not for school!). I've written an algorithm (see pseudocode below) to merge two *sorted* lists into one sorted list. The problem requires that I implement it as...