Summation Algorithm: Understanding n/lgn-i = n/i

  • Context: Undergrad 
  • Thread starter Thread starter unknown_2
  • Start date Start date
  • Tags Tags
    Algorithms Summation
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
unknown_2
Messages
28
Reaction score
0
Hi, I've been looking through my algorithms book/notes and I've come across this summation I'm not quite sure how they got to.

[tex]\sum^{lgn - 1}_{i = 0}\frac{n}{lgn - i}[/tex] = [tex]n\sum^{lgn}_{i = 1}\frac{n}{i}[/tex]

where [tex]lgn = log_{2}n[/tex], it's just to make it simpler


any clue?

cheers,
 
Physics news on Phys.org


It looks like you might have an extra factor of [itex]n[/itex] is the second summation. However, consider the sum

[tex]\sum_{i=0}^{\lg{(n)} - 1}\frac{n}{\lg{(n)} - i}[/tex]

Let [itex]u = \lg{(n)} - i[/itex], then [itex]u[/itex] attains values between [itex]1[/itex] and [itex]\lg{(n)}[/itex]. Therefore, summing over this index we find that . . .

[tex]\sum_{i=0}^{\lg{(n)} - 1}\frac{n}{\lg{(n)} - i} = \sum_{u=1}^{\lg{(n)}}\frac{n}{u}[/tex]

As desired.
 


yeah I kinda knew the n wasn't supposed to be there, but i put it in just in case i was wrong. your solution makes total sense, thank you very much!