Posted by: atri | October 18, 2012

Typo in solution to Q1 on HW 3

In the proof of the analysis, on the 3rd line in 2nd para it says

T(n)=\sum_{i=1}^n n\times (n-i + O(n-i))=O(n^2).

That is a typo and it should read

T(n)=\sum_{i=1}^n (n-i + O(n-i))=O(n^2).

The last equality uses the following identity

\sum_{j=1}^n j =\frac{j(j+1)}{2}.

Thanks to the student who pointed out the bug!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: