#10770: Expectation of probability spaces is defined improperly
------------------------+---------------------------------------------------
Reporter: weigandt | Owner: weigandt
Type: defect | Status: new
Priority: minor | Milestone: sage-4.7
Component: misc | Keywords: Probability, Expectation
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
------------------------+---------------------------------------------------
Comment(by jason):
This is more clear, at least in my mind:
{{{
sage: S='AAABBB'
sage: P=frequency_distribution(S)
sage: P
Discrete probability space defined by {'A': 0.500000000000000, 'B':
0.500000000000000}
sage: X=DiscreteRandomVariable(P, {'A':1, 'B':2})
sage: X.expectation()
1.50000000000000
}}}
That says we want a probability space that calculates the frequency over
the set 'AB' of the letters in the string 'AAABBB'. So we first define
the probability space. Then we create a random variable by assigning the
value 1 to 'A' and 2 to 'B'. Then we can ask for the expectation of the
random variable, which uses the probability space and our mapping of S to
real numbers to correctly calculate the expectation.
I guess the confusing thing before was that the value of 1 was the
frequency of 1, not the actual number 1.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10770#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.