instruction
stringlengths
0
29.8k
⌀
So I have the following pseudo-code: Function(n): for (i = 4 to n^2): for (j = 5 to floor(3ilog(i))): // Some math that executes in constant time So far, I know that to find this i will be calculating $\sum_{i=4}^{n^2}\sum_{j=5}^{3ilog_{2}i}C$ where C is a constant, but I am comp...
So I have the following pseudo-code: Function(n): for (i = 4 to n^2): for (j = 5 to floor(3ilog(i))): // Some math that executes in constant time So far, I know that to find this i will be calculating $\sum_{i=4}^{n^2}\sum_{j=5}^{3ilog_{2}i}C$ where C is a constant, but I am comp...
$$F(n) = \sum\limits_{i = 4}^{n^2} \sum\limits_{j = 5}^{3i\log i}C = C\sum\limits_{i = 4}^{n^2}(3i\log i - 4) = 3C\sum\limits_{i = 4}^{n^2}i \log i - \Theta(n^4)$$ For asymptotic analysis, we can start the summation from $i = 1$ instead of $4$. Let $\begin{align} T(n) &= \sum\limits_{i = 1}^{n^2}i\log i = \sum\...
$$F(n) = \sum\limits_{i = 4}^{n^2} \sum\limits_{j = 5}^{3i\log i}C = C\sum\limits_{i = 4}^{n^2}(3i\log i - 4) = 3C\sum\limits_{i = 4}^{n^2}i \log i - \Theta(n^4)$$ For asymptotic analysis, we can start the summation from $i = 1$ instead of $4$. Let $\begin{align} T(n) &= \sum\limits_{i = 1}^{n^2}i\log i = \sum\...
So I have the following pseudo-code: Function(n): for (i = 4 to n^2): for (j = 5 to floor(3ilog(i))): // Some math that executes in constant time So far, I know that to find this i will be calculating $\sum_{i=4}^{n^2}\sum_{j=5}^{3i \log_{2}i}C$ where C is a constant, but I am co...
$$F(n) = \sum\limits_{i = 4}^{n^2} \sum\limits_{j = 5}^{3i\log i}C = C\sum\limits_{i = 4}^{n^2}(3i\log i - 4) = 3C\sum\limits_{i = 4}^{n^2}i \log i - \Theta(n^4)$$ For asymptotic analysis, we can start the summation from $i = 1$ instead of $4$. Let $\begin{align} T(n) &= \sum\limits_{i = 1}^{n^2}i\log i = \sum\...
$$F(n) = \sum\limits_{i = 4}^{n^2} \sum\limits_{j = 5}^{3i\log i}C = C\sum\limits_{i = 4}^{n^2}(3i\log i - 4) = 3C\sum\limits_{i = 4}^{n^2}i \log i - \Theta(n^2)$$ For asymptotic analysis, we can start the summation from $i = 1$ instead of $4$. Let $\begin{align} T(n) &= \sum\limits_{i = 1}^{n^2}i\log i = \sum\...
As suggested by Raphael, here's a proof doing it via the sets represented by those expressions. $\qquad L_\omega((E_1+E_2) \cdot F^\omega) \\= L(E_1+E_2) \cdot L_\omega(F^\omega) \\= (L(E_1) \cup L(E_2)) \cdot L_\omega(F^\omega) \\= \{w_1w_2 | w_1 \in (L(E_1) \cup L(E_2)) \wedge w_2 \in L_\omega(F^\omega) \} \\= \{...
Edit: This answer pertains to *quasipolynomial* algorithms rather than *pseudopolynomial* ones. A quasipolynomial algorithm tells us that the problem is probably not NP-hard. The (somewhat) commonly-believed Exponential Time Hypothesis (ETH) states that 3SAT on $n$ variables requires time $2^{\Omega(n)}$. Since 3SAT...
Let $N=n^2$, let's compute the sum $S=\sum\limits_{i=1}^{N} i \ln i=\sum\limits_{i=1}^{N} \ln i^i$ $S=\ln 1 + \ln 2^2 + \ln 3^3 + \dots+\ln N^N=\ln (1\times 2\times 2 \times 3 \times 3 \times 3 \times \dots)$ $=\ln (N!\times N!/2!\times N!/3! \times \dots)=N\ln N! - \Theta(1)$ Using Stirling's formula we get: ...
So I have the following pseudo-code: Function(n): for (i = 4 to n^2): for (j = 5 to floor(3ilog(i))): // Some math that executes in constant time So far, I know that to find this i will be calculating $\sum_{i=4}^{n^2}\sum_{j=5}^{3i \log_{2}i}C$ where $C$ is a constant, but I am ...
Running time of a nested loop with $\sum i \log i$ term
|time-complexity|algorithm-analysis|asymptotics|
null
As suggested by Raphael, here's a proof doing it via the sets represented by those expressions. $\qquad L_\omega((E_1+E_2) \cdot F^\omega) \\= L(E_1+E_2) \cdot L_\omega(F^\omega) \\= (L(E_1) \cup L(E_2)) \cdot L_\omega(F^\omega) \\= \{w_1w_2 | w_1 \in (L(E_1) \cup L(E_2)) \wedge w_2 \in L_\omega(F^\omega) \} \\= \{...
Languages in $AC^0$ can be more complicated than naive intuition might suggest. * Obviously, $AC^0$ contains $\{a^n b^n c^n\}$, which is non-context-free. * Every unary language is in nonuniform $AC^0$; for example, the halting problem expressed in unary. * Addition can be implemented in $AC^0$ with a carry-lookah...
Here is one example of a random string in the Kolmogorov sense: kejrjtokplarkoprl[paxes,0owp,itro,se0ofiespoKWP[OLAOINJ-O2CLKSEJOPOS[P3VTOIIOIopqwiodhriuropdiorpdioieurfpoiopdioiuoidurodpiwoptdopirtois02-9980uhoititoci0ieioq34u0-40brnjvhw09a3=-rjchgo0ewir
Any string generated from a PRNG clearly has a very short description. You need the code for the random number generator, the seed, and then the number of times to iterate. So, it seems that all such strings have low KC complexity. If the above it true, then what is an example of a "complex" string, in the Kolmogo...
What is an example of complex random string, in the Kolmogorov-Chatin sense?
|kolmogorov-complexity|
here is a simple/informal definition of the halting problem with minimal symbolic/mathematical language. first, consider the [Turing machine](http://en.wikipedia.org/wiki/Turing_machine). Turing machines solve different problems based on (programming via) their state table. now, the state table of any Turing machin...
Is it possible to have the following condition in a semidefinite programming as a constraint? $ M= \left[ {\begin{array}{cc} a & \sqrt{u} \\ \sqrt{u} & b \\ \end{array} } \right] \geq 0$ where $\geq 0$ means positive semidefinite. ...
semidefinite programming
|optimization|
It is impossible to give a specific example of a string with high Kolmogorov complexity. If I was to give an example in this answer, then the following piece of code would retrieve it: wget http://cs.stackexchange.com/q/9721 (plus some O(1) post-processing). A string of high Kolmogorov complexity is as elu...
This seems to be resolved by the paper [Generalized selection and ranking (Preliminary Version)][1] by Frederickson and Johnson in STOC '80. They give upper and lower bounds of: $\Theta(\ell + \sum_{i=1}^\ell \log|A_i|)$ which turns out to be $\ell \log n$ for most array size distributions. The actual algorith...
Languages in $AC^0$ can be more complicated than naive intuition might suggest. * Obviously, $AC^0$ contains $\{a^n b^n c^n\}$, which is non-context-free. * Every unary language is in nonuniform $AC^0$; for example, the halting problem expressed in unary. * Addition can be implemented in $AC^0$ with a carry-lookah...
null
I am reading on concurrent processes and algorithms which find infinite processes by searching the process graph recursively. Most of the material I have found is not for beginners. I am looking for references / algorithms that can help me understand: 1. What are process graphs? 2. How to search for infinite pr...
Process graphs and finding infinite processes
|reference-request|concurrency|process-algebras|
When working with λ-Calculus I see lots of extensions that use other symbols such as ∀ <:Top {} ←, which are from "[Types and Programming Languages][1]" ([WorldCat][2]) by Benjamin C. Pierce. Name Extends/Based on Figure Figure ...
That is, can the running time of every algorithm $A$ be written as $O(f_A(n))$ and $\Omega(f_A(n))$, for the same function $f_A$?
Can every algorithm's running time be expressed as $\Theta(f(n))$?
|algorithms|time-complexity|
No. For some inputs an algorithm can run faster or slower. For instance, insertion sort can run in $O(n)$ when the input array is already sorted but it requires $\Omega(n)$ for arrays in reversed order.
Assuming that <i>a</i>, <i>b</i>, and <i>u</i> are real variables in your semidefinite program, the answer is negative. The important fact here is that each constraint in a semidefinite program defines a convex set. Your condition cannot be written as a constraint in a semidefinite program because the set of points...
I'm really trying to wrap my head around vectorization but I can't seem to understand it. I don't know if I don't understand how to vectorize, or if I don't understand the array notation that's being used. An example of a loop I'm working on with school is below: for (M=0; M< number_of_iterations/2; M++){ ...
Vectorizing and Array Notation?
|algorithms|parallel-computing|
The running time of an algorithm is not a function of input size $n$ but a function of the input and there are various running time measure that you can define as functions of $n$. You can define $f_A(n)$ as the worst case (=largest) running time over inputs of size $n$ and $g_A(n)$ as the best case (=smallest) running...
The best case running time and the worst case running time on inputs of length $n$ can each be expressed in this way (as can any function of $n$), however, the two measures do not need to coincide. Details follows. The running time of an algorithm is not a function of input size $n$ but a function of the input and t...
The best case running time and the worst case running time on inputs of length $n$ can each be expressed in this way (as can any function of $n$), however, the two measures do not need to coincide. Details follows. The running time of an algorithm is not a function of input size $n$ but a function of the input and t...
Let us assume that NP $\neq$ Co-NP, and let's focus on the graph 3-colorability problem. Since NP $\neq$ Co-NP: 1. There is no algorithm that can recognize any 3-colorable graph in polynomial time. 2. There are no polynomial certificates in general for certifying non-3-colorability. However, we know that fo...
A question about assuming Co-NP != NP
|complexity-theory|complexity-classes|
>Given a graph G: is there an algorithm, bounded by a polynomial of order k, that can determine if G is 3-colorable-or-non-3-colorable and provide a certificate? If you fix the graph then the problem is trivial. There is always an algorithm that answers in constant time. There is no input. If the graph is the inp...
null
No. For some inputs an algorithm can run faster or slower. For instance, insertion sort can run in $O(n)$ time when the input array is already sorted but it requires $\Omega(n^2)$ time for arrays in reversed order.
DISTRIBUTED SYSTEMS CONCEPTS AND DESIGN by George Coulouris et al.
just looked this up in Hopcroft/Ullman, _Introduction to Automata Theory, Languages, and Computation._ $L_2$ seems to reduce to the question "is $L=R$ where $R$ is a given regular set?". on p281 the table states this is undecidable if $L$ is an r.e. set, ie recursively enumerable, ie a TM.
The best case running time and the worst case running time on inputs of length $n$ can each be expressed in this way (as can any function of $n$), however, the two measures do not need to coincide. Details follows. The running time of an algorithm is not a function of input size $n$ but a function of the input and t...
Opening this ansewr as a repository for various evidences / discussions anyone may find and wish to gather here (Community Wiki) - [Knuth, MMIX & Forth][1], an interesting discussion in comp.lang.forth [1]:https://groups.google.com/forum/#!topic/comp.lang.forth/A8KKWuz6hH0
null
The infinite string that has a 1 at the $i$-th position if the $i$-th Turing machine (in some fixed enumeration of TMs) halts on all inputs has a very high complexity.
The book [Distributed Systems: Concepts and Design][1] by George Coulouris, Jean Dollimore, Tim Kindberg and Gordon Blair. [1]: http://www.amazon.com/Distributed-Systems-Concepts-Design-5th/dp/0132143011
I think the Wikipedia articles [$\mathsf{P}$][1], [$\mathsf{NP}$][2], and [$\mathsf{P}$ vs. $\mathsf{NP}$][3] are quite good. Still here is what I would say: ---- ###Decision Problems There are various kinds of computational problems. However in an introduction to computational complexity theory course it is easie...
null
Yes. If your alphabet $\Sigma$ is finite then the number of words of length $n$ is finite for every $n \in \mathbb{N}$. This means that if you have an algorithm A, you can define $f_A$ as being $f_A(n) = \max_{w}t(A(w))$ where the $\max$ is taken over all strings of length $n$ and $t(A(w))$ is the time measure of $...
There is a well known definition of **parsimonious reduction**. The standard definition of parsimonious reduction is very intuitive. It simply means that the two problem have the same number of solutions, when on input of one of them we applied function $f$. We say there is a parsimonious reduction from #A to #B ...
Definition of Strongly Parsimonious Reduction
|complexity-theory|reductions|
Is there an algorithm which decides whether a regular tree grammar $G$ is ambiguous, i.g. there exists a tree $t\in L(G)$ which can be parsed by the grammar in more than one ways, using only leftmost derivations? Is there a proof available about the decidability, or a cite to a paper which proposes such an algorithm...
Is the amiguity of a regular tree grammar decidable?
|formal-languages|
As a simple proof-by-contradiction take a look at any algorithm who's complexity depends on more than one variable, e.g.: $\mathcal{O}(nk)$. In such a case it is rarely possible to express running time as $\mathcal{O}\big( f(n) \big)$.
null
I am looking for a good survey/study of experimental results of heuristics for Knapsack problem (or implemented libraries in java/c++). Any help is appreciated!
Experimental Survey on Different Heuristics for Knapsack Problem
|optimization|
|reference-request|optimization|
Consider the following problem: 1. Input: a list $l$ of integers of length $n$ and an integer $m$. 2. Output: a list $l'$ containing the elements of $l$ in ascending sorted order if $n$ is even, or a Boolean value indicating whether $m$ is contained in $l$ if $n$ is odd. Consider the following algorithm: ...
Is the ambiguity of a regular tree grammar decidable?
null
The best case running time and the worst case running time on inputs of length $n$ can each be expressed in this way (as can any function of $n$), however, the two measures do not need to coincide. Details follow. The running time of an algorithm is not a function only of input size $n$ but a function of the input a...
null
null
To show that Sasho's answer doesn't just hold for pathological algorithms, here's an example. Consider a factorization algorithm that (1) tests whether a number $N$ is prime, (2) checks whether $N$ is divisible by small primes, (3) uses a factorization algorithm that is superpolynomial (such as all known ones). I...
A search problem is defined by a relation like $R$. The task is given an input $x$ find a solution $y$ s.t. $R(x,y)$ is true. A counting problem is defined as counting the number of solutions of a search problem, i.e. given an input $x$ we want to compute the number of $y$s s.t. $R(x,y)$ holds. The counting problem ...
A search problem is defined by a relation like $R$. The task is given an input $x$ find a solution $y$ s.t. $R(x,y)$ is true. A counting problem is defined as counting the number of solutions of a search problem, i.e. given an input $x$ we want to compute the number of $y$s s.t. $R(x,y)$ holds. The counting problem ...
|formal-languages|formal-grammars|tree-grammars|decidability|
Start by considering regular *string* grammars. We can determine whether one such grammar $G$ is ambiguous by constructing the intersection of the grammar with itself, with a direct product construction. The nonterminals are pairs $(A,B)$ of nonterminals from the original string grammar $G$. The new grammar of course a...
A search problem is defined by a relation like $R$. The task is given an input $x$ find a solution $y$ s.t. $R(x,y)$ is true. A counting problem is defined as counting the number of solutions of a search problem, i.e. given an input $x$ we want to compute the number of $y$s s.t. $R(x,y)$ holds. The counting problem ...
All of the mentioned books are awesome, but I recommend you the [James Aspnes][1] [Notes on Theory of Distributed Systems][2]. It is a very good and up-to-date book that explores theory aspects of distributed systems. It is also free! I used this notes when I was TA and students were very happy about it. It has man...
I may have missed something in my classes - but with $A\leq_{P}B$... Does this show that, if $A\in \textbf{NP-Complete}$, that $B\in \textbf{NP}$ or $B\in \textbf{NP-Complete}$?
What do time complexity reductions prove?
|complexity-theory|reductions|
$A \leq_p B$ denotes that you can reduce $A$ to $B$ in polynomial time. That is, you can always transform an instance of $A$ to an instance of $B$ and you do this in polynomial time. Now if you have a polynomial time algorithm for solving an instance of $B$, you also have a polynomial time algorithm for solving an inst...
I may have missed something in my classes - but with $A\leq_{P}B$... Does this show that, if $A\in \textbf{NP-Complete}$, that $B\in \textbf{NP}$ or $B\in \textbf{NP-Complete}$? --- Edit: I think I got things backwards. If $A$ is polynomial-time-reducable to $B$, and $B$ is $\textbf{NP}$-complete, does that make ...
If any of this is wrong please correct for my and others benefit. Basically I am aware of three foundations for math 1. Set theory 2. Type theory 3. Category theory And implementations of theory 1. Type theory in [Coq][1] 2. Set theory in [SETL][2] 3. Category theory in [Haskell][3] Are there an...
Programming languages based on foundations of math
|programming-languages|type-theory|category-theory|
![enter image description here][1]If $A\leq_{P}B$ and $A\in \textbf{NP-Complete}$, then $B\in \textbf{NP}-Hard$. $NP-Hard$ is a class of problems that are "[**at least as hard as the hardest problems in NP**][2]". ([Image is from Wikipedia][3]) [1]: https://i.stack.imgur.com/aT4f8.jpg [2]: http://en.wikipedi...
null
I'm having a very hard time understanding what's what. $$L_{1}\leq_{p}L_{2}$$ If $L_2$ is stated to be in $\textbf{NP}$, is it necessarily true that $L_1$ is $\textbf{NP}$-Complete?