Expected Value

Steven D'Aprano steve at REMOVETHIScyber.com.au
Mon Sep 12 08:08:32 EDT 2005


On Sat, 10 Sep 2005 17:50:06 -0700, George wrote:

> How would I get the expected value out of this information. I have
> tried many times to understand this but am unable to.

Do you have a specific Python problem here, or do you need help with the
maths? If Python, please tell us what your problem is. If your problem is
with the maths, then a statistics and/or probability forum is probably
going to be more useful to you.

If you are having a problem with the code, not the maths, I frequently
find that it helps to reduce the problem. Instead of calculating the
expectation of a discrete pdf with one hundred thousand values, start with
a toy problem: write code that calculates the expectation of a pdf with
only five values. That is small enough that you can experiment using the
interactive Python interpreter, and if need be calculate the correct
answer with paper and pencil.

You might also find it useful to read this:

http://www.catb.org/~esr/faqs/smart-questions.html


-- 
Steven.




More information about the Python-list mailing list