Jump to content

Help With Recurrence Relation Simplification

straight_stewie

So I have this recurrence relation: a= -an-1 , a= 5.

 

This yields the pattern:

  1. a= -a= -5
  2. a= -(-a0) = -(-5) = 5
  3. a= -(-(-a0) = -(-(-5) = -5
  4. a= -(-(-(-a0) = 1(-(-(-5) = 5

I can deduce the pattern then is to alternate signs. I can turn this into a piecewise function:

  • a= -an % 2 != 0; a= an % 2 == 0

However, I have not been able to reduce the function any further. Is this as far as it goes or can it be reduced more?

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

It doesn't get much simpler than a or -a. But if you just want to make it a single function you could do something like 

-5 * (((n & 1) * 2) - 1)

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

Yeah, that's pretty much it.

Or, alternatively, you can have something like

an=(-1)n*a0

i5 4670k @ 4.2GHz (Coolermaster Hyper 212 Evo); ASrock Z87 EXTREME4; 8GB Kingston HyperX Beast DDR3 RAM @ 2133MHz; Asus DirectCU GTX 560; Super Flower Golden King 550 Platinum PSU;1TB Seagate Barracuda;Corsair 200r case. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Nineshadow said:

an=(-1)n*a0

That's what I was looking for. I just couldn't quite put my finger on that. 

ENCRYPTION IS NOT A CRIME

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×