Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having a hard time in Stats understanding some basic rules of probability and set-theory, namely $P(A|B)$, $P(A\ \textrm{and}\ B)$ and $P(A\ \textrm{or}\ B)$ where $A$ and $B$ depend on each other. I use Mathematica all the time through my school, and I love to program in my free-time (sometimes writing small scripts for Mathematica).

I can understand confusing subjects that deal with logic when they are in a programming language syntax, so I thought I could understand what's going on better if I had a written syntax to look at. Will anyone bother to help?

share|improve this question
Are you asking for an example on how to deal with Bayes theorem in Mathematica? – Stefan Jul 18 '13 at 8:02
@Stefan In a way, yes. Basically, what would the code for those three basic rules look like in Mathematica's programming language so that I can play around with it to understand it better? – jocopa3 Jul 18 '13 at 8:12
up vote 4 down vote accepted

The Wolfram Demonstration Project has 13 submissions that use Bayes Theorem: See here

enter image description here

More specifically:

Probability Of Being Sick After Having Tested Positive For A Disease

Bayes's Theorem And Inverse Probability

Total Probability And Bayes's Theorem

All of these will have downloadable code to help you learn this.

Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.