Questions tagged [asymptotics]

For questions involving asymptotic analysis, including function growth, Big-$O$, Big-$\Omega$ and Big-$\Theta$ notations.

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

  • $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$.

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

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

9917 questions
228
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…
129
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…
85
votes
14 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
  • 1,049
81
votes
7 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
  • 6,623
65
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…
61
votes
2 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
  • 110,450
61
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
  • 931
60
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…
59
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…
56
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…
49
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…
47
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…
45
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…
42
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
  • 49,162
41
votes
3 answers

Why do we use big Oh in taylor series?

In the taylor series for sin(x), we write: $$ \sin{x} = x - \frac{x^3}{6} + \frac{x^5}{120} + O(x^7) $$ Meaning that $\sin{x} = x - \frac{x^3}{6} + \frac{x^5}{120}$ and terms of order $x^7$ and higher, so we say that those 'higher order terms' are…
Maksim
  • 546
  • 1
  • 5
  • 6
1
2 3
99 100