Representing mathematical equations

Dave Angel davea at
Mon Oct 6 14:50:48 CEST 2014

varun7rs at Wrote in message:
> Hello,
> I am working on a mathematical equation which I'm finding really hard to express in python. Could any of you spare some time to help me out?
> The equation looks like this
> b(i,x) = [Σ(l∈L) [bd(l) * dist(l) * hc(l)]]  / Σ(l∈L) l
> I have a problem in representing the above equation. I don't know how to use teh loops over here to express b(i,x)
> i,x,l are sets with different numbers

Perhaps you meant  L is a set of numbers,  none repeated.  If you
 really meant l, I have no clue.

As for i and x, they don't appear on the right side so they're a
 red herring. 

I also don't know what bd, dist, and hc are. Are they each a
 function of a single number? Or are they vectors,  indexed by
 int? If so, then presumably L is a set of ints.

How about you express some sample data that you'd like to
 evaluate. For example,  start with
   L = set (1, 4, 3)
   bd = [4.3, 12.11, 93, -0.9, 42]

> I'm sorry if the equation is not expressed in a standard form. I don't have LateX

No problem,  you did a good job expressing it in unicode in a text

Ii Ll  1


More information about the Python-list mailing list