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

Upper and Lower Bounds

The question that I'm having trouble with is: Prove that k/2 is a lower bound for √(n) I'm not sure how I would start this, can someone take a look at it and help me with it? I understand the summation from 1 to k would be ((k^2 + k) / 2) I'm just…
0
votes
1 answer

I need a layman's blurb on 'time' (as in for example, polynomial time)

I took a rather winding and incomplete road through maths (and comp-sci) in college, so some things I get, and some things I must have missed. I need to wrap my head around what Math and Computer people mean by 'time' and/ running time. I'm…
Mr. AM
  • 177
  • 6
0
votes
1 answer

Prove $an\log(n)+3n = \Theta(n\log(n))$

Using the asymptotic definition of $\Theta(.)$ I need to show that: $$an\log(n)+3n = \Theta(n\log(n))$$ for some $a$, fixed constant. My attempt In order to prove what's above, I need to find a suitable positive $c_1$ and $n_0$ values such that as…
haunted85
  • 1,418
0
votes
1 answer

Need help figuring out function complexities the right way

I solved the following problem by plotting a graph and comparing the complexities. The picture below show the question along with my answer and the TA's corrections. Can someone please tell me what I am doing wrong? I didn't understand the…
Prachi
  • 101
0
votes
0 answers

What is the formula of the minimum computational speed

Given potential range of velocity for matter, what is the minimum speed of computational speed in order for a "loop" to exist?
0
votes
0 answers

A question about computation analysis

I have derived that the required number of operations in my algorithm is $Y(a)$, where $a>0$ is the concerned parameter. However, $Y(a)$ is not a closed-form expression w.r.t. $a$. But I find that $Y(a)\leq P(a)$, and $P(a)$ can be expressed as a…
Tyke
  • 145
0
votes
0 answers

Does for any program it exists a program that is complexitively independant?

So we fix a system turing complet, as the system is fixed it makes sens to speak of complexity with a coefficient like 3t, or 10t² on this system. Let L be all the linear complexity decision problems. Let x be in L of complexity t->at we note…
0
votes
0 answers

Time hierarchy theorem to show $Time(n^7)$ strictly contained in P

I'm relatively new to computational complexity and am trying to use the time hierarchy theorem to show that $Time(n^7)$ is strictly contained in P. I understand that the time hierarchy theorem says that if the limit as n tends to infinity of…
Lucas
  • 1
0
votes
2 answers

Is there a task, so that any algorithm solving this task can not run better than $\mathcal{O}(n)$?

More generally my question is, whether for any $k$ there is a task (e.g. sorting a list of length $n$), s.t. any algorithm solving this task can not run better than $\mathcal{O}(n^k)$? Any idea/reference is appreciated.
0
votes
1 answer

A precise statement of: "The boolean satisfiability problem (SAT) is in NP"

If $f$ is a function $\mathbb N\to\{\text{True},\text{False}\}$, then I know what it means to say that $f$ is in NP. But if $f$ is a function $A\to \{\text{True},\text{False}\}$, where $A$ is a set, then I do not know what that means. The Boolean…
zxcv
  • 1,445
0
votes
1 answer

Comparing the complexity of $n!$ and $4^n$

$1 < \log ⁡n < n < n\log ⁡n < n^2 < n^3< \ldots < 2^n < 3^n < 4^n < \ldots < n! < n^n$ I am trying to find out if $n!$ is greater than $4^{n}$. One way to attempt to solve this is to compare $n!$ with $4^{n}$ by taking a limit as $n$ approaches…
0
votes
0 answers

Rearrange $x\lg{x} = t$ in terms of $x$

I'm interested in how the number of operations of $O(x\lg{x})$ algorithms grow over time, I want to find the maximum value of $x$ for different values of $t$, but I can't seem to rearrange the equation in terms of $x$.
0
votes
1 answer

Are there(preferably natural) arbitraraly hard problems in the worst case that are easy on average?

Are there arbitrarily hard worst case problems that are (relatively)easy on average? For example, could there be an RE complete problem that is solvable in polynomial time for most instances? It think it should be easy to construct such problems…
0
votes
0 answers

What does a space of functions sorted by how they grow asymptotically look like?

Let's define two computable functions as equal iff they are calculated in the same time in Big-O terms. Is this an equivalence relation? If yes, how many equivalence classes are there? What does that structure look like? Is this an ordering, one…
0
votes
1 answer

Worst-case time complexity of il-else block that iterates two disjoint sets

I am estimating the worst-case time complexity of this piece of code: if (condition) { // loop over A } else { // loop over B } such that A and B are disjoint sets and |A| + |B| = C. In my opinion, the worst-case time complexity is O(max(|A|,…