Axiomatic Probability

4.4. Axiomatic Probability#

Axiomatic Probability is a mathematical framework for Probability that:

  • is not based on a particular application or interpretation,

  • agrees with models based on relative frequency and fair experiments,

  • agrees with intuitive notions of how probability should operate (where appropriate), and

  • is useful for solving real-world problems.

Axiomatic Probability is built upon a probability space, which consists of the sample space (the set of all outcomes), the event class (the set of all events to which we assign probability), and a probability measure (a set function that assigns probabilities to each event). “Axiomatic” refers to the use of axioms, which are a minimal collection of properties that the probability measure must satisfy.

Axiomatic Probability is not only for basic probability. It forms a foundation upon which single random variables, jointly distributed random variables, and random processes can be rigorously defined.

Section 4.4 of Foundations of Data Science with Python introduces readers to the basics of probability spaces and Axiomatic Probability. Examples are used to illustrate computing probabilities using Axiom III, which shows that the probabilities of the unions of disjoint events can be computed as the sum of the probabilities of the individual events. The Axioms of Probability are then used to build up a more powerful set of tools in the following section, which covers Corollaries to those axioms.

Self-Assessment:

The following questions can be used to check your understanding of the material covered in this chapter: \(~~ \!\!\)

Terminology Review

Use the flashcards below to help you review the terminology introduced in this chapter. \(~~~~ ~~~~ ~~~~\)

Code for Example of Rolling a Fair Die Twice

Here is the code to generate the tables of outcomes and events for the examples of rolling a fair die twice. This code relies on the termcolor module. If that is not installed, you can try to uncomment the line below and run it to install via pip.

#!pip install termcolor

This first table shows the event \(E_1\) in blue:

from termcolor import colored
bold = '\033[1m'

print('Outcomes in E1 are in bold and blue:')
for j in range(1, 7):
    for k in range(1, 7):
        if j < 3:
            print(colored(bold + f'({j}, {k})   ', 'blue'), end='')
        else:
            print(f'({j}, {k})   ', end='')
    print()
Outcomes in E1 are in bold and blue:
(1, 1)   (1, 2)   (1, 3)   (1, 4)   (1, 5)   (1, 6)   
(2, 1)   (2, 2)   (2, 3)   (2, 4)   (2, 5)   (2, 6)   
(3, 1)   (3, 2)   (3, 3)   (3, 4)   (3, 5)   (3, 6)   
(4, 1)   (4, 2)   (4, 3)   (4, 4)   (4, 5)   (4, 6)   
(5, 1)   (5, 2)   (5, 3)   (5, 4)   (5, 5)   (5, 6)   
(6, 1)   (6, 2)   (6, 3)   (6, 4)   (6, 5)   (6, 6)   

Table with \(E_2\) highlighted in green:

print('Outcomes in E2 are in bold and green:')
for j in range(1, 7):
    for k in range(1, 7):
        if k < 3:
            print( colored(bold + f'({j}, {k})   ', "green"), end="")
        else:
            print(f'({j}, {k})   ', end='')
    print()
Outcomes in E2 are in bold and green:
(1, 1)   (1, 2)   (1, 3)   (1, 4)   (1, 5)   (1, 6)   
(2, 1)   (2, 2)   (2, 3)   (2, 4)   (2, 5)   (2, 6)   
(3, 1)   (3, 2)   (3, 3)   (3, 4)   (3, 5)   (3, 6)   
(4, 1)   (4, 2)   (4, 3)   (4, 4)   (4, 5)   (4, 6)   
(5, 1)   (5, 2)   (5, 3)   (5, 4)   (5, 5)   (5, 6)   
(6, 1)   (6, 2)   (6, 3)   (6, 4)   (6, 5)   (6, 6)   

Table with the outcomes that are in both \(E_1\) and \(E_2\) shown highlighted in red:

print('Outcomes in both E1 and E2 are in bold and red:')
for j in range(1, 7):
    for k in range(1, 7):
        if j < 3 and k < 3:
            print( colored(bold + f'({j}, {k})   ', 'red'), end='')
        else:
            print(f'({j}, {k})   ', end='')
    print()
Outcomes in both E1 and E2 are in bold and red:
(1, 1)   (1, 2)   (1, 3)   (1, 4)   (1, 5)   (1, 6)   
(2, 1)   (2, 2)   (2, 3)   (2, 4)   (2, 5)   (2, 6)   
(3, 1)   (3, 2)   (3, 3)   (3, 4)   (3, 5)   (3, 6)   
(4, 1)   (4, 2)   (4, 3)   (4, 4)   (4, 5)   (4, 6)   
(5, 1)   (5, 2)   (5, 3)   (5, 4)   (5, 5)   (5, 6)   
(6, 1)   (6, 2)   (6, 3)   (6, 4)   (6, 5)   (6, 6)   

Table with all the outcomes that belong to \(E_1 \cup E_2\) shown highlighted with a yellow background.

print('Outcomes in  E1 union E2 are bold on a yellow background:')
count = 0

for j in range(1, 7):
    for k in range(1, 7):
        if j < 3 or k < 3:
            print( colored( bold + f'({j}, {k})   ', on_color='on_yellow'),
                end="",
            )
            count += 1
        else:
            print(f'({j}, {k})   ', end='')
    print()

print()
print('Number of outcomes in E1 OR E2 is', count)
Outcomes in  E1 union E2 are bold on a yellow background:
(1, 1)   (1, 2)   (1, 3)   (1, 4)   (1, 5)   (1, 6)   
(2, 1)   (2, 2)   (2, 3)   (2, 4)   (2, 5)   (2, 6)   
(3, 1)   (3, 2)   (3, 3)   (3, 4)   (3, 5)   (3, 6)   
(4, 1)   (4, 2)   (4, 3)   (4, 4)   (4, 5)   (4, 6)   
(5, 1)   (5, 2)   (5, 3)   (5, 4)   (5, 5)   (5, 6)   
(6, 1)   (6, 2)   (6, 3)   (6, 4)   (6, 5)   (6, 6)   

Number of outcomes in E1 OR E2 is 20