Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: very basic RecurrenceTable puzzle
Replies: 3   Last Post: May 7, 2013 3:53 AM

 Messages: [ Previous | Next ]
 Dana DeLouis Posts: 24 Registered: 11/18/12
Re: very basic RecurrenceTable puzzle
Posted: May 7, 2013 3:53 AM

Hi. Just another idea:

t=UnitStep[Range[-1,10]-2]

{0,0,0,1,1,1,1,1,1,1,1,1}

If your data started at -1, here's another idea.
It only works if your range is fixed:
It's probably not very efficient in this case vs UnitStep.

f=FindSequenceFunction[t]

DifferenceRoot[Function[{\[FormalY],\[FormalN]} . . . etc . . .\[FormalY][4]==1}]]

f /@ (Range[1,12])
{0,0,0,1,1,1,1,1,1,1,1,1}

> st[t] == If[t < 2, st[t - 1], 1

I don't believe the function works like this.
st[t] == st[t-1].
This would be the equation throughout the range.
It would be hard for the equation to switch to another function at a different point in a range.

= = = = = = = = = =
HTH :>)
Dana DeLouis
Mac & Mathematica 9
= = = = = = = = = =

On Saturday, May 4, 2013 4:23:00 PM UTC-4, Alan wrote:
> RecurrenceTable[{st[t] == If[t < 2, st[t - 1], 1], st[-1] == 0}, st, {t, -1, 5}]
>
>
>
> produces
>
>
>
> {0, st[-1], st[0], 1, 1, 1, 1}
>
>
>
> I'm not seeing why the output contains st[-1] and st[0] instead of 0s.
>
>
>
> Note that
>
> RecurrenceTable[{st[t] == st[t - 1], st[-1] == 0}, st, {t, -1, 5}]
>
> produces a list of zeros (i.e., no surprises).
>
>
>
> Thanks,
>
> Alan Isaac

Date Subject Author
5/6/13 Alan
5/7/13 Dana DeLouis