Group Abstract Group Abstract

Message Boards Message Boards

Solve a system of recurrence relations?

Hi all!

I'm new to the Wolfram Forum community and it is a pleasure to be here.

I have a quick question for those who have expertise in the use of Mathematica....

Is Mathematica able to solve the following system of recurrence relations? I'm looking for a "closed-form" formula for w(2n+1).


For n greater than or equal to 3,

w(2n+1) = a(n+1), a(n) = 3*a(n-1) + a(n-2) - a(n-3),

a(0) = 1, a(1) = 2, a(2) = 7, w(1) = 2, w(3) = 7, and w(5) = 22.

Any help is greatly appreciated!

Sincerely, Richard M. Low

richard.low@sjsu.edu

POSTED BY: Richard Low
13 Replies
POSTED BY: Daniel Lichtblau

FullSimplify command does a good job for this.

Attachments:
POSTED BY: Mariusz Iwaniuk

Dear @Richard Low, please spend some time learning how to properly post math notation and code on Wolfram Community:

http://community.wolfram.com/groups/-/m/t/270507

POSTED BY: EDITORIAL BOARD

Hi Daniel,

I apologize for the confusing "thread creep". After consolidating all of the helpful answers (thus far) to my original question, here is the MAIN QUESTION (in concise language):

Find a formula (in compact form; for example: a[n] = .0794367(.460811)^n + .255972(-.675131)^n + .664591(3.21432)^n) which solves the following piecewise-defined recurrence relation b[k]: For integers k greater than or equal to 3, b[k] = b[k-1] + b[k-3] + 2*[.0794367(.460811)^((k-1)/2) + .255972(-.675131)^((k-1)/2) + .664591(3.21432)^((k-1)/2)], if k is odd; b[k] = b[k-1] + b[k-2], if k is even; b[0] = 1, b[1] = 4, b[2] = 5.

I verified (using this piecewise defined recurrence relation, by hand calculations) the correct values: b[0]=1, b[1]=4, b[2]=5, b[3]=10, b[4]=15, b[5]=34, b[6]=49, b[7]=108, b[8]=157, b[9]=348, b[10]=505, etc.

Again, I appreciate all of the help that everybody has given me thus far! We almost have the answer to my question.

Sincerely, Richard M. Low

POSTED BY: Richard Low
POSTED BY: Richard Low
Attachments:
POSTED BY: Mariusz Iwaniuk
POSTED BY: Richard Low

Maybe it is possible to solve with MMA yours "piecewise" defined recurrence equation. Mathematica need a lot of time to solve.My laptop is very cheap.:).I'm used a Maple to solve.

If you have a Maple I attach a file.You must have to change the file extension:

MapleSolution ver2.nb to MapleSolution ver2.mw

Good Luck.

Attachments:
POSTED BY: Mariusz Iwaniuk

Hello Mariusz,

You have been very helpful! Thank you.

Using your advice, w[2n+1] resolves to the following:

w[2n+1] = .0794367(.460811)^(n+1) + .255972(-.675131)^(n+1) + .664591(3.21432)^(n+1).

I do have one last question. Can Mathematica solve (ie., find a "closed-form" formula for b[k]) for the following "piecewise" defined recurrence relation?

For integers k greater than or equal to 3, b[k] = b[k-1] + b[k-3] + 2*[.0794367(.460811)^((k-1)/2) + .255972(-.675131)^((k-1)/2) + .664591(3.21432)^((k-1)/2)], if k is odd; b[k] = b[k-1] + b[k-2], if k is even; b[0] = 1, b[1] = 4, b[2] = 5.

Again, thank you very much for your help.

Solving this "piecewise" defined recurrence relation b[k] is the final part of a research project. I'm very happy to acknowledge your help within the paper and I will email you a copy of it, when I finish typing it up.

Sincerely,

Richard M. Low richard.low@sjsu.edu

POSTED BY: Richard Low

You really should show what you tried. It's not the sort of thing I'd want to guess at.

POSTED BY: Daniel Lichtblau

Maybe so:

Solve for a[n]:

sol = First@ RSolve[{a[n] == 3*a[n - 1] + a[n - 2] - a[n - 3], a[0] == 1, a[1] == 2, a[2] == 7}, a[n], n];
Simplify[ToRadicals[(a[n] /. sol)], Assumptions -> n \[Element] Integers]

