On Dec 1, 1:48 am, "William Stein" <[EMAIL PROTECTED]> wrote:
> [Another response in this thread from David Kohel (who maybe should be > posting on list)] > Actually, I correct myself -- the average should be over the values > of the function, weighted by the probabilities. The domain of the > function (the keys) can be in any set (e.g. "A","B","C"), so the > current behavior is correct. David, I have to say the current behavior seems anomalous at best. >From what I can tell, since a probability space is just a normalized measure space, the underlying set on which the measure is defined need not be something for which linear combinations like A P(A) + B P(B) + C P(C) + ... is defined. If such linear combinations are not defined, then DiscreteProbabilitySpace.expectation should throw an exception. Maybe the expectation function should be moved out of the probability space base class (I don't know what that is in Sage) and into some subclass which can guarantee the operation succeeds. Just a thought. FWIW Robert Dodier --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---