Recursie Algorithms. Is my solution ok?

  • Thread starter Thread starter ptex
  • Start date Start date
  • Tags Tags
    Algorithms
Click For Summary

Homework Help Overview

The discussion revolves around solving a recurrence relation given specific initial conditions. The recurrence relation is defined as an = 7an-1 - 12an-2 with initial values a0 = 3 and a1 = 10. Participants are exploring how to express the solution as a formula in terms of n rather than previous terms.

Discussion Character

  • Exploratory, Conceptual clarification, Problem interpretation

Approaches and Questions Raised

  • Participants are attempting to derive a non-recursive formula for the recurrence relation. Some are questioning the meaning of the task, while others are providing examples of similar problems to clarify the expectations. There are also attempts to compute specific terms of the sequence.

Discussion Status

The discussion is ongoing, with various interpretations of the problem being explored. Some participants have provided examples and attempted calculations, while others have pointed out the need for an exact algebraic solution. Guidance has been offered regarding the nature of the solution required.

Contextual Notes

There appears to be confusion regarding the expectations for the solution format, with some participants expressing uncertainty about the algebraic manipulation required to derive the formula. Additionally, there are references to previous problems that may influence current understanding.

ptex
Messages
42
Reaction score
0
Code:
This is the question I must solve;
Solve the given recurrence relation for the given inital conditions.
(This means give a formula in terms of n, not in terms of previous entries)
a[sub]n[/sub] = 7a[sub]n-1[/sub] - 12a[sub]n-2[/sub]
a[sub]0[/sub] = 3 a[sub]1[/sub] = 10
Now I am not sure what that means but I think this will solve the question 

let me know if I am not even close;
Input = n
Output = X(n)

procdure find(n)
 if n = 3 or n = 10 then
  return (n)
 return(find(n-1)+find(n-2))
end find(n)
 
Physics news on Phys.org
I'm fairly certain that what they are looking for is a single equation for a as a function of n. Simple example:

Given: an = an-1 + 1
and a0 = 11

Then:

an = 11+n
 
Code:
Solve the given recurrence relation for the given inital conditions.
(This means give a formula in terms of n, not in terms of previous entries)
a[sub]n[/sub] = 7a[sub]n-1[/sub] - 12a[sub]n-2[/sub]
a[sub]0[/sub] = 3 a[sub]1[/sub] = 10

So;
a[sub]2[/sub] = 7a[sub]2-1[/sub] - 12a[sub]2-2[/sub]
a[sub]2[/sub] = 7a[sub]1[/sub] - 12a[sub]0[/sub]
a[sub]2[/sub] = 7(10) - 12(3)
a[sub]2[/sub] = 70 - 36
a[sub]2[/sub] = 34?
 
Oh not that again I thought I was done with that. Ok I know what to do thanks again.
 
I come up with all mixed fractions when I get a using the same method as I did on that problem? So that does not work.
 
It works. You need to work on your algebra.
 

Similar threads

Replies
26
Views
3K
  • · Replies 16 ·
Replies
16
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
Replies
12
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K