Question: Bug: Incompatibility between Statistics and RealDomain packages

See the below. The two answers should be identical, but they are not.

Input:

restart:
with(Statistics):
with(RealDomain):
n1:=RandomVariable(Normal(0,1)):
n2:=RandomVariable(Normal(0,1)):
Mean(exp(n1)*exp(r*n1+sqrt(1-r^2)*n2));
Mean(exp(n1+r*n1+sqrt(1-r^2)*n2));

Output:

exp(1)
exp(1 + r)

 

Please Wait...