Is n! in O(4^n) or 4^n in O(n!)?

  • Context: MHB 
  • Thread starter Thread starter shamieh
  • Start date Start date
  • Tags Tags
    identities
Click For Summary
SUMMARY

The discussion centers on the asymptotic relationships between factorial growth and exponential growth, specifically evaluating whether \( n! \) is in \( O(4^n) \) and whether \( 4^n \) is in \( O(n!) \). The consensus is that \( n! \notin O(4^n) \) and \( 4^n \in O(n!) \) holds true. Participants demonstrated this by applying the formal definition of Big O notation and providing counterexamples to validate their claims.

PREREQUISITES
  • Understanding of Big O notation and asymptotic analysis
  • Familiarity with factorial growth rates
  • Basic knowledge of exponential functions
  • Ability to manipulate mathematical inequalities
NEXT STEPS
  • Study the formal definition of Big O notation in detail
  • Explore the growth rates of factorials versus exponential functions
  • Learn about Stirling's approximation for factorials
  • Investigate other asymptotic notations such as Big Omega and Big Theta
USEFUL FOR

Mathematicians, computer scientists, and students studying algorithm complexity, particularly those interested in asymptotic analysis and growth rate comparisons.

shamieh
Messages
538
Reaction score
0
Which of the following identities are true. Justify your answer.
a)$n! = O(4^n)$
b)$4^n = O(n!)$

I have NO clue what to do here. First I was thinking let $n = 0$ so that $1 = O(1)$ (constant time complexity?)
 
Technology news on Phys.org
It holds that:$$n!=1 \cdot 2 \cdots (n-1) \cdot n \geq 1 \cdot 2 \cdot 3 \cdot 4 \cdot 4 \cdots 4=1 \cdot 2 \cdot 3 \cdot 4^{n-3} \geq \frac{3}{32} \cdot 4^n$$

What can we deduce from that?
 
Here is what I've came up with..

I know that: $f(x) = O(g(x))$ iff $\exists$ positive constants $C$ and $n_0$ $|0 \le f(n) \le c * g(n),$ $\forall$ $n \ge n_0|$

So I found that $n! \notin O(4^n)$ by letting $n = 10$ and letting $c = 1$. Then I found that $4^n \in O(4^n)$ is that the correct way to say it? Basically I found that the second identity is true.
 
shamieh said:
Here is what I've came up with..

I know that: $f(x) = O(g(x))$ iff $\exists$ positive constants $C$ and $n_0$ $|0 \le f(n) \le c * g(n),$ $\forall$ $n \ge n_0|$

So I found that $n! \notin O(4^n)$ by letting $n = 10$ and letting $c = 1$. Then I found that $4^n \in O(4^n)$ is that the correct way to say it? Basically I found that the second identity is true.

I agree that the second identity holds, but the first doesn't.
You can prove that $4^n=O(n!)$ as I did in my previous post.
I think that in order to prove that $n! \notin O(4^n)$ you have to show the negation of the definition you stated.
The negation of $\forall$ is $\exists$ and conversely. So you just have to find a $n$ such that the relation doesn't hold for any $c$.
 
shamieh said:
Then I found that $4^n \in O(4^n)$
This is trivially true because $f(n)\in O(f(n))$ for every $f$: just take $C=1$ and $n_0=0$.

evinda said:
The negation of $\forall$ is $\exists$ and conversely. So you just have to find a $n$ such that the relation doesn't hold for any $c$.
To elaborate on this, the definition of $f(n)\in O(g(n))$ says
\[
\exists C\,\exists n_0\forall n\ge n_0\;f(n)\le Cg(n).
\]
The negation of this is
\[
\forall C\,\forall n_0\,\exists n\ge n_0\;f(n)>Cg(n).
\]
So to prove that $n!\notin O(4^n)$ using the definition, you need to find an $n$ for every $C$ and $n_0$.
 

Similar threads

  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K