Doing probabilistic calculations on a higher abstraction level

老子叫甜甜 提交于 2019-12-02 16:46:36
Gregory Klopper

>> Mathematica does not allow you to say that a symbol x is a vector

Sure it does... Close enough anyway... that it's a collection of Reals. It's called assumptions or conditioning, depending on what you want to do.

Refine[Sqrt[x]*Sqrt[y]]

The above doesn't refine because it assumes X and Y can be any symbol, but if you narrow their scope, you get results:

Assuming[ x > 0 && y > 0, Refine[Sqrt[x]*Sqrt[y]]]

It would be very nice to have the ability to say: Element[x,Reals^2] (2-dimensional real vector), maybe in Mathematica 9. :-)


As for this problem:

>> Could you find a way to find the truth or falsehood in the above and similar equations using a Mathematica program?

Please refer to my answer (first one) on this question to see a symbolic approach to Bayes theorem: https://stackoverflow.com/questions/8378336/how-do-you-work-out-conditional-probabilities-in-mathematica-is-it-possible

Just glanced at this and found an example from the documentation on Condition:

In[1]:= c = x^2 < 30; a = x > 1;

(Sorry for the formatting here...)

In[2]:= Probability[c \[Conditioned] a, x \[Distributed] PoissonDistribution[2]] == 
Probability[c && a, x \[Distributed] PoissonDistribution[2]] / Probability[a, x \[Distributed] PoissonDistribution[2]]

Which evaluates to True and corresponds to a less general version of the first example you gave.

I'll revisit this later tonight if I have time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!