3

What is the proper mathematical notation for a loop structure such as the following?

FOR i=1 to 10 BEGIN
{Perform loop task}
END;

I am a programmer, but prefer to work on paper and so I am slowly teaching myself notation as a shorthand way to do this.

Thanks.

1 Answers1

1

For addition or multiplication (and therefore also subtraction and division), there exists two symbols; both $\sum$ and $\prod$, respectively.

For example, if you want to add the numbers from 1 to 100, you would put the following -

$\sum^{100}_{i = 1}i$

Or, if you wanted to multiply the square of numbers from 3 to 70, you would put the following -

$\prod_{2 < i < 71} i^2$

Hopefully these examples clarify one possibility for loop notation (there may be others I am not aware of).

Cisplatin
  • 4,675
  • 7
  • 33
  • 58
  • 1
    Thanks. I'm familiar with sigma summation notation - but is there a similar way to declare that structure to perform a series of tasks rather than just summation? – Stackguest Apr 14 '13 at 17:17