PrSAT: First Examples

Philosophy 148

January 31, 2008

First, load in the PrSAT package

See my PrSAT website for instructions on downloading and installing PrSAT (assuming you have Mathematica installed).

<<PrSAT`

Example #1

The first example of a probability model that we saw was the following:

MODEL1 = PrSAT[{Pr[X∧Y]==(1/6),Pr[X∧¬Y]==(1/4),Pr[¬X∧Y]==(1/8),Pr[¬X∧¬Y]==(11/24)}]

PrSAT will show us an STT representation of MODEL1:

TruthTable[MODEL1]

We can use PrSAT to calculate probability, using MODEL1:

EvaluateProbability[{Pr[X∨Y],Pr[X],Pr[Y]},MODEL1]

We can also check arbitrary claims to see if they are true on MODEL1:

EvaluateProbability[Pr[X|Y]>Pr[X],MODEL1]

Example #2

The second example we saw was an algebraic proof of the following theorem:

Pr(X∨Y)==Pr(X)+Pr(Y)-Pr(X∧Y)

PrSAT easily verifies this theorem (note: it does not present a readable proof).

PrSAT[{Pr[X∨Y]≠Pr[X]+Pr[Y]-Pr[X∧Y]}]

This output means there are no probability models on which Pr[X ∨ Y] ≠ Pr[X] + Pr[Y] - Pr[X ∧ Y].  That "proves" that the above statement is a theorem of probability calculus.

Example #3

The second example we saw was an algebraic proof of the following theorem:

Pr(X)==Pr(X∧Y)+Pr(X∧¬Y)

PrSAT easily verifies this theorem (note: it does not present a readable proof).

PrSAT[{Pr[X]≠Pr[X∧Y]+Pr[X∧¬Y]}]

This output means there are no probability models on which Pr[X] ≠ Pr[X ∧ Y] + Pr[X ∧ ¬ Y].  That "proves" that the above statement is a theorem of probability calculus.

Example #4

The next example involves the following theorem:

Pr(X→Y)≥Pr(Y | X)

PrSAT easily verifies this theorem (note: it does not present a readable proof).  First, we need to define the conditional operator.

X_→Y_:=¬X∨Y;

PrSAT[{Pr[X→Y]<Pr[Y|X]}]

This output means there are no probability models on which Pr[X → Y] ≥ Pr[Y | X].  That "proves" that the above statement is a theorem of probability calculus.

Example #5

The next example involves the following theorem:

d(X,Y)=d(X∨Y,Y)+d(X∨¬Y,Y), where d(X,Y)= Pr(X|Y)-Pr(X).

PrSAT easily verifies this theorem (note: it does not present a readable proof).  First, we need to define d(X, Y).

d[X_,Y_]:=Pr[X|Y]-Pr[X];

PrSAT[{d[X,Y]≠d[X∨Y,Y]+d[X∨¬Y,Y]}]

This output means there are no probability models on which d[X, Y] ≠ d[X ∨ Y, Y] + d[X ∨ ¬ Y, Y].  That "proves" that the above statement is a theorem of probability calculus.

Example #6

The next example involves the fact that the following is NOT a theorem:

Pr(X|Y∨Z)=Pr(X|Y∧Z)

PrSAT easily finds a counter-model to this claim.

PrSAT[{Pr[X|Y∨Z]≠Pr[X|Y∧Z]}]

The model PrSAT finds by defualt is non-regular.  We can force it to find a regular counter-model, as follows:

MODEL2=PrSAT[{Pr[X|Y∨Z]≠Pr[X|Y∧Z]},Probabilities->Regular]

Here is an STT representation of MODEL2:

TruthTable[MODEL2]

We can calculate the values of Pr[X | Y ∧ Z], Pr[X | Y ∨ Z] on this model as follows:

EvaluateProbability[{Pr[X|Y∧Z],Pr[X|Y∨Z]},MODEL2]

We can look at decimal representations of these exact real numbers, as follows:

%//N

We gave a different model in the lecture notes.  We can enter that model in by hand, and then verify it has the desired properties, as follows:

MODEL3=PrSAT[{Pr[X∧Y∧Z]==(1/6),Pr[X∧Y∧¬Z]==(1/6),Pr[X∧¬Y∧Z]==(1/4),Pr[X∧¬Y∧¬Z]==(1/16),Pr[¬X∧Y∧Z]==(1/6),Pr[¬X∧Y∧¬Z]==(1/12),Pr[¬X∧¬Y∧Z]==(1/24),Pr[¬X∧¬Y∧¬Z]==(1/16)}]

TruthTable[MODEL3]

EvaluateProbability[{Pr[X|Y∧Z],Pr[X|Y∨Z]},MODEL3]

We can also see the algebraic form of an expression, as follows:

AlgebraicForm[Pr[X|Y∧Z]==Pr[X|Y∨Z],{X,Y,Z}]

Note that PrSAT uses different conventions (i.e., a different ordering in the truth-table) for the (Subscript[𝕒, i]) than I use in the lecture notes.