Mathematical models for loop calculations



Hi,

I'm looking for an approach to represent calculations within
a loop (of a computer program) by mathematical models. To make
things clear, here is a simple example for a loop that iterates
10 times:

i = 0,
b = 2,
c = 2,
d = 2,
e = 2;

while( i < 10 ) {
a = a + 1;
b = b + b;
c = c * c;
d = d + e;
e = e + 1;
i++;
}

Within the loop, the identifiers 'a'-'e' and 'i' will be updated for
each loop iteration and after the loop execution each symbol is assigned
its final result. I want to omit this approach done by the computer which
adjusts the value for the identifiers 10 time but want to express the
calculations as mathematical models to have a formula that determines
the values (depending on the number of loop iterations).

My first idea was to express the calculations by mathematical series
but I still don't know exactly how to do this. A somehow harder problem
is the calculation of 'd' which depends on the subsequent identifier
'e'.

Do you know any approaches for this? Any comments/solutions are
appreciated.

Best regards,
Tim
.



Relevant Pages

  • Re: Mathematical models for loop calculations
    ... a loop (of a computer program) by mathematical models. ... extracting recursion formulae for _t ...
    (sci.math)
  • Re: Mathematical models for loop calculations
    ... I'm looking for an approach to represent calculations within ... a loop (of a computer program) by mathematical models. ...
    (sci.math)
  • Re: Mathematical models for loop calculations
    ... I'm looking for an approach to represent calculations within ... a loop (of a computer program) by mathematical models. ...
    (sci.math)
  • Re: Bug in win xp: Auto-detaching modeless dialog.
    ... Destroying the dialog is important whether there is a bug or not. ... >I don't think that windows API cares about design flaws. ... >> The whole loop with a sleep in it is a colossal blunder. ... My program does some time consuming calculations and from ...
    (microsoft.public.vc.mfc)
  • Re: Newbie: VB-ADO help
    ... I create a table to store some calculation results because they ... 'END LOOP 1 and LOOP 2 ... -Now I have to loop again for a second set of calculations (dependent on X ... I do not want to deal with SQL and the like. ...
    (microsoft.public.vb.general.discussion)