Can somebody look over my proof? (Asymptotic notation and algorithms)

I guess there are multiple ways to prove it.In summary, the conversation is about a person seeking feedback on their proof for the problem of proving that log(n!) \in \Theta (n log(n)). The person shares a link to their write-up and asks for comments on their proof style. Another person suggests using an asymptotic expression and integration to prove the theorem, which is considered a valid proof. The original person notes that their book suggested using Stirling's formula, but it seems there are multiple ways to prove the theorem.
  • #1
scorpion4377
9
0
Hey. I'm self studying my way through an algorithms book, and one of the questions at the end of a section is to prove that [itex] log(n!) \in \Theta (n log(n))[/itex]. I wrote up what I believe is a valid proof. However, I don't have much experience writing formal proofs (and even less experience with having my proofs corrected by professionals), so it could very well be invalid/lingered with errors. Can somebody take a quick look at it and comment on any mistakes that may exist? Can you comment on my style? Any advice would be appreciated.

Here is my write-up. I apologize for not using the built-in equation editor.

http://i.imgur.com/iyAto.png
 
Physics news on Phys.org
  • #2
I think Stirling's formula is unnecessary here. An asymptotic expression for [itex]\log(n!)[/itex] can be obtained as follows:
[tex]\log(n!)=\sum_{k=1}^{n}\log(k) \sim \int_{1}^{n}\log(x)dx[/tex]
The integral on the right side can be evaluated using integration by parts:
[tex]\int \log(x)dx = x\log(x) - \int dx = x\log(x)-x+C[/tex]
and this yields
[tex]\log(n!) \sim n\log(n)-n \sim n\log(n)[/tex]
Can you take it from there?
 
  • #3
That wouldn't be rigorous, would it? In my proof, I kept the error terms and treated them rigorously.

EDIT: The point of the problem is to proof the asymptotic behavior of the function, so it would be self defeating to use its asymptotic form. Please correct me if I am wrong, though.
 
Last edited:
  • #4
You can get the error bounds from post #2.
$$\log(n!) = \sum_{k=2}^n \log k$$
I changed the lower limit since ##\log 1 = 0##.

Because ##\log## is a monotonic function you can bracket the sum by two integrals
$$\int_2^n \log (x-1)\,dx < \sum_{k=2}^n \log k < \int_2^n \log x\,dx$$

Draw a picture of the integrals and the sum as a set of rectangles, if you can't see where that came from.
 
  • #5
I see! That definitely looks like a valid proof, too. The book that I'm using mentioned bounding functions using integrals, but for some reason told me to use Sterling's formula to prove the theorem.
 

What is asymptotic notation and why is it important in algorithms?

Asymptotic notation is a way of describing the rate of growth of a function. It is commonly used in algorithms to analyze their performance and compare them to other algorithms. This allows for a better understanding of how the algorithm will behave as the input size increases.

How do I know if my proof is correct?

One way to check the correctness of a proof is to use a proof assistant, which is a software tool designed to help verify mathematical proofs. Additionally, it can be helpful to have someone else look over your proof to catch any errors or offer suggestions for improvement.

What are some common mistakes to watch out for in proofs involving asymptotic notation?

One common mistake is using the wrong asymptotic notation, such as using big O instead of big Theta. Another mistake is not being careful with the constants and ignoring them in the analysis.

How can I improve my understanding of asymptotic notation and algorithms?

Reading textbooks and articles on the topic can help improve understanding, as well as practicing solving problems and analyzing algorithms. Collaborating with others and discussing different approaches can also deepen understanding.

Is there a specific format or structure that my proof should follow?

There is no specific format for a proof, but it should be clear, concise, and logically sound. It is important to clearly define any variables and assumptions, and to provide step-by-step reasoning for each statement in the proof.

Similar threads

Replies
1
Views
1K
Replies
6
Views
822
  • Programming and Computer Science
Replies
13
Views
2K
Replies
2
Views
863
  • Engineering and Comp Sci Homework Help
Replies
1
Views
990
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
4
Views
922
  • Feedback and Announcements
Replies
1
Views
386
  • Programming and Computer Science
Replies
29
Views
3K
  • STEM Academic Advising
Replies
8
Views
933
Back
Top