Probability calculator

under construction...

Sample space S. Events A and B subsets of S.

Sample space size= |S|:
Event A size= |A|:    Probability of A= |A|/|S|= P(A):
Event Ā size= |Ā|:    Probability of Ā= |Ā|/|S|= 1-P(A):
Event B size= |B|:    Probability of B= |B|/|S|= P(B):
#Outcomes in intersection/overlap of A and B: |A∩B|: (0 means disjoint)    P(overlap):

Two events happening together, at same time: Addition rule
Probability of A or B= P(A OR B)=P(A∪B)= P(A)+P(B)-P(A∩B):
Probability of mutually exclusive, or disjoint A or B= P(A OR B)= P(A)+P(B):

Two events happening one after the other: Multiplication rule
Probability of independent A and B= P(A AND B)=P(A∩B)= P(A)*P(B):

Conditional probabilities: A, B dependent
Probability of A given B= P(A|B)= P(A∩B) / P(B):
Probability of B given A= P(B|A)= P(B∩A) / P(A):

B
A ab ab̄ Ar
āb āb̄ r
Bc c T
P(A)= Ar / T
P(A|B) = ab / Bc
If P(A)=P(A|B) then A, B are independent.
and/or
P(B)= Bc / T
P(B|A) = ab / Ar
If P(B)=P(B|A) then A, B are independent.

Ex. Flip 4 coins. |S|=16
A=3 or more H    |A|=5    P(A)=5/16=.3125
B=start w/T    |B|=8    P(B)=8/16=.5
A∩B={THHH}    P(A∩B)=1/16=.0625
|A∪B|=12    P(A∪B)=P(A)+P(B)-P(A∩B)=5/16+8/16-1/16=12/16=3/4=.75
P(A|B)=P(A∩B)/P(B)=1/16 / 8/16= 1/8=.125
P(B|A)=P(A∩B)/P(A)=1/16 / 5/16= 1/5=.2

Ex. Flip 4 coins. |S|=16
A=2 or more H    |A|=11    P(A)=11/16=.6875
B=start w/T    |B|=8    P(B)=8/16=.5
A∩B={THHH,THHT,THTH,TTHH}    P(A∩B)=4/16=1/4=.25
|A∪B|=15    P(A∪B)=P(A)+P(B)-P(A∩B)=11/16+8/16-4/16=15/16=.9375
P(A|B)=P(A∩B)/P(B)=4/16 / 8/16= 1/2=.5
P(B|A)=P(A∩B)/P(A)=4/16 / 11/16= 4/11=.3636

Ex. Flip 4 coins. |S|=16
A=2 or more H    |A|=11    P(A)=11/16=.6875
B=2 or more T    |B|=11    P(B)=11/16=.6875
|A∩B|=6    P(A∩B)=6/16=3/8=.375
|A∪B|=15    P(A∪B)=P(A)+P(B)-P(A∩B)=11/16+11/16-6/16= 1
P(A|B)=P(A∩B)/P(B)=6/16 / 11/16= 6/11=.5454
P(B|A)=P(A∩B)/P(A)=6/16 / 11/16= 6/11=.5454