instruction
stringlengths
0
29.8k
⌀
|time-complexity|
The answer is yes. A possible quick approach: UTM2($TM_i$,c,x) $\neq 0$ only on $|x| \leq c$ so you can build $TM_{\phi(i,c)}$ simply simulating $TM_i$ on all inputs and hard encoding its output on the finite input strings $|x| < c$, the index of the resulting TM is the value of $\phi(i,c)$ **EDIT2**: another app...
|time-complexity|asymptotics|landau-notation|
A non-deterministic Turing machine program $\mathcal{M}$ solves problems in two stages: (1) guess a candidate solution (certificate), (2) check that the guess is a solution. If it takes $\mathcal{O}(f(n))$ time to solve the problem, then the length of the certificate should be $\mathcal{O}(f(n))$ because you have to lo...
Consider an algorithm with some running time bounded by $f(n)$ and suppose that $f(n) \in O(1/n)$. That means that there is some constant $c$ such that for sufficiently large values of $n$, it holds that $$f(n) \leq c\frac{1}{n}.$$ Clearly, for any fixed $c$ and sufficiently large $n$, the right side will be strictly l...
A non-deterministic Turing machine program $\mathcal{M}$ solves problems in two stages: (1) guess a candidate solution (certificate), (2) check that the guess is a solution. If it takes $\mathcal{O}(f(n))$ time to solve the problem, then the length of the certificate should be $\mathcal{O}(f(n))$ because you have to lo...
Bucket sort's insertion sort step is O(1/n) on average. Reference - [CLRS][1] Section 8.4 BUCKET-SORT(A) 1 n ← length[A] 2 for i ← 1 to n 3 do insert A[i ] into list B[nA[i ]] 4 for i ← 0 to n − 1 5 do sort list B[i ] with insertion sort 6 concatenate the lists B[0], ...
By definition, all functions (even the trivial) must perform at least 1 operation. It is impossible to perform half of a step; computers are discrete machines, and work incrementally. As such, the complexity $\Omega(1)$ is the lower time bound of all computational operations. In addition, for any operation accepting an...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
null
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I've studied something about the [Kolmogorov Complexity](http://en.wikipedia.org/wiki/Kolmogorov_complexity), read some articles and books from [Vitanyi and Li](http://homepages.cwi.nl/~paulv/kolmogorov.html) and used the concept of [Normalized Compression Distance](http://complearn.org/ncd.html) to verify the stilomet...
Approximating the Kolmogorov complexity
|approximation|data-compression|kolmogorov-complexity|
null
|algorithms|time-complexity|asymptotics|landau-notation|
|complexity-theory|computability|turing-machines|
|computability|approximation|data-compression|kolmogorov-complexity|
#include <assert.h> #include <stdio.h> unsigned int should_still_count_next_time[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
My question is related to the [Integer Relation Detection Problem][1] which can be formulated as: $a_1x_1 + a_2x_2 + \cdots + a_nx_n = 0$ Where $\forall_{a_i} a_i\in\mathbb{Z},a_i<c$ and $\exists_{a_i} a_i\neq 0$, and $\forall_{x_i} x\in \mathbf{R}$. $c$ and vector $\mathbf{x}$ are given, and the problem is to fi...
Reduction from knapsack problem to Integer relation that equals one
|algorithms|complexity-theory|reductions|np-hard|knapsack-problems|
#include <assert.h> #include <stdio.h> unsigned int should_still_count_next_time[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
My question is related to the [Integer Relation Detection Problem][1] which can be formulated as: $a_1x_1 + a_2x_2 + \cdots + a_nx_n = 0$ Where $\forall_{a_i} a_i\in\mathbb{Z},a_i<c$ and $\exists_{a_i} a_i\neq 0$, and $\forall_{x_i} x\in \mathbb{R}$. $c$ and vector $\mathbf{x}$ are given, and the problem is to fi...
Introduction to algorithms, 3rd edition has an example of how to solve recurrence $T(n)= 3T(n/4) + n\cdot lg(n)$ by applying Master Theorem, p.95 I am very confused by how it was done. So, $a=3, b=4, f(n) = n\cdot lg(n) $ First step is to compare $n^{log_b a} = n^{log_4 3}= O(n^{0.793})$ with f(n). I don't...
Solving $T(n)= 3T(n/4) + n\cdot lg(n)$ using Master Method
|recurrence-relation|
Introduction to algorithms, 3rd edition has an example of how to solve recurrence $T(n)= 3T(n/4) + n\cdot lg(n)$ by applying Master Theorem, p.95 I am very confused by how it is done. So, $a=3, b=4, f(n) = n\cdot lg(n) $ First step is to compare $n^{log_b a} = n^{log_4 3}= O(n^{0.793})$ with f(n). Have no ...
If our recurrence takes the form $T(n) = aT(n/b) + f(n)$, then to use the "third case" of the Master method we must have the following hold: >$f(n) = \Omega(n^{\log_b a + \epsilon})$ for some $\epsilon > 0$ and if $a f(n/b) \leq c f(n)$ for some constant $c < 1$ and all sufficiently large $n$, then $T(n) = \Theta(f...
One type of conversion is simply the reverse if the k-sat-to-3-sat conversion: **Recall, the conversion of k-sat to "j"-sat, $j<k$:** $$\begin{eqnarray*} && (x_1 \vee x_2 ... \vee x_j \vee ... \vee x_k)\\ \rightarrow && (x_1 \vee x_2 ... x_j \vee d) \wedge (\overline d \vee x_{j+1} \vee x_{j+2...
If our recurrence takes the form $T(n) = aT(n/b) + f(n)$, then to use the "third case" of the Master method we must have the following hold: >$f(n) = \Omega(n^{\log_b a + \epsilon})$ for some $\epsilon > 0$ and if $a f(n/b) \leq c f(n)$ for some constant $c < 1$ and all sufficiently large $n$, then $T(n) = \Theta(f...
One type of conversion is simply the reverse if the k-sat-to-3-sat conversion: **Recall, the conversion of k-sat to "j"-sat, $j<k$:** $$\begin{eqnarray*} && (x_1 \vee x_2 ... \vee x_j \vee ... \vee x_k)\\ \rightarrow && (x_1 \vee x_2 ... x_j \vee d) \wedge (\overline d \vee x_{j+1} \vee x_{j+2} ...
null
Introduction to algorithms, 3rd edition has an example of how to solve therecurrence $$T(n)= 3T(n/4) + n\cdot \log(n)$$ by applying Master Theorem, p.95 I am very confused by how it is done. So, $a=3, b=4, f(n) = n\cdot \log(n)$ First step is to compare $n^{log_b a} = n^{log_4 3}= O(n^{0.793})$ with $f(n)$. I ...
|asymptotics|recurrence-relation|landau-notation|
null
> all the papers [...] state that $3m+1$ with only $m$ traitors will *definitely* give > you the correct solution They should actually state that when $3m+1$ then correct algorithms *exist*, but not all algorithms are correct. Algorithms are like cooking recipes (in fact recipes are algorithms): Consider the ...
|algorithms|integers|binary-arithmetic|
null
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
Introduction to algorithms, 3rd edition has an example of how to solve therecurrence $$\displaystyle T(n)= 3T\left(\frac{n}{4}\right) + n\cdot \log(n)$$ by applying Master Theorem, p.95 I am very confused by how it is done. So, $a=3, b=4, f(n) = n\cdot \log(n)$ First step is to compare $n^{\log_b a} = n^{\log_4 3...
Solving $T(n)= 3T(\frac{n}{4}) + n\cdot \lg(n)$ using Master Method
null
null
In order to achieve the goal you need to parallelize the operations: Input n = 11100010 First group by 2 bits and count: 0 0 -> 00 no leading 1s 0 1 -> 00 no leading 1s 1 0 -> 01 1 leading 1 1 1 -> 10 2 leading 1 This can be done using the following operations: ...
In order to achieve the goal you need to parallelize the operations: Input n = 11100010 First group by 2 bits and count: 0 0 -> 00 no leading 1s 0 1 -> 00 no leading 1s 1 0 -> 01 1 leading 1 1 1 -> 10 2 leading 1 This can be done using the following operations: ...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
Let me elaborate a bit on meisterluk's answer: Imagine we are trying to define the factorial function: remember the definition of the factorial function: fact 0 = 1 fact (n+1) = n*(fact n) Now in some PL frameworks (namely the [$\lambda$-calculus][1]), it isn't immediately obvious how to define such ...
In computer science, the arguably most prominent use of fixed-points is in [lattice theory](https://en.wikipedia.org/wiki/Lattice_(order))¹. A lattice is a partially ordered set $(S, \leq)$ with the additional property that given any two elements $x,y \in S$, the set $\{x,y\}$ has both a supremum and infimum (in $S$). ...
If our recurrence takes the form $T(n) = aT(n/b) + f(n)$, then to use the "third case" of the Master method we must have the following hold: >$f(n) = \Omega(n^{\log_b a + \epsilon})$ for some $\epsilon > 0$ and if $a f(n/b) \leq c f(n)$ for some constant $c < 1$ and all sufficiently large $n$, then $T(n) = \Theta(f...
null
One type of conversion is simply the reverse of the k-sat-to-3-sat conversion: **Recall, the conversion of k-sat to "j"-sat, $j<k$:** $$\begin{eqnarray*} && (x_1 \vee x_2 ... \vee x_j \vee ... \vee x_k)\\ \rightarrow && (x_1 \vee x_2 ... x_j \vee d) \wedge (\overline d \vee x_{j+1} \vee x_{j+2} ...
<sub> Notations: I'll use the C notations for bitwise operations: $a \mathbin\& b$ (bitwise and), $a \mathbin| b$ (bitwise or), $a \mathbin\ll b$ (shift left), $a \mathbin\gg b$ (shift right). The shift operators are left-associative (e.g. $x \mathbin\gg m \mathbin\gg n = (x \mathbin\gg m) \mathbin\gg n$). The shift o...
null
null
I am trying to understand this problem from [Algorithms. by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, chapter8][1], Pg281. Problem 8.19 A kite is a graph on an even number of vertices, say 2n, in which n of the vertices form a clique and the remaining n vertices are connected in a “tail” that consists of ...
NP-complete proof from Dasgupta problem on Kite
|algorithms|np-complete|
I am a PhD student in Computer Science who switched his PhD a little bit towards ML algorithms combined with something else... I am an expert in that something else, say image processing, but not an expert in Machine Learning. What should I read/learn to get the ML mathematics right? Especially for adaptive learning al...
What are the mathematical prerequisites for adaptive machine learning algorithms?
|algorithms|machine-learning|learning-theory|
I am trying to understand this problem from [Algorithms. by S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani, chapter8][1], Pg281. Problem 8.19 A *kite* is a graph on an even number of vertices, say $2n$, in which $n$ of the vertices form a clique and the remaining $n$ vertices are connected in a “tail” that cons...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
I have an question relating to the elementary foundations of Turing Machine theory. I would like to have a clarification of the status of a function $\phi$ (a mapping between TM indexes) I shall introduce in the formal question after the preamble. First to the preamble. Let us assume that we have a fixed Turing Mach...
You can reduce CLIQUE ($G$ has a clique of size $k$) to KITE: given $G=(V,E)$ and $k$, just build in polynomial time a new graph $G'$ in this way: * remove degree 1 nodes from $G$ * for each degree >1 node $v_i$ add a tail of $k$ new nodes If $G'$ has a kite of size $2k$ then the $G$ has a clique of size $k$ ...
You can reduce CLIQUE ($G$ has a clique of size $k$) to KITE: given $G=(V,E)$ and $k$, just build in polynomial time a new graph $G'$ in this way: * check trivial case $|V| < 3$ * recursively remove degree 1 nodes from $G$ (existing tails) * for each remaining degree >1 node $v_i$ add a tail of $k$ new nodes ...
You can reduce CLIQUE ($G$ has a clique of size $k$) to KITE: given $G=(V,E)$ and $k$, just build in polynomial time a new graph $G'$ in this way: for each node $v_i$ add a tail of $k$ new nodes. If $G'$ has a kite of size $2k$ then the $G$ has a clique of size $k$ (the kite without the tail). Added nodes cannot in...
|algorithms|reference-request|machine-learning|education|learning-theory|
|complexity-theory|np-complete|reductions|
null
Say I have an LR grammar *G* and a string *w*. I know that I can check if *w* is in the language of *G* in linear time. But what if *w* itself is not in the language of *G*, but I want to find all substrings of *w* that are in the language of *G*? And can I get parse trees for those substrings? What would be the time c...
Given an LR grammar G and a string w, is it possible to quickly find all substrings in w that are in L(G)?
|parsing|
Comments in the codes. #include <assert.h> #include <stdio.h> unsigned int should_still_count_next_time[256] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
|formal-grammars|parsing|substrings|
Informally: In DNF, you can pick *any* clause to be true, to make the formula true. This means that a DNF that is equivalent to a certain CNF, is basically an enumeration of all the solutions to boolean sat on the CNF. Note, there can be an exponential number of solutions. Since solving boolean sat for CNF for a *si...
How can i prove that the conversion from CNF to DNF is NP-Hard. I'm not asking for an answer, just some suggestions about how to go about proving it.
CNF to DNF — conversion is NP Hard
|satisfiability|sat-solvers|
who can give me a solution to my doubt. It is concerning about BINARY TREES: The theorem says: **Def 1**: A binary tree is balanced if for each node it holds that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1. **Def 2**: A binary tree is ba...
Binary trees - Properties
|binary-trees|
I have seen two definitions of balanced binary trees, which look different to me. 1. A binary tree is balanced if for each node it holds that the number of inner nodes in the left subtree and the number of inner nodes in the right subtree differ by at most 1. 2. A binary tree is balanced if for any two leaves t...
Two definitions of balanced binary trees
General satisfiability (with a few exceptions such as Horn Clauses) is not believed to have an algorithmic solution. However, the following algorithm appears to be a solution for general satisfiability. What exactly is the flaw with the following algorithm? i) Let W be an empty set which will contain all v...
Why doesn't the following algorithm solve satisfiability problems?
|logic|
I want to write an algorithm to find whether a directed circuit whose length is odd exists in a strongly connected digraph. Can anyone help me how to proceed with this problem???
Finding directed circuit