Proving f(n) = O(log n) with Induction

  • Thread starter Thread starter EvLer
  • Start date Start date
  • Tags Tags
    Induction
Click For Summary
SUMMARY

The function f(n) = f(n-1) + 1/n is proven to be O(log n) using mathematical induction. The key step involves recognizing that f(n) can be expressed as f(n) = a_{0} + ∑(i=1 to n) (1/i), where a_{0} is a constant. The growth of the harmonic series, which is approximated by log n, establishes that log n serves as an upper bound for f(n) when n > 2. This conclusion is supported by graphical analysis of the harmonic series versus log n.

PREREQUISITES
  • Understanding of Big O notation
  • Familiarity with mathematical induction
  • Knowledge of harmonic series
  • Basic graph analysis skills
NEXT STEPS
  • Study the properties of the harmonic series and its relation to logarithmic functions
  • Learn about mathematical induction techniques in algorithm analysis
  • Explore advanced topics in asymptotic notation
  • Investigate graphical methods for comparing function growth rates
USEFUL FOR

Students and professionals in mathematics, computer science, and algorithm analysis who are interested in understanding function growth rates and the application of induction in proving complexity classes.

EvLer
Messages
454
Reaction score
0
How can I show that function defined as

f(n) = f(n-1) + 1/n is O(logn) ?

Do I need to use induction here?

Thanks in advance.
 
Physics news on Phys.org
Note that, by induction, you have:
[tex]f(n)=a_{0}+\sum_{i=1}^{n}\frac{1}{i}[/tex]
where [tex]a_{0}[/tex] is some constant.
Now, you need to find "how fast" the harmonic series grows..
 
Last edited:
Thanks for reply.
Would it be right to describe it as:
for n0 > 2, c = 1, then f(n) < c * g(n) ?
Looking at the graphs, or rather how the harmonic series behaves compared to the graph of logn, it is kind of obvious that logn is the upper bound.
Thanks again.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
Replies
25
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 95 ·
4
Replies
95
Views
7K
  • · Replies 10 ·
Replies
10
Views
5K
  • · Replies 19 ·
Replies
19
Views
4K