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

  • Thread starter Thread starter shamieh
  • Start date Start date
  • Tags Tags
    identities
AI Thread Summary
The discussion centers on the growth rates of n! and 4^n, specifically whether n! is in O(4^n) or 4^n is in O(n!). It is concluded that n! is not in O(4^n), as demonstrated by finding a specific n (like n=10) for which the relationship fails for any constant c. Conversely, it is established that 4^n is indeed in O(n!), supporting the second identity. Participants emphasize the importance of understanding the definitions and negations of big O notation to justify their conclusions. Overall, the consensus is that the second identity holds true while the first does not.
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$.
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Thread 'Project Documentation'
Trying to package up a small bank account manager project that I have been tempering on for a while. One that is certainly worth something to me. Although I have created methods to whip up quick documents with all fields and properties. I would like something better to reference in order to express the mechanical functions. It is unclear to me about any standardized format for code documentation that exists. I have tried object orientated diagrams with shapes to try and express the...

Similar threads

Replies
0
Views
2K
Replies
1
Views
2K
Replies
2
Views
1K
Replies
15
Views
3K
Replies
8
Views
2K
Replies
5
Views
2K
Replies
5
Views
1K
Back
Top