Finding Formula for recursive definitions

Click For Summary

Homework Help Overview

The discussion revolves around finding a formula for a recursive definition of a function f from the set of nonnegative integers to the set of integers. The original poster is specifically focused on a recursive definition that includes conditions based on the parity of n and seeks to establish a valid formula for f(n).

Discussion Character

  • Exploratory, Conceptual clarification, Mathematical reasoning, Problem interpretation

Approaches and Questions Raised

  • Participants explore the correctness of the recursive definition, with one questioning the parity condition in the definition. Others suggest using a floor function to express the relationship more concisely and propose alternative non-recursive definitions. There is also discussion about proving the formula using induction.

Discussion Status

Several participants have provided insights and alternative formulations, with some expressing gratitude for the guidance received. The original poster acknowledges the help but indicates they are still seeking assistance with the proof of the formula.

Contextual Notes

There is mention of the need to prove the formula using induction, with uncertainty about whether to use mathematical or strong induction. The original poster also notes that the problem is part of a class using the same textbook as another participant.

caseyd1981
Messages
10
Reaction score
0
This is the last part of the problem and I just can not figure out a formula for it. Here is what the question asks:

Determine whether each of these proposed definitions is a valid recursive definition of a function f from the set of nonnegative integers to the set of integers. If f is well defined, find a formula for f(n) when n is a nonnegative integer and prove that your formula is valid.

I'm stuck on part e:

f(0) = 2, f(n) = f(n - 1) if n is odd and n >= 1 and f(n) = 2f(n - 2) if n >=2


I've worked through f(0) - f(9) and I get 2, 2, 4, 4, 8, 8, 16, 16, 32, 32. I just can't seem to figure a formula for this. Any help, much appreciated!
 
Physics news on Phys.org
Are you sure that you have written the definition of the function correctly?
In particular, it seems that the second part should say that f(n) = 2f(n - 2) if n is even and n >= 2.
 
Yes, that is correct. I noticed that too but I typed it exactly the way my book did.
 
Have you defined a floor function? Something like [x]=greatest integer less than or equal to x? That would help you to write it concisely. [n/2] has something in common with your function.
 
It looks to me like this might work as a non-recursive definition for your function:
f(x) = 2^[itex]\left\lfloor(x + 2)/2 \rfloor\right[/itex]

The L-shaped brackets indicate the greatest integer function, which is the greatest integer that is less than or equal to what's inside the brackets.

If the expression in the exponent is an integer, the greatest integer function evaluates to that integer. If the exponent is a non-integer, the greatest integer function essentially chops off the fractional part. For example, the greatest integer in 1 is 1. The greatest integer in 1.5 is 1.

Using the formula above as a check, f(0) = 2^[itex]\left\lfloor(0 + 2)/2 \rfloor\right[/itex]
= 2^1 = 2
f(1) = 2^[itex]\left\lfloor(1 + 2)/2 \rfloor\right[/itex]
= 2^[itex]\left\lfloor(3)/2 \rfloor\right[/itex] = 2^1 = 2

f(2) = 2^[itex]\left\lfloor(2 + 2)/2 \rfloor\right[/itex] = 2^2 = 4
f(3) = 2^[itex]\left\lfloor(3 + 2)/2 \rfloor\right[/itex] = 2^[itex]\left\lfloor 5/2 \rfloor\right[/itex] = 2^2 = 4
 
That is it! Thank you all very much.

Ok, now I need to prove the formula using induction. Kind of stuck there too...?
 
Hello,

I'm in a class that uses the same textbook as caseyd1981. I'm working on this exact same problem. Through looking at relationships between powers of 2 and values of n, I've come up with an explicit formula:
f(n) = [itex]\left\lceil(n + 1)/2 \rceil\right[/itex]

Now, I need to prove it using induction (I'm not sure whether it needs to be mathematical induction or strong induction).

So far, I have this:
Basis case:
f(1) = 2^[itex]\left\lceil(1 + 1)/2 \rceil\right[/itex] = 2^[itex]\left\lceil(2)/2 \rceil\right[/itex] = 2^1 = 2.
Inductive hypothesis:
if f(n) = 2^[itex]\left\lceil(n + 1)/2 \rceil\right[/itex], then f(n+1) = 2^[itex]\left\lceil((n + 1) + 1) / 2\rceil\right[/itex].

However, I'm stuck here, as I don't know how to incorporate the inductive hypothesis f(n) = [itex]\left\lceil(n + 1)/2 \rceil\right[/itex] into f(n+1) = 2^[itex]\left\lceil((n + 1) + 1) / 2\rceil\right[/itex].

Anyone have any suggestions? Thanks for your time!
 
Last edited:

Similar threads

  • · Replies 11 ·
Replies
11
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 22 ·
Replies
22
Views
2K
Replies
7
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
12
Views
2K