instruction stringlengths 0 29.8k ⌀ |
|---|
I have read some complexity papers in which "for infinitely many input sizes" is used.
What is the difference in the computational complexity context between "for infinitely many input sizes" and "for all input sizes"?
Thanks... |
What is the difference between "for infinitely many input sizes" and for all n? |
|complexity-theory|terminology| |
I have recently become extremely interested in understanding and proving aspects of (functional) programming languages.
However as I dive deeper in, things like $\lambda$ calculus, category theory, and denotational semantics are a little difficult to grok without proper explanation.
I read SICP (quite an enlighte... |
null |
Between my textbook and various online sources (namely wikipedia), I'm very confused... can somebody clear up which words are synonymous and which mean different things?
- Many-to-one reduction
- Mapping reduction
- Turing reduction
- Cook reduction
- Karp reduction
- Polynomial-time many-to-one reduction
- Po... |
What is the difference between these terms? |
|terminology| |
Here is an example of a non-computable language $A$ such that $A^2 = \Sigma^*$. Take any non-computable $K$ (represented as a set of numbers, e.g. the codes of Turing machines that halt), and define
$$ A = \{ w \in \Sigma^* : |w| \neq 4^k \text{ for all } k \in K \}. $$
So $A$ contains all words other than ones of le... |
These books have high ratings and come up on different scientific communities:
- [Real-World Functional Programming: With Examples in F# and C#][1]
- [Introduction to Functional Programming][2]
[1]: http://www.amazon.com/Real-World-Functional-Programming-Tomas-Petricek/dp/1933988924/ref=sr_1_5?s=books&ie=U... |
I am trying to find out why $(log(n))^{99} = o(n^{\frac{1}{99}})$. I tried to find the limit as this fraction goes to zero.
$$
lim_{n \rightarrow \infty} \frac{ (log(n))^{99} }{n^{\frac{1}{99}}}
$$
But I'm not sure how I can reduce this expression. |
Why is $(log(n))^{99} = o(n^{\frac{1}{99}})$ |
|time-complexity| |
|terminology|reductions| |
Hint: take $99$th root of both sides. |
null |
$$
lim_{x \rightarrow \infty} \frac{ (log(x))^{99} }{x^{\frac{1}{99}}}=lim_{x \rightarrow \infty} \frac{ (99^2)(log(x))^{98} }{x^{\frac{1}{99}}}=lim_{x \rightarrow \infty} \frac{ (99^3)\times98(log(x))^{97} }{x^{\frac{1}{99}}}=....=0
$$
I used [L'Hôpital's rule][1] law in each conversion assuming natural logarithm... |
$$
lim_{x \rightarrow \infty} \frac{ (log(x))^{99} }{x^{\frac{1}{99}}}=lim_{x \rightarrow \infty} \frac{ (99^2)(log(x))^{98} }{x^{\frac{1}{99}}}=lim_{x \rightarrow \infty} \frac{ (99^3)\times98(log(x))^{97} }{x^{\frac{1}{99}}}=....=lim_{x \rightarrow \infty} \frac{ (99^{99})\times 99! }{x^{\frac{1}{99}}}=0
$$
I us... |
Let $A,B\subseteq \Sigma^*$ be languages.
Many-to-one: A (computable) function $f:\Sigma^*\to \Sigma^*$ such that $\forall x\in \Sigma^*$, $x\in A\iff f(x)\in B$.
The names "Mapping reduction" and "Karp reductions", to my knowledge, refer to "Many to one".
The "Many to one" means that $f$ may not be injective.
T... |
null |
Let $A,B\subseteq \Sigma^*$ be languages.
Many-to-one: A (computable) function $f:\Sigma^*\to \Sigma^*$ such that $\forall x\in \Sigma^*$, $x\in A\iff f(x)\in B$.
The names "Mapping reduction" and "Karp reductions", to my knowledge, refer to "Many to one".
The "Many to one" means that $f$ may not be injective.
... |
Between my textbook and various online sources (namely wikipedia), I'm very confused... can somebody clear up which words are synonymous and which mean different things?
- Many-to-one reduction
- Mapping reduction
- Turing reduction
- Cook reduction
- Karp reduction
- Polynomial-time many-to-one reduction
- Po... |
|complexity-theory|computability|terminology|reductions| |
|asymptotics|landau-notation| |
Try a common trick: express both functions as $e^{\dots}$ and compare the exponents; if *their* ratio tends to $0$ or $\infty$, so does the original quotient (since $e(x)$ is monotone).
>! $\frac{(\log n)^{99}}{n^{\frac{1}{99}}} = \frac{e^{99 \cdot \log(\log n)}}{e^{\frac{1}{99} \cdot \log n}}$ |
$\qquad \begin{align}
\lim_{x \to \infty} \frac{ (\log(x))^{99} }{x^{\frac{1}{99}}}
&= \lim_{x \to \infty} \frac{ (99^2)(\log(x))^{98} }{x^{\frac{1}{99}}} \\
&= \lim_{x \to \infty} \frac{ (99^3) \times 98(\log(x))^{97} }{x^{\frac{1}{99}}} \\
&\vdots \\
&= \lim_{x \to \infty} \frac{ (99^{99})\times 99! }{x^{\frac... |
I am trying to find out why $(\log(n))^{99} = o(n^{\frac{1}{99}})$. I tried to find the limit as this fraction goes to zero.
$$
\lim_{n \to \infty} \frac{ (\log(n))^{99} }{n^{\frac{1}{99}}}
$$
But I'm not sure how I can reduce this expression. |
|asymptotics|landau-notation| |
Try a common trick: express both functions as $e^{\dots}$ and compare the exponents; if *their* ratio tends to $0$ or $\infty$, so does the original quotient (since $e^x$ is monotone).
>! $\frac{(\log n)^{99}}{n^{\frac{1}{99}}} = \frac{e^{99 \cdot \log(\log n)}}{e^{\frac{1}{99} \cdot \log n}}$ |
If you want rigorous proof, the following lemma is often useful resp. more handy than the definitions.
> If $c = \lim_{n\to\infty} \frac{f(n)}{g(n)}$ exists, then
> * $c=0 \qquad \quad\ \,\implies f \in o(g)$
> * $c \in (0,\infty) \quad \implies f \in \Theta(g)$
> * $c=\infty \qquad \ \ \ \implies f \in \omega(... |
Assume I have a list of functions, for example
$\qquad n^{\log \log(n)}, 2^n, n!, n^3, n \ln n, \dots$
How do I sort them asymptotically, i.e. after the relation defined by
$\qquad f \leq_O g \iff f \in O(g)$,
assuming they are indeed pairwise comparable (see also [here](http://cs.stackexchange.com/questi... |
If you want rigorous proof, the following lemma is often useful resp. more handy than the definitions.
> If $c = \lim_{n\to\infty} \frac{f(n)}{g(n)}$ exists, then
> * $c=0 \qquad \quad\ \,\implies f \in o(g)$
> * $c \in (0,\infty) \quad \implies f \in \Theta(g)$
> * $c=\infty \qquad \ \ \ \implies f \in \omega(... |
Sorting functions by asymptotic growth |
Is $A$ regular if $A^{2}$ is regular? |
I have read some complexity papers in which "for infinitely many input sizes" is used.
What is the difference in the computational complexity context between "for infinitely many input sizes" and "for all input sizes"? |
What is the difference between "for infinitely many n" and "for all n"? |
Can I use principles of set theory in order to solve the following question?
> For every $A,B$ that belong to $\mathsf{co\text{-}RE}$, there is a separating language $C$ with $A \subseteq C$ and $B \cap C = \emptyset$ so that $C$ is recursive. |
Are co-semidecidable languages separated by decidable ones? |
|computability| |
It depends on which part of your question you put the emphasis. If it is specifically the property of being anonymous for anonymous functions, then indeed the only answer is that they are unbound _values_. If you are talking about functions in general, anonymous functions are probably the most visible manifestation of... |
null |
In Corman, Introduction To Algorithms, 3rd edition, question 2-4 it asks to count the number of inversions in a list of numbers in $\theta( n \lg n )$ time. He uses a modified Merge Sort to accomplish this. However, there is something in his algorithm which seems redundant / unnecessary to me:
MERGE-INVERSIONS... |
Counting Inversions Using Merge Sort |
|algorithms| |
In Corman, Introduction To Algorithms, 3rd edition, question 2-4 it asks to count the number of inversions in a list of numbers in $\theta( n \lg n )$ time. He uses a modified Merge Sort to accomplish this. However, there is something in his algorithm which seems redundant / unnecessary to me:
MERGE-INVERSIONS... |
"For infinitely many input sizes" makes sense in many contexts. For example, when considering the running time of a TM, it may be the case that for all odd-sized inputs, the machine trivially rejects (e.g. if it's an illegal encoding of an instance). In this case, the runtime of a machine can be long only for even size... |
|algorithms|algorithm-analysis|sorting|program-correctness| |
This is a classical exercise in computability.
Since $A,B\in coRE$, there exist TMs $M,N$ that recognize $\overline{A}$ and $\overline{B}$ respectively.
Consider the following TM $K$:
Given a word $w$, run in parallel $M$ and $N$ on $w$. If $M$ accepts, reject. If $N$ accepts, accept.
(if both accept, reject).
... |
We can show that after every iteration of the `for`-loop in question, `counted` is `FALSE`. Therefore, `inversions = inversions + n1 - i + 1` is executed if and only if `j++` is executed in the same iteration (both are guarded by `R[j] < L[i]`). Since neither `i` nor `j` is changed between evaluation of the two `if` co... |
null |
We are given the following language
B = {$<M,i>$ : M is a turing machine and $i \in \mathcal{N}$ and M accepts some string in atmost $i$ steps }
Is language B decidable ?
As per a hint from another fellow user, I decided to construct the following decider for B. Call it D.
D = On input <M,i>
1. En... |
Is this a correct decider? |
|undecidability| |
Why is $(\log(n))^{99} = o(n^{\frac{1}{99}})$ |
null |
Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k.$
> Is there a set $S \subseteq V(G)$ such that $G-s$ is bipartite and $|S| \leq k$?
I would like to show that this problem is in $\rm{NP}$ by reducing it either to 3-SAT, the k-CLIQUE problem or the k-DOMINATIG SET... |
Detecting if the removal of some vertices from a graph to obtain a bipartite graph is NP |
|complexity-theory|np-complete|reductions|np| |
Detecting if the removal of some vertices from a graph gives a bipartite graph is NP |
Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k.$
> Is there a set $S \subseteq V(G)$ such that $G-s$ is bipartite and $|S| \leq k$?
I would like to show that this problem is in $\rm{NP}$ by reducing it either to 3-SAT, the k-CLIQUE problem or the k-DOMINATIG SET... |
We know that at the end computation should be done by physical systems which follow laws of physics. I know there are some researches that study the [phase transition][1] phenomenon in physics and try to connect it with some properties in complexity theory (such as P and NP famous problem ). Just a quick review for exa... |
Polynomial Hierarchy and its Relation to Multi-Phase/States Physical Systems |
|complexity-theory|computability| |
This is a classical exercise in computability.
Since $A,B\in coRE$, there exist TMs $M,N$ that recognize $\overline{A}$ and $\overline{B}$ respectively.
Consider the following TM $K$:
Given a word $w$, run in parallel $M$ and $N$ on $w$. That is, simulate $M$ for a single step, and then $N$ for a single step, and... |
Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k.$
> Is there a set $S \subseteq V(G)$ such that $G-s$ is bipartite and $|S| \leq k$?
I would like to show that this problem is in $\rm{NP}$ by reducing it either to 3-SAT, the k-CLIQUE problem or the k-DOMINATING SE... |
Detecting if the removal of some vertices from a graph gives a bipartite graph is in NP |
null |
Your problem is a special case of a broader class of problems named *node-deletion problems*:
[J. M. Lewis and M. Yannakakis, "The node-deletion problem for hereditary properties is NP-complete" ][1]
... This paper deals with the class of graph problems defined as follows:<br>
for a fixed graph property $\Pi$, ... |
Your problem is a special case of a broader class of problems named *node-deletion problems*:
[J. M. Lewis and M. Yannakakis, "The node-deletion problem for hereditary properties is NP-complete" ][1]
... This paper deals with the class of graph problems defined as follows:<br>
for a fixed graph property $\Pi$, ... |
When minimizing the full adder, I don't understand why $A(\bar{B}\bar{C} + BC)$ reduces to $A(\overline{B\overline{\vee}C}).$
$(\bar{B}\bar{C} + BC)\to (B\overline{\vee}C)$ is partially decipherable, but why is $(B\overline{\vee}C)$ inverted to $(\overline{B\overline{\vee}C})?$
---
Full adder simplification:
... |
Minimizing the full adder - where did this XOR come from? |
|binary-arithmetic|xor| |
Take any nonregular $X \subseteq {1}^\ast$ and define $A=\{1\} \cup \{1^{2x}:x \in \mathbb N\} \cup \{1^{2x+1}:1^x \in X\}$.
It is easy to see $A$ is nonregular, while $A^2=1^{\ast}$. |
When minimizing the full adder, I don't understand why $A(\bar{B}\bar{C} + BC)$ reduces to $A\overline{(B\oplus{C})}.$
$(\bar{B}\bar{C} + BC)\to (B\oplus{C})$ is partially decipherable, but why is $(B\oplus{C})$ inverted to $\overline{(B\oplus{C})}?$
---
Full adder simplification:
$
\bar{A}\bar{B}C + \bar{... |
Consider the truth table for $(\overline{B}\overline{C}+BC)$. It has 1's exactly when $B$ and $C$ get the same value, which is exactly when $(B\oplus C)$ gets 0, hence, $\overline{B\oplus C}$ is equivalent to $(\overline{B}\overline{C}+BC)$. |
Hint 1: Intuitively, $\oplus$ implies exactly one of the two inputs is $1$ ($B$ and $C$ here). Whereas, $(\bar{B}\bar{C} + BC)$ implies *both* inputs are $0$ or both are $1$.
Hint 2: Start from $\overline{(B \oplus C)}$, expand it, use [De'Morgan's laws][1], simplify and you should reach $(\bar{B}\bar{C} + BC)$.
... |
The thing you are trying to prove is called the "separation principle" for $\Pi^0_1$ sets (remember co-r.e. sets are $\Pi^0_1$ and r.e. sets are $\Sigma^0_1$ in the arithmetical hierarchy).
The dual "reduction principle" for $\Sigma^0_1$ sets states that given two $\Sigma^0_1$ sets $X,Y$ whose union is $\mathbb{N}$... |
_Following the article's notation, I write $\mathcal{F}$ for the
category of presheaves on a (suitable) category $\mathbb{F}$, $TV$ for the
presheaf of terms, $\delta$ for the context extension, and
$\bullet$ for the product of the $\mathcal{F}$-monoid._
In <a href="http://www.dcs.ed.ac.uk/home/dt/abstractsyn.h... |
Substitution by structural recursion |
|lambda-calculus|category-theory| |
A more tutorial-paced presentation of the same/related material is available in:
[Roy L. Crole: Basic Category Theory for Models of Syntax. Generic Programming 2003: 133-177][1]. This should help.
[1]: http://www.cs.le.ac.uk/people/rcrole/papers/bctms2006.pdf |
Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k.$
> Is there a set $S \subseteq V(G)$ such that $G-s$ is bipartite and $|S| \leq k$?
I would like to show that this problem is in $\rm{NP}$ by reducing it either to 3-SAT, the k-CLIQUE problem the k-DOMINATING SET o... |
null |
Consider the following problem whose input instance is a simple graph $G$ and a natural integer $k$.
> Is there a set $S \subseteq V(G)$ such that $G - S$ is bipartite and $|S| \leq k$?
I would like to show that this problem is $\rm{NP}$-complete by reducing either 3-SAT, $k$-CLIQUE, $k$-DOMINATING SET or $k$-VER... |
Showing that minimal vertex deletion to a bipartite graph is NP-complete |
|complexity-theory|np-complete|reductions| |
{"Voters":[{"Id":6577,"DisplayName":"KJ."}]} |
{"Voters":[{"Id":6577,"DisplayName":"KJ."}]} |
Given a $n \times n$ matrix $\mathbf{A}$. Let the inverse matrix of $\mathbf{A}$ be $\mathbf{A}^{-1}$ (that is, $\mathbf{A}\mathbf{A}^{-1} = \mathbf{I}$). Assume that one element in $\mathbf{A}$ is changed (let's say $a _{ij}$ to $a' _{ij}$). The objective is to find $\mathbf{A}^{-1}$ after this change. Is there a meth... |
Computing Inverse Matrix when an element change |
|algorithms|numerical-analysis|online-algorithms| |
These books have high ratings and come up on different scientific communities:
[Type Theory and Functional Programming by Simon Thompson.][1]
[Structure and Interpretation of Computer Programs][2]
[1]: http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/
[2]: http://mitpress.mit.edu/sicp/ |
Suppose I am using the [Bucket-Sort][1] algorithm and on each bucket/list I sort with insertion sort (replace nextSort with insertion sort in the wikipedia psuedocode).
In the worst case, this would imply that we would have $O(n^2)$ performance because if every element was in one bucket than we would have to use ins... |
Worst Case Analysis of Bucket Sort using insertion sort for the buckets |
|algorithms|algorithm-analysis|runtime-analysis|sorting| |
null |
Given a $n \times n$ matrix $\mathbf{A}$. Let the inverse matrix of $\mathbf{A}$ be $\mathbf{A}^{-1}$ (that is, $\mathbf{A}\mathbf{A}^{-1} = \mathbf{I}$). Assume that one element in $\mathbf{A}$ is changed (let's say $a _{ij}$ to $a' _{ij}$). The objective is to find $\mathbf{A}^{-1}$ after this change. Is there a meth... |
The solution in the question is correct. |
The solution in the question is correct.
As the comments say, with $i$ steps any TM can check only inputs of length at most $i$. There is infinite number of thiose, which can be checked on by one by running $i$ steps on each.
|
Your protocol is not very clear. What do you mean at step 3 by "it chooses one variable, re-computes the formula"?
I assume the verifier just set that variable to 1 and re-computes the formula without that variable.
Then, this protocol still have some problems. Let say that there are two sets of variables that s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.