(*1/444 (2 (1 + (9 + I Sqrt[111])^(1/3)/3^(2/3) + 
  4/(27 + 3 I Sqrt[111])^(1/3))^
 n (74 + (20 74^(2/3))/(481 + 57 I Sqrt[111])^(
  1/3) + (74 (481 + 57 I Sqrt[111]))^(1/3)) + (1 + (
  I (I + Sqrt[3]) (9 + I Sqrt[111])^(1/3))/(
  2 3^(2/3)) + (-2 - 2 I Sqrt[3])/(27 + 3 I Sqrt[111])^(1/3))^
 n (148 + (20 I 74^(2/3) (I + Sqrt[3]))/(481 + 57 I Sqrt[111])^(
  1/3) + (-1 - I Sqrt[3]) (74 (481 + 57 I Sqrt[111]))^(
   1/3)) + (1 - ((1 + I Sqrt[3]) (9 + I Sqrt[111])^(1/3))/(
  2 3^(2/3)) + (-2 + 2 I Sqrt[3])/(27 + 3 I Sqrt[111])^(1/3))^
 n (148 - (20 74^(2/3) (1 + I Sqrt[3]))/(481 + 57 I Sqrt[111])^(
  1/3) + I (I + Sqrt[3]) (74 (481 + 57 I Sqrt[111]))^(1/3)))*)

Solve for w[n]:

sol2 = First@ RSolve[{w[2*n + 1] == (a[n] /. sol /. n -> n + 1), w[1] == 2, w[3] == 7, w[5] == 22}, w[n], n];
Simplify[ToRadicals[(w[n] /. sol2)], Assumptions -> n \[Element] Integers]

 (*1/222 (1 + (9 + I Sqrt[111])^(1/3)/3^(2/3) + 4/(27 + 3 I Sqrt[111])^(
     1/3))^((1 + n)/
   2) (74 + (20 74^(2/3))/(481 + 57 I Sqrt[111])^(
     1/3) + (74 (481 + 57 I Sqrt[111]))^(1/3)) + 
  1/444 (1 + (I (I + Sqrt[3]) (9 + I Sqrt[111])^(1/3))/(
     2 3^(2/3)) + (-2 - 2 I Sqrt[3])/(27 + 3 I Sqrt[111])^(1/3))^((
   1 + n)/2) (148 + (
     20 I 74^(2/3) (I + Sqrt[3]))/(481 + 57 I Sqrt[111])^(
     1/3) + (-1 - I Sqrt[3]) (74 (481 + 57 I Sqrt[111]))^(1/3)) + 
  1/444 (1 - ((1 + I Sqrt[3]) (9 + I Sqrt[111])^(1/3))/(
     2 3^(2/3)) + (-2 + 2 I Sqrt[3])/(27 + 3 I Sqrt[111])^(1/3))^((
   1 + n)/2) (148 - (
     20 74^(2/3) (1 + I Sqrt[3]))/(481 + 57 I Sqrt[111])^(1/3) + 
     I (I + Sqrt[3]) (74 (481 + 57 I Sqrt[111]))^(1/3))*)
POSTED BY: Mariusz Iwaniuk

Hello Gianluca,

Thank you for your quick reply. I tried your suggestion and Mathematica 11 gives a strange output format. Eventually, I was able to squeeze the answer out by using WolframAlpha, believe it or not!

Now, the main question is the following: Can Mathematica solve (for b[k] and c[r]) the following system of recurrence relations? b[k] is defined for only odd natural numbers, and c[r] is defined for only even non-negative integers.

For n greater than or equal to 3; b[2n+1] = c[2n] + c[2n-2] + 2*a[n], c[2n] = b[2n-1] + c[2n-2], a[n] = .0794367(.460811)^n + .255972(-.675131)^n + .664591(3.21432)^n;

c[0]=1, b[1]=4, c[2]=5, b[3]=10, c[4]=15, b[5]=34.

I seemed to have tried "everything" in Mathematica 11 and WolframAlpha, but nothing seems to work.... Any help is greatly appreciated!

Sincerely, Richard M. Low

POSTED BY: Richard Low

With RSolve you solve for a(n), and then w(k)=a((k-1)/2). Finally you check whether the initial conditions for w are met. To get you started:

RSolve[{a[n] == 3*a[n - 1] + a[n - 2] - a[n - 3], a[0] == 1, 
   a[1] == 2, a[2] == 7}, a, n]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard