Questions tagged [asymptotics]

Questions involving asymptotic analysis, including growth of functions, Big-$O$ notation, Big-$\Omega$ and Big-$\Theta$ notations.

Questions involving asymptotic analysis, including growth of functions, Big-$O$ notation, Big-$\Omega$ and Big-$\Theta$ notations.

The notation $f(x) = O(g(x))$ as $x \to \infty$ is used to mean that for sufficiently large values of $x$, we have $|f(x)| \leq A g(x)$ for some constant $A$.

The notation $f(x)=\Omega(g(x))$ is equivalent to saying that $g(x)=O(f(x))$.

The notation $f(x)=\Theta(g(x))$ is used to mean that $f(x)=O(g(x))$ and that $f(x)=\Omega(g(x))$.

8480 questions
227
votes
4 answers

How many fours are needed to represent numbers up to $N$?

The goal of the four fours puzzle is to represent each natural number using four copies of the digit $4$ and common mathematical symbols. For example, $165=\left(\sqrt{4} + \sqrt{\sqrt{{\sqrt{4^{4!}}}}}\right) \div .4$. If we remove the restriction…
127
votes
7 answers

Is there a function that grows faster than exponentially but slower than a factorial?

In big-O notation the complexity class $O(2^n)$ is named "exponential". The complexity class $O(n!)$ is named "factorial". I believe that $f(n) = O(2^n)$ and $g(n) = O(n!)$ means that $\dfrac{f(n)}{g(n)}$ goes to zero in the limit as $n$ goes to…
Robert L. Read
  • 1,177
  • 2
  • 7
  • 10
79
votes
13 answers

Stirling's formula: proof?

Suppose we want to show that $$ n! \sim \sqrt{2 \pi} n^{n+(1/2)}e^{-n}$$ Instead we could show that $$\lim_{n \to \infty} \frac{n!}{n^{n+(1/2)}e^{-n}} = C$$ where $C$ is a constant. Maybe $C = \sqrt{2 \pi}$. What is a good way of doing this? Could…
James
  • 979
  • 2
  • 8
  • 5
66
votes
6 answers

Is there a slowest rate of divergence of a series?

$$f(n)=\sum_{i=1}^n\frac{1}{i}$$ diverges slower than $$g(n)=\sum_{i=1}^n\frac{1}{\sqrt{i}}$$ , by which I mean $\lim_{n\rightarrow \infty}(g(n)-f(n))=\infty$. Similarly, $\ln(n)$ diverges as fast as $f(n)$, as $\lim_{n \rightarrow…
Meow
  • 5,853
  • 6
  • 38
  • 59
61
votes
1 answer

Why are asymptotically one half of the integer compositions gap-free?

Question summary The number of gap-free compositions of $n$ can already for quite small $n$ be very well approximated by the total number of compositions of $n$ divided by $2$. This question seeks to understand why. The details A composition of an…
59
votes
5 answers

Colliding Bullets

I saw this problem yesterday on reddit and I can't come up with a reasonable way to work it out. Once per second, a bullet is fired starting from $x=0$ with a uniformly random speed in $[0,1]$. If two bullets collide, they both disappear. If we…
58
votes
3 answers

What proportion of positive integers have two factors that differ by 1?

What proportion of positive integers have two factors that differ by 1? This question occurred to me while trying to figure out why there are 7 days in a week. I looked at 364, the number of days closest to a year (there are about 364.2422 days in a…
marty cohen
  • 101,285
  • 9
  • 66
  • 160
58
votes
7 answers

Big O Notation "is element of" or "is equal"

People are always having trouble with "big $O$" notation when it comes to how to write it down in a mathematically correct way. Example: you have two functions $n\mapsto f(n) = n^3$ and $n\mapsto g(n) = n^2$ Obviously $f$ is asymptotically faster…
Blnpwr
  • 901
  • 1
  • 7
  • 11
56
votes
2 answers

What are the rules for equals signs with big-O and little-o?

This question is about asymptotic notation in general. For simplicity I will use examples about big-O notation for function growth as $n\to\infty$ (seen in algorithmic complexity), but the issues that arise are the same for things like $\Omega$ and…
hmakholm left over Monica
  • 276,945
  • 22
  • 401
  • 655
54
votes
1 answer

The Complexity of "The Baby Shark Song".

This question is just for fun. I hope it's received in the same goofy spirit in which I wrote it. I just had the pleasure of reading Knuth's "The Complexity of Songs" and I thought it'd be hilarious if someone could do an analysis of the complexity…
Shaun
  • 38,253
  • 17
  • 58
  • 156
45
votes
22 answers

What does Big O actually tell you?

Two days ago I felt very uncomfortable with Big O notation. I've already asked two questions: Why to calculate "Big O" if we can just calculate number of steps? The main idea behind Big O notation And now almost everything has become clear. But…
41
votes
2 answers

A (non-artificial) example of a ring without maximal ideals

As a brief overview of the below, I am asking for: An example of a ring with no maximal ideals that is not a zero ring. A proof (or counterexample) that $R:=C_0(\mathbb{R})/C_c(\mathbb{R})$ is a ring with no maximal ideals. A homework question in…
39
votes
1 answer

Formal definition of big-O when multiple variables are involved?

I was reading up on various graph algorithms (Dijkstra's algorithm and some variants) and found the runtime $O(m + n \log n)$, where $m$ is the number of edges in the graph and $n$ is the number of nodes. Intuitively, this makes sense, but I…
templatetypedef
  • 8,825
  • 3
  • 35
  • 77
37
votes
10 answers

What is the purpose of Stirling's approximation to a factorial?

Stirling approximation to a factorial is $$ n! \sim \sqrt{2 \pi n} \left(\frac{n}{e}\right)^n. $$ I wonder what benefit can be got from it? From computational perspective (I admit I don't know too much about how each arithmetic operation is…
Tim
  • 43,663
  • 43
  • 199
  • 459
1
2 3
99 100