[om] Help needed

David Carlisle davidc at nag.co.uk
Wed Feb 9 15:16:46 CET 2005


  Sum (over i=1..n, j=1..m) of H(i,j)


Probably the easiest way is to express it as a double summation

  sum (i=1..n, sum(j=1..m,  H(i,j)))

The first form would look something like

apply
  sum
    integer_interval 1 n
    lambda
      i
      apply
      sum
       integer_interval 1 m
       lambda
        j
       apply
        H
        i
        j


Alternatively you could express it as  a sum over a set:


  sum ( {(i,j) | i=1..n,  j=1..m}, H(i,j))

but in this case it's more convenient if you can express H as a function
of a single variable (which ranges over the set of pairs) rather than
as a function of two variables.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________
--
om at openmath.org  -  general discussion on OpenMath
Post public announcements to om-announce at openmath.org
Automatic list maintenance software at majordomo at openmath.org
Mail om-owner at openmath.org for assistance with any problems



More information about the Om mailing list