in Algorithms retagged by
434 views
0 votes
0 votes

Can anyone explain this?

in Algorithms retagged by
434 views

4 Comments

Yes. This is what I have written.  put the N value in N*logN to get the ans.
1
1
Then answer would be $n*2^n$
0
0
Small n
0
0

2 Answers

1 vote
1 vote

The given number N can be represented in logN bits which is n. (given) {  log N = n or N = $2^{n}$}

So, to represent N!, we need at least logN! bits.

And, according to Stirling’s approximation log n! $\approx$ n log n

We can write logN! = N log N

Therefore, we can write $2^{n} n$ are the bits from N! numbers can be represented.

In the options, none of them is matching.

But if you still want the correct option, you can go with the most suitable answer matched that is $2^{n}$.

 

by

1 comment

Correct.
0
0
1 vote
1 vote
We know that the no of bits to represent a binary number n is : log(n)

Here it's asked for n! So number of bits required to represent N! is log(N!). Using Sterling's approximation, log(N!) is asymptotically equal to ≈ Nlog(N).

So answer is A) Nlog(N)

Related questions