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

Is this true: $(n \log n)^2 \in \Theta(\frac{n^3}{\log n})$

I have to decide whether $(n \log n)^2 \in \Theta(\frac{n^3}{\log n})$ is true or false. I can't really find a good approach, I'd assume it's wrong, but I can't prove it.
0
votes
2 answers

Hardness of a special case of maximum matching

Input: A set of N Users $\{u_1, ..., u_N\}$. A set of M products $\{i_1, ..., i_M\}$. Every pair $(u,i)$ is associated with the probability of u purchasing the product i, $p_{u,i}$. Task: Assign each user with exactly $K$ products (notation: $(u,i)…
M J
  • 1
0
votes
1 answer

What does the notation P < NP exactly mean?

Over the last days I stepped two times over the notation P < NP, but I am not sure what it exactly means. I first saw it here: P < NP In Our Stockings? https://rjlipton.wordpress.com/2020/12/24/p-np-in-our-stockings/ And now here: Toward…
user4414
0
votes
1 answer

Proving an equality

Let $f(n) = n^ {\log n}$. Let $p(n)$ and $q(n) \geq n$ be polynomials. I want to show that for $n$ sufficiently large $f (n)$ satisfies $$p(n) < f (n) < 2^{q(n)}$$ starting from the above inequality doesn't yield any satisfying result.
Gigili
  • 5,503
  • 8
  • 41
  • 62
0
votes
1 answer

Struggling to understand the definition of the class NP.

Here is a paper by Stephen Cook on the P versus NP Problem: https://www.cs.toronto.edu/~toni/Courses/Complexity2015/handouts/cook-clay.pdf I don't quite understand the definition of the class NP given on the second page, and have a few things I want…
0
votes
1 answer

Complexity analysis of computing $2^n$ by bit operation

I am not sure whether this question is a good fit for this forum. If it is not, maybe this question should be moved to more CS-related places like StackOverflow. I am now taking an intro level algorithm course. When the professor talks about…
Mr.Robot
  • 646
0
votes
1 answer

How long would it take to convert 3.3 trillion binary digits of $\pi$ to decimal?

I want to thank those who answered my previous post. Now, I understand $\pi$ has been computed to 31 trillion decimal digits. Suppose I have computed $\pi$ to 3.3 trillion binary digits, which is roughly equivalent to computing $\pi$ to a trillion…
0
votes
1 answer

Computational Complexity of $\log(\log^{*}(n)) = \Omega(\log^{*}(\log (n)))$

would you please explain me why does below equation hold? $$\log(\log^{*}(n)) = \Omega(\log^{*}(\log (n)))$$ This means that $\log^{*}(\log (n))$ in big $n$'s has a lower growth compared to $\log(\log^{*}(n))$ On the other hand, I have read in the…
0
votes
1 answer

why does Binary GCD algorithm have $O(n^2)$ complexity?

I don't have Donald Knuth's book. So, I merely wonder why Binary GCD algorithm has $O(n^2)$ complexity?
brushmonk
  • 144
0
votes
0 answers

Why do we need the o(1) term in L_n notation?

$$L_{n}\left[\alpha,c\right]:=e^{\left(c + o(1)\right)(\ln n)^\alpha(\ln \ln n)^{1-\alpha}}$$ $f$ is in o(1) if and only if for every $c\in\left[0,\infty\right)$, there exists some $N\in\mathbb{N}$ such that for every $n\in\mathbb{N}$ with $n\geq…
djones
  • 27
0
votes
1 answer

efficiency of verifier of Boolean

For a Boolean expression formula φ, For a binary literal $i∈(0, 1)^l $ V(φ,i) is an Turing algorithm which decides whether i satisfies φ or not if φ(i)=true then V(φ,i)=1 if φ(i)=false then V(φ,i)=0 I heard that the machine V works very…
0
votes
1 answer

Space complexity of undirected graph

I still continue to work on complexity, for the following algorithm I would like to know: The space complexity How can we show that $G$ contains a cycle if and only if there is a point $u$ and an edge $(u,v)$ around $u$ such that the explorer…
0
votes
1 answer

Is 2-SAT an instance of SAT? Why Shannon's Theorem does not imply that some Boolean formulas (instances of SAT) require exponential size circuits?

Question 1: SAT is defined as a language of all satisfiable boolean formulas. Does definition of SAT imply that all 2-SAT instances are instances of SAT? If 2-SAT is an instance of SAT, why is it not NP-complete? Question 2: Chapter 6 (Boolean…
istex
  • 11
0
votes
2 answers

What is the definition of the parameter of a computational complexity?

Complexity classes like P, NP, and #P is defined to have a time complexity bounded under a polynomial. But over what is the polynomial? Let's say it's $n$. $n$ is defined as: For integers, its number of digits (as in for example, addition) For…
Dannyu NDos
  • 2,029
0
votes
1 answer

Finding if a f(n) is in theta of g(n)

$$2^{3^n}\in Θ\left(2^{3^{n+1}}\right) $$ My intuition about it was to disregard constants since we are talking about asymptotic analysis. $ 2^{3^{n+1}} $ can be rewritten as $2^{3\cdot 3^n}$ which is equal to $8^{3^n}$ and since 2 and 8 are…