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

A problem in paraNP but not in NP?

I know the title may sound misleading as one class is for parameterized problems and the other not, but hear me out. Say I take a "naturally" parameterized problem (the parameter is part of the input), for example weighted SAT (call it…
0CT0
  • 140
1
vote
1 answer

Is it possible to have two $NP$- complete languages whose union is $\{ 0, 1\}^*$?

I've been studying complexity theory, and it proves to be very difficult to understand for an undergrad student as myself. I have the following question: Is it possible two have two NP-complete languages $L, T$ such that $L \cup T = \{0, 1\}^*$? I…
1
vote
1 answer

finding the asymptotic growth bound for the following floor/ceiling recurrence

Suppose we have $$ T(n)=0 \quad,\quad n\leq3 $$ $$ T(n)= T(\lceil n/3\rceil)+T(\lfloor n/4\rfloor)+7n\quad,\quad n\geq4 $$ how does one show that the upper and lower bounds are matching? (i.e. find $\Theta(...) $) I tried evaluating the first few…
jeb2
  • 645
  • 4
  • 15
1
vote
1 answer

What's the degree of the polynomial function $f(n) = n \log n$?

I'm learning a MIT Session about computation complexity At about 6:26 into the video linked above, the speaker says "basically, we look over here at the polynomial function." The link starts at 6:21. A polynomial function is usually in this…
JJJohn
  • 1,436
1
vote
0 answers

Are there any examples of "Easy" Problems in EXPTIME(ie problems with small exponents)

These would be problems in EXPTIME that are technically exponential, but are still practical. For example an algorithm that can be computed and verified in $\mathcal O(1.00000001^{n})$ with $n$ growing slowly with the input. I know that there are…
1
vote
1 answer

Finding the complementary language of a given language

I'm trying to figure out what's the complementary language of: L = {w#w : w∈{a,b}*, |w| = k} I think it's the language of all the words w#w where |w|!=k. I think my answer is not correct. How should I think about this? And what is the correct…
Maroun
  • 113
1
vote
1 answer

What is a function $f(n)$ such that $t_n \in \Theta(f(n))$

Let $t_n$ be defined as follows: $$ t_n = \frac{571}{98}*7^n - \frac{45}{14}*5^n +\frac{6}{7}*n*5^n $$ I am looking for a function $f(n)$ such that $t_n \in \Theta(f(n))$. I am confused at how I can find the $\Theta$ Can you please guide me? Thanks
lalaland
  • 345
  • 1
  • 9
1
vote
0 answers

Complexity class of a minichess variant

Instance: A $n*n$ chess pawn structure (the starting position is $n$ pawns each on their next-to-last row, as usual) Decision Question: Is this structure legal by playing chess moves, especially sacrificing pawns (including figures promoted from…
1
vote
0 answers

Is there a way to indicate $NP^{\prod_i^P}$ or $coNP^{\prod_i^P}$ like in polynomial hierarchy?

In know that in polynomial hierarchy $\ \ \ \sum_{i+1}^P=NP^{\sum_i^P}$ $\ \ \ \prod_{i+1}^P=coNP^{\sum_i^P}$ I was wondering if there exists a way (and if it does make sense) to indicate $NP^{\prod_i^P}$ or $coNP^{\prod_i^P}$.
Luke
  • 81
1
vote
0 answers

Can somebody please explain to me why NPSPACE=PSPACE in a simple way?

This is what I found on the web, but why is this true? Can somebody explain it as simply as possible, please? In other words, if a nondeterministic Turing machine can solve a problem using f(n) space, an ordinary deterministic Turing machine can…
Benny
  • 29
1
vote
1 answer

Input size measurement according to polynomial presenation

There's a paragraph in my book (Complexity and cryptography by Talbot and Welsh, chapter 4) that I don't fully understand: Let $\mathbb Z[x_1,\dots,x_n]$ denote the set of polynomials in n variables with integer coefficients. [...] We have to be…
Gigili
  • 5,503
  • 8
  • 41
  • 62
1
vote
1 answer

finding big theta notation with recursion and nlg(n)

given the recursion formula: $T(n) = T(n-1) + n\cdot \lg{n}$ I need to find $g(n)$ so that $T(n)=\theta(g(n))$. I know that $T(n) = n\cdot \lg n + (n-1)\cdot \lg (n-1) + (n-2)\cdot \lg (n-2 + ... = \sum_{i=2}^{n}i\cdot \lg{n} + \theta(1) \le…
1
vote
0 answers

Calculate the time complexity for the following Travelling Salesman problem algorithm

Consider the following algorithm for solving the TSP: $n$ = number of cities $m$ = $n\times n$ matrix of distances between cities min = (infinity) for all possible tours, do: find the length of the tour if length < min …
user59036
  • 1,525
1
vote
1 answer

What is the complexity class for each one of the following functions

What is the complexity class for each one of the following functions: $a) (n^3+n^2 \log n)(\log n+1) + (10 \log n+7)(n^3+3)$ $b) (2n + n^2)(4n^3 + 4n)$ $c) (n^n + n2^n + 3n)(n! + 6n)$
mmk
  • 13
1
vote
2 answers

What is the complexity of $T(n) =3T((n-2)/2) + n^2$?

I have to find the complexity of a recursive function that has this form: $$T(n) =\left\{\begin{aligned} &3T((n-2)/2) + k_2n^2&&\text{ when }n > 1\\ &k_1 &&\text{ when } n = 1 \end{aligned}\right.$$ I have met $…