Questions tagged [asymptotics]

Questions about asymptotic notations and analysis

Asymptotic analysis is a method of describing the limiting behavior. It is used widely in computer science, particularly in analyzing the asymptotic behavior of algorithms and computational processes.

Related tags:

1451 questions
26
votes
11 answers

"For small values of n, O(n) can be treated as if it's O(1)"

I've heard several times that for sufficiently small values of n, O(n) can be thought about/treated as if it's O(1). Example: The motivation for doing so is based on the incorrect idea that O(1) is always better than O(lg n), is always better than…
rianjs
  • 373
  • 3
  • 10
18
votes
3 answers

What is an asymptotically tight upper bound?

From what I have learned asymptotically tight bound means that it is bound from above and below as in theta notation. But what does asymptotically tight upper bound mean for Big-O notation?
Vivek Kumar
  • 195
  • 1
  • 1
  • 6
15
votes
2 answers

Difference between the tilde and big-O notations

Robert Sedgewick, at his Algorithms - Part 1 course in Coursera, states that people usually misunderstand the big-O notation when using it to show the order of growth of algorithms. Instead, he advocates for the tilde notation. I understand the…
thyago stall
  • 253
  • 1
  • 2
  • 6
9
votes
1 answer

Big-O complexity of sqrt(n)

I'm trying to backfill missing CS knowledge and going through the MIT 6.006 course. It asks me to rank functions by asymptotic complexity and I want to understand how they should be reduced rather than just guessing. The question is to reduce this…
SimplGy
  • 193
  • 1
  • 1
  • 5
9
votes
5 answers

Is an integer variable constant or logarithmic space?

My lecturer says that a variable takes up one memory position in RAM. This is the slide in question: But CLRS (Introduction to Algorithms by Cormen, end of page 23) says an integer is represented by $c\ lg\ n$. Are both statements true? How can…
Bee
  • 185
  • 1
  • 9
8
votes
1 answer

Useful functions between polylogarithmic and polynomial?

I'm wondering if there are any useful functions asymptotically greater than a polylogarithmic function and less than a polynomial function. That is, a function $f(n)$ such that $f(n) = \omega(\log(n)^k)$ for some constant $k > 0$ and $f(n) =…
ryan
  • 4,501
  • 1
  • 15
  • 41
8
votes
3 answers

Confused about proof that $\log(n!) = \Theta(n \log n)$

So I was able to show that: $\log(n!) = O(n\log n)$ without any problems. My question is when trying to prove that $\log (n!) = \Omega(n\log n)$. I was able to show that: $$\begin{align*} \log n! &= \log(1 \cdot 2 \cdot 3 \cdots n )\\ &= \log 1 +…
David Velasquez
  • 185
  • 1
  • 1
  • 4
7
votes
3 answers

Show that $\log n = o(n^\epsilon)$

I am trying to understand how to prove that a polynomial will always grow faster than a logarithm. $\log n = o(n^\epsilon), \epsilon>0$ Intuitively, it is obvious, and plugging in a few numbers always yields true, but how can I prove this? Maybe…
Rodman Huey
  • 71
  • 1
  • 2
7
votes
2 answers

Is log n! = Θ(n log n)?

Why is $\log(n!)=\Theta(n\log n)$? I tried: $\log(n!) = \log1 + \dots + \log n \leq n \log n \Rightarrow \log(n!) = O(n \log n)$. But how can we prove $\log(n!) = \Omega(n \log n)$ without Sterling's approximation?
Z.S.CS
  • 139
  • 1
  • 2
  • 5
7
votes
1 answer

Big Theta Proof on polynomial function

This is not homework. I have the solution but it's not what I'm getting. I know there are multiple solutions to the problem but I want to make sure that I'm not missing anything. The question is as follows: Prove that 2$n^2$ - 4n + 7 = Θ…
Harrison Nguyen
  • 145
  • 1
  • 3
  • 9
7
votes
4 answers

Is $n^{1/\log \log n} = O(1)$?

Is $n^{1/\log \log n} = O(1)$ ? Suppose that $n^{1/\log \log n} = c$ where $c$ is constant. Taking logs of both sides, $$\frac{1}{\log \log n}\log n = \log c.$$ I am not able to spot an error. Please help
user110834
7
votes
1 answer

Asymptotics of a function that decreases as n increases

A homework assignment asks me to state the complexity in Big-O notation of the function $$f(n) = 7n – 3n \log n + 100000 $$ I graphed this function and decreases all the way down to zero nearly its entire lifespan. Therefore I concluded that the…
CodyBugstein
  • 2,957
  • 10
  • 30
  • 45
6
votes
3 answers

How to determine $10^{\log n}$ and $3n^2$ which grows faster asymptotically?

My think is pretty easy that $10^{\log n} = n$, which is growing slower than $3n^2$. However, many tutorial shows that $3n^2$ ranks before $10^{\log n}$. I'm really confused.
user59001
  • 97
  • 1
  • 2
5
votes
1 answer

Do not understand why log n = O(n^c) (for any c>0)

Can anyone help me understand this equation? $\log (n) = O(n^c)$ (for any $c>0$) Does it mean that $O(\log (n)) < O(n^c)$ (for any $c>0$)? Added: Please also prove that $\log (n) = O(n^c)$ is true.
Xin
  • 161
  • 1
  • 5
5
votes
1 answer

Can subtracting o(1) from the parameter of a function change its Θ-class?

I would like to know if it is possible that two functions $f(n), g(n)$ can exist such that both of the following conditions are met: $g(n) = o(1)$ $f(n-g(n)) \neq \Theta (f(n))$ I though I found $1/n$ and $1/n^2$ but I think I got it all…
1
2 3
18 19