Recurrence Relations, finding f(n)

Click For Summary
SUMMARY

The discussion focuses on solving the recurrence relation f(n) = f(n/2) + 1 for n = 2^k, with the initial condition f(1) = 1. The participant identifies that for n = 2^k, the function can be expressed as f(2^k) = k + 1, derived from calculating specific values of f(n) for powers of two. The participant suggests using mathematical induction to prove this formula, confirming that the approach is valid and straightforward.

PREREQUISITES
  • Understanding of recurrence relations and their properties
  • Familiarity with mathematical induction as a proof technique
  • Basic knowledge of logarithmic functions and their applications
  • Experience with evaluating functions at specific values
NEXT STEPS
  • Study the principles of solving recurrence relations, particularly the Master Theorem
  • Learn about mathematical induction and its applications in proofs
  • Explore the concept of logarithms in relation to algorithmic complexity
  • Practice deriving closed-form solutions for various recurrence relations
USEFUL FOR

Students studying discrete mathematics, computer science majors focusing on algorithms, and educators teaching recurrence relations and mathematical proofs.

ramenmeal
Messages
4
Reaction score
0

Homework Statement


Find f(n) when n = 2^k, where f satisfies the recurrence realtion f(n) = f(n/2) +1 with f(1) = 1

Homework Equations


f(n) = a*f(n/b) + c
when n = b^k, where k is a positive integer,
f(n) = C1n^(log a base b) + C2

C1 = f(1) +c/( a-1) and C2 = -c/ (a-1)

keep in mind i may be trying to use the wrong equation...

The Attempt at a Solution



a =1, b = 2, c = 1

then C1 = 1+ 1/0 and C2 = -1/0

i'm not sure what i can do from here... c1 and c2 both include undefined #'s

perhaps I'm not even approaching the problem correctly?
 
Physics news on Phys.org
Hi,
Now I am not sure if I understood it correctly, but it seems to be much simpler:
if n = 2^k and f(n) = f(n/2) + 1
f(n) = f(2^k) = f(2^(k-1)) + 1 = ... = f(2^(k-j)) + j

Now, the answer should be obvious.
 
I would start by calculating some values. f(20)= f(1)= 1, f(21)= f(2)= f(1)+ 1= 2, f(22)= f(4)= f(2)+ 1= 3, f(23)= f(8)= f(4)+1= 4, f(24)= f(16)= f(8)+ 1= 5. Looks obvious to me. Of course, you still have to prove that obvious "guess". Proof by induction should work.
 

Similar threads

  • · Replies 11 ·
Replies
11
Views
2K
Replies
8
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 20 ·
Replies
20
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K