/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} 4E Show that log(n!)=胃(nlogn)聽(Hi... [FREE SOLUTION] | 91影视

91影视

Show that log(n!)=(nlogn)

(Hint: To show an upper bound, compare (n!) with nn. To show a lower bound, compare it with (n2)n2).

Short Answer

Expert verified

The statement logn!=nlognis proved.

Step by step solution

01

Explain Asymptotic notation.

Big O notation provides an asymptotic upper bound on a function, and omega notation provides an asymptotic lower bound. Three asymptotic notations are used to represent the time complexity of algorithms. They are: Big-O notation, Omega notation and Theta notation.

02

Prove the equation by upper bound.

The given equation is:

logn!=nlogn

Let the right-hand side derivation be log(n!).

logn!=log123............n-1nlogn!=log1+log2+log3..........+logn

From here, it is clear that log1logn

logn!logn+logn+logn.....+lognlogn!nlogn

03

Prove the given equation by lower bound.

Now, prove for omega notation.

logn!=nlogn

Let the left-hand side derivation ben!2.

n!2=n!n!n!2=n1n-12n-23..........1nn!2=k=1nn-k+1nn!2=k=1n-k2+nk+k

Here a quadratic equation is obtained, which is equal to data-custom-editor="chemistry" fk.

fk=-k+nk+kwhere data-custom-editor="chemistry" 1kn鈥︹赌.鈥(1)

Here, put the value of k in the equation (1).

fkmin=-12+n1+1fkmin=n

Equate both the equations:

n!2=k=1nfkn!2k=1nfkminn!2k=1nnn!2nn

Taking logon both sides:

logn!2lognn2logn!nlognlogn!n2lognlogn!nlogn

So, the final answer obtained is logn!=nlogn

Hence data-custom-editor="chemistry" logn!=nlognis proved.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91影视!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Compute GCD(210,588)two different ways: by finding the factorization of each number, and by using Euclid鈥檚 algorithm.

The grade-school algorithm for multiplying two n-bit binary numbers x and y consist of addingtogethern copies of r, each appropriately left-shifted. Each copy, when shifted, is at most 2n bits long.
In this problem, we will examine a scheme for adding n binary numbers, each m bits long, using a circuit or a parallel architecture. The main parameter of interest in this question is therefore the depth of the circuit or the longest path from the input to the output of the circuit. This determines the total time taken for computing the function.
To add two m-bit binary numbers naively, we must wait for the carry bit from position i-1before we can figure out the ith bit of the answer. This leads to a circuit of depth(m). However, carry-lookahead circuits (see
wikipedia.comif you want to know more about this) can add in(logn)depth.

  1. Assuming you have carry-lookahead circuits for addition, show how to add n numbers eachm bits long using a circuit of depth (lognlogm).
  2. When adding three m-bit binary numbers x+y+z, there is a trick we can use to parallelize the process. Instead of carrying out the addition completely, we can re-express the result as the sum of just two binary numbersr+s, such that the ith bits of r and s can be computedindependently of the other bits. Show how this can be done. (Hint: One of the numbers represents carry bits.)
  3. Show how to use the trick from the previous part to design a circuit of depth(logn)for multiplying two n-bit numbers.

Prove that the grade-school multiplication algorithm (page 24), when applied to binary numbers, always gives the right answer.

Suppose you want to compute the nth Fibonacci number Fn , modulo an integer p. Can you find an efficient way to do this?

Show that any binary integer is at most four times as long as the corresponding decimal integer. For very large numbers, what is the ratio of these two lengths, approximately?

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.