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
3
votes
1 answer

Is there a mathematical way to measure complexity?

I was thinking of the mandelbrot set. When you draw a picture of it at some resolution, you are able to get some idea of what it is, but there will be details that are lost. Is there a way to quantify the amount of detail/complexity of an object? Is…
Ivan
  • 247
3
votes
1 answer

Can I check $a^b=c$ in polynomial time?

Let $a,b,c\in\mathbb{Z}$. Assume that $a,c\leq 2^p$ and $b\leq 2^q$ - that is, the bit sizes of $a$ and $c$ are bounded by $p+1$ and the bit size of $b$ is bounded by $q+1$. Can I decide whether $$ a^b=c $$ in poly$(p,q)$-time? Can I decide $a^b=c$…
Levent
  • 4,804
3
votes
1 answer

Logarithm, its algebraic properties and algorithmic complexity (MIT OpenCourseware 6.042)

Does $$2^{\log{n}} T(n / 2^{\log n}) = 2^{\log{n}} T(1)?$$ If so, how? Also, I don't understand how the following equality works: $$\sum_{i=0}^{\log(n) -1}{2^i} = 2^{\log n} - 1$$ I'm afraid I'm either missing some context or just algebraic…
user52207
  • 95
  • 3
3
votes
1 answer

True or false: $2^{n+1} \in O(2^n)$, $2^{2n} \in O(2^n)$?

Prove true or false: $2^{n+1} \in O(2^n)$ $2^{2n} \in O(2^n)$ I don't know where to start, so any push or solution is appreciated. I know constants doesn't matter in asymptotic complexity, so $n+50 \in O(n)$ right? But also$n^3 \notin O(n^2)$…
relaxxx
  • 177
3
votes
3 answers

Is $O(2^{n/2})$ the same as $O(2^n)$?

Why or why not? It seems like the answer should be no, but on the other hand, it's weird that you'd reach the same value in a constant multiple of n.
3
votes
3 answers

Time Complexity of $T(n)=T(n-2)+\frac{1}{\log(n)}$

Solve $T(n)=T(n-2)+\frac{1}{\log(n)}$ for $T(n)$. I am getting the answer as $O(n)$ by treating $1/\log(n)$ as $O(1)$. The recursive call tree of this is a lop-sided tree of height $n$. Hence, considering the amount of work done in each step, the…
3
votes
1 answer

If someone finds a polynomial time algorithm for a problem in NP, will we be able to construct polynomial time algorithms for all problems in NP?

The existence of a polynomial time algorithm for a single problem in NP implies the existence of polynomial time algorithms for all problems in NP (correct me if I'm misunderstanding this). Suppose someone finds a polynomial time algorithm. Will we…
Perry Bleiberg
  • 1,277
  • 8
  • 16
3
votes
1 answer

example of complexity class that does not have complete problems

Many known complexity classes have complete problems; however, according to what I heard, not all complexity classes have complete problems. So, what are some examples of the complexity classes that do not have complete problems? And if they exist,…
user2346
  • 631
  • 2
  • 7
  • 14
3
votes
1 answer

checking boolean logical equivalence

Given two boolean formula (aka. logic circuit), I want to check if they are logically equivalent, namely that they compute the same truth table. Is this an NP-complete problem? What is the proof?
LKSR
  • 535
3
votes
1 answer

Computation Complexity POLYLOGSPACE

POLYLOGSPACE is the complexity class $ \bigcup^\infty_{k=1} SPACE((logn)^k) $ (a) Show that, for any k, is $ A \in SPACE((logn)^k) $ and $ B \le _L A $, then $ B \in SPACE((logn)^k) $. (b) Show that there are no POLYLOG-complete problems with…
Mathie
  • 31
2
votes
3 answers

Confused with the definition of NP

In the blog post at: Concrete Nonsense I read: NP is the set of problems that can be solved by polynomial-time non-deterministic algorithms. An equivalent definition of NP is the set of problems for which a solution can be verified in polynomial…
Tony
  • 455
2
votes
1 answer

Simple question on complexity

I just started to learn the complexity theory, and I have a simple question: Let's say that there's a language B in NP, such that there's no polynomial reduction from B to a given language A (which is in P). Can I conclude from this that B is not in…
user25239
  • 31
  • 1
2
votes
2 answers

Problem on time complexity

If $a = O(m)$ and $b = O(n)$, is it true that $a+b = O(m+n)$? I would try to break it down to $a \le cm$ for some $c$ and $b \le dn$ for some $d$, so if I were to add the right hand side, it would be $cm+dn$, but I don't seem to be able to translate…
2
votes
1 answer

co-NP assertion

I want to prove that the below assertion is false: Given L1,L2 $\in$ co-NP, does L1 $\cap$ L2 $\in$ NP ? I already know that co-NP is closed under intersection and union, but this result is not useful since the membership in co-NP doesn't exclude…
2
votes
0 answers

Is there any oracle A s.t. NP$^A$ $\neq$ EXP$^A$

I think the answer is yes because we do not know whether NP = EXP. But i couldn't find one.
1 2
3
22 23