Imagine we wish to calculate the next value of P and Q.
We are given integer constants a,b,c,d and f,g and initial P( oldN ), Q( oldN )
we state that
x(n)= (f * P(n-1) ) + n
y(n)= (g*Q(n-1))
we then put x and y through a 2xn matrix, e.g.:
[login to view URL]
We can then say that
P(n) = a*x(n) + c*y(n)
Q(n) = b*x(n) + d*y(n)
We assume that we have a maximum number of bits for the output M,
thus above is really is put through modulo
P(n) = ( a*x(n) + c*y(n) ) % 2^M
Q(n) =( b*x(n) + d*y(n) )% 2^M
,
[also known as modular exponentiation]
--
I need the above recurrences factored so I can quickly find the answer for any n in the future.
Thus, Given a,b,c,d,f,g, and, nOld = 0 thus supplying P(0), Q(0),
we can instantly calculate a future n, e.g. n=100.
This will immediately return a value of P and Q equivalent to running the above set of simplified equations 100 times.
To be clear, you need to refactor the math system such that we can immediately fast forward N steps in the future, AND NOT BY running the above example equations N times to get to the answer.
-----
If I didnt explain that clearly, you can see an very basic example at website [login to view URL]
by setting x(n) =f*x(n-1)+n, and initial condition x(0)=v
returns an equation x(n) =x(n) = f^n*(1+f^2-2*f)^(-1)*v+f^n*f^2*(1+f^2-2*f)^(-1)*v-f*(1+f^2-2*f)^(-1)+(1+f^2-2 *f)^(-1)*n-f*(1+f^2-2*f)^(-1)*n-2*f^n*f*(1+f^2-2*f)^(-1)*v+f^n*f*(1+f^2-2*f)^( -1)
if I state the initial timestep was 50, given the initial value x(50)=v
e.g. [login to view URL]*x%28n-1%29%2Bn&i_c=x%2850%29%3Dv
,,,, the equation returns in this case what x(nNew) is equal to with any (n) and x(nOld)
-------------------------------------------------------------
More Explanation as to what is required
I need the above equations be jumpable, and thus
Given n=0, I may wish to calculate n=50. I now immediately know P(50),Q(50).
I then take nOld=50, ie have P(50) and Q(50) and calculate P(120), Q(120)
Which will return the same value as if I had simply started with P(0),Q(0) and jumped 100 forward.
Thus, if I want to figure out P(120),Q(120), I have the following options <test steps>
1) Single step forward +1 state 120 times
2) Step forward state twice, such that the sum of both jumps gives 120
3) Step forward +120 states, to immediately give P(120),Q(120).
----------------------------
I need source code to calculate this.
User will supply a,b,c,d,f,g. User will supply nOld (where we are jumping from), nNew(where we are jumping to, and P(nOld), Q(nOld).
Ideally I would like this written in java using BigInteger.
However, may accept it written in other languages (e.g. C) if it is easier enough for me to transfer to Java later.
Need a test program to show the above working with the <test steps> above, to show that they all give the same answer.
You will use mod 8192 for the tests, with a=911, b=691, c= 2733, d=2073
All 3 should be tested for at least destinations 3, 7, 120, 4096, 8192, 8193.
That means for each destination, you need to get the same value for P and Q using all 3 methods in <test steps>
----------------------------
Of course, the above sounds more complicated than it actually is, and anyone good at math and recurrent relations can push this out pretty quickly.
The code and the tests must work correctly, it's of no use to me if it doesn't actually come up with the right answers!
Please don't bid crazy prices - I'm doing this project to save myself time. :-)
Usual buyer disclaimer - all source code and IP written must belong completely to me the buyer.
If you're doing anything unusual in your solution, please let me know first. e.g. I don't want to find out you're using JNI to communicate with matlab.
Looking forward to working with you!
p.s. Please only bid if you know how to do this project. I won't be doing it for you,