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$.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
What percentage of programmers have learned to touch type? Have you? Do you think it's important, not just for programming, but for more-than-casual computer users generally? ChatGPT didn't have much on it ("Research indicates that less than 20% of people can touch type fluently, with many relying on the hunt-and-peck method for typing ."). 'Hunt-and-peck method' made me smile. It added, "For programmers, touch typing is a valuable skill that can enhance speed, accuracy, and focus. While...
I had a Microsoft Technical interview this past Friday, the question I was asked was this : How do you find the middle value for a dataset that is too big to fit in RAM? I was not able to figure this out during the interview, but I have been look in this all weekend and I read something online that said it can be done at O(N) using something called the counting sort histogram algorithm ( I did not learn that in my advanced data structures and algorithms class). I have watched some youtube...

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