Mathematical models for loop calculations
- From: Tim Frink <plfriko@xxxxxxxx>
- Date: Wed, 26 Sep 2007 15:10:19 +0200
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
.
- Follow-Ups:
- Re: Mathematical models for loop calculations
- From: Chris F Clark
- Re: Mathematical models for loop calculations
- From: Paul E. Black
- Re: Mathematical models for loop calculations
- Prev by Date: Generalized Quine-McCluskey
- Next by Date: Re: Data structure behind Google Suggest
- Previous by thread: Generalized Quine-McCluskey
- Next by thread: Re: Mathematical models for loop calculations
- Index(es):
Relevant Pages
|