Questions tagged [computational-complexity]

Use for questions about the efficiency of a specific algorithm (the amount of resources, such as running time or memory, that it requires) or for questions about the efficiency of any algorithm solving a given problem.

Computational complexity is a part of theoretical computer science that answers questions about how efficient an algorithm is:

  • How much time (as a function of the size of the input) does the algorithm take to produce its output?
  • How much space (such as computer memory) does it require?
  • How much of some other resource does it consume? (For example, this can be the size of a logic circuit solving the problem, or the number of bits of randomness used by a probabilistic algorithm.)

We can similarly ask about the computational complexity of any algorithm that solves a given problem.

Often, very specific details of these answers (such as constant factors or additive terms) depend on specific details such as the computer you're using. To help deal with this, we often stick to determining the asymptotic complexity of an algorithm: see for more details.

A major problem in computational complexity is the P versus NP problem, which asks if a certain class of problems can be solved by an algorithm that runs in a number of steps that's a polynomial function of the input size.

3433 questions
1
vote
2 answers

"Simplest" symbolic equation with "most complex" symbolic answer

The below was inspired by this question, in which the OP was surprised that the "simple" equation $x^3 + x = 1$ could have such a "complex" solution. In rough form, the question here is a bit more general: What is an example of the "simplest"…
1
vote
0 answers

Find $\theta(p)$ so that $\theta(\frac{n^2}{p})+\theta(n\log p)$ is minimal.

Find $\theta(p)$ so that $\theta\Big(\frac{n^2}{p}\Big)+\theta(n\log p)$ is minimal. In my parallel programming class there was an algorithm that lead to a complexity of: $$\theta\Big(\frac{n^2}{p}\Big)+\theta(n\log p)$$ Without any sort of an…
EL_9
  • 113
  • 3
1
vote
1 answer

Notation about a randomized max cut algorithm.

http://users.cms.caltech.edu/~mccoy/publications/teatalk1.pdf I'm trying to understand the lemma in this. So we have Lemma Let $r$ be a random vector. For any unit vectors $u_{i}$ and $u_{j}$, $\mathbb{P}\left(\operatorname{sign}(\langle…
simplicity
  • 3,694
1
vote
1 answer

Why write computational complexity as $O\left( m n \log (n^2 / m) \right)$?

On slide 40 of this presentation, an algorithm is described as having a complexity of $O\left( m n \log (n^2 / m) \right)$. But since $$\log (n^2 / m) = 2 \log n - \log m$$ is itself $O(\log n)$, wouldn't it be equivalent to write the original…
Max
  • 1,257
1
vote
0 answers

Determining if a language is in P or NP?

Is the following language in P or NP? EMPTY_TM = {⟨N⟩| N is a TM that accepts no input} Can someone shed some light on how to come to such a conclusion also?
John
  • 111
1
vote
2 answers

MIN-FORMULA $\in$ NP

I am thinking about the following problem: Show that MIN-FORMULA $\in$ NP. MIN-FORMULA is the set of minimal boolean formulas, i.e. formulas such that there is no shorter formula that computes the same boolean function. I would like to have an…
Ettore
  • 527
1
vote
1 answer

Negligible function

I'm studying about complexity and reaching negligible. Can anyone tell me if $f(x)$ is a negligible function and $p(x) \in \mathbb{R}$ then $p(x) . f(x)$ is a negligible function?
Minh. Pham
  • 59
  • 2
1
vote
1 answer

Is there such a thing as "DTIME($n^k$)-completeness"?

That is, is there a conception of a problem's being $\mathrm{DTIME}(n^k)$-complete for some fixed value of $k$? For example, it seems like it should be provable--likely via a Turing-machine construction--that searching an unsorted list would be…
Dumaiu
  • 89
1
vote
1 answer

Is NP closed under infinite intersection? How about P?

I know both are closed under finite intersection and union but what about inf versions? The recursively enumerable and recursive languages are closed under finite union and intersection but not the infinite versions--does the same thing happen with…
anon
1
vote
1 answer

Prove that $f(n)=o(g(n))$ implies there is computable $h(n)=o(g(n)) \in O_C(g(n))$ s.t. $f(n)=o(h(n))$

I want to show that for time constructible $f,g$ if $f(n)=o(g(n))$ then there is a computable function $h(n)$ such that $h(n)=o(g(n))$ and further $f(n)=o(h(n))$ and $h$ is computable in $O(g(n))$. I am having difficulty even constructing any $h$…
Tony
  • 1,044
1
vote
0 answers

Algorithm to compare complexity classes

Sometimes sophisticated algorithms have very complicated looking expressions for the run time complexity which got me to wondering. Let $F$ be the set of functions containing, constant functions, polynomial functions, the exponential function, the…
Ken
  • 347
1
vote
3 answers

prove that $(n+1)^{2}(n-1)^{2}$ in in $\Omega(n^{4})$

How can I prove that $(n+1)^{2}(n-1)^{2}$ in in $\Omega(n^{4})$ ? I solved it to $n^{4}-2n^{2}+1$ As far as I know: There is a $c > 0$, a $n_0 \in N$ so that $\forall n \ge n_0: n^{4}-2n^{2}+1 \ge c * n^{4}$ If it was $n^{4}+2n^{2}+1$, it would not…
hardfork
  • 207
1
vote
0 answers

approximate solution for bin packing problem that minimizes sum of max values of bins

I am trying to approximate the following NP-hard problem, which is similar to bin packing, but does not have a linear objective function: minimize $\Sigma_{i=1, \ldots, W}$ max{$v_s$ | s $\in$ $S_i$} s.t. $\Sigma_{s \in S_i} w_s \leq T$ $\forall…
Steven
  • 269
1
vote
1 answer

Proving Big oh of $(k^5 - k^3)$

I am new to big oh notation and proofs and I can't really wrap my head around the proofs. I know how to prove that an expression is big Oh of a simple expression, lets say $k^2 \in O(k^5)$ but my brain just blanks out when I see negative numbers…
1
vote
1 answer

Asymptotic growth rate of $T(n) = 8T(\frac{n}{2}) + \mathrm{n}^{\log_2 n}$

How would I go about finding the time complexity $ T(n) = 8T(\frac{n}{2}) + \mathrm{n}^{log_2n} $ ? I've tried applying Master Theorem (Case 3), but am unsure if I did it correctly. First, I set $ \mathrm{n}^{3+\epsilon} \leqslant…
D. Prez
  • 11
  • 2