Skip to the content.

Set theory

Statistics relies extensively on probability theory. In turn, probability theory relies extensively upon set theory - indeed, the most commonly accepted axiomatic foundations of probability are defined using set theory.

Table of contents

  1. Experiments, sample spaces, and events
  2. Set theory
  3. Elementary set operations
  4. Examples in R

🡻

1. Experiments, sample spaces, and events

Consider the result of rolling a numbered six-sided die. The act of rolling the die is an experiment; the value on the side of the die facing upward is an outcome, and the set of outcoms of observing either the sides labeled 1, 2, 3, or 4 facing upward, respectively, is an example of an event:

Figure 1.1

Note: The definition of an experiment is intentionally flexible, allowing almost any process to be labeled as an experiment.

References:

🡹 🡻

2. Set theory

Set theory provides a formal mathematical way of describing a collection of elements, thereby providing a rigorous framework to characterize the possible outcomes of an experiment.

Consider the set Ω = { 1, 2, 3, 4, 5, 6 }. There are several operators we can use to indicate whether elements are in a set or not:

There are several special sets worthy of note:

Sets can be categorized as being…

The sample space, then, is a type of set, and an event is any subset of the sample space, allowing us to use all of the tools of set theory to describe the outcomes for the experiment of interest.

References:

🡹 🡻

3. Elementary set operations

Three key operations that allow us to describe how sets do or don’t overlap are:

Furthermore, sets A and B are mutually exclusive or disjoint when no elements in either set overlap; A ∩ B = ∅.

Figure 1.2

With care, one can treat set operations in a similar manner to addition or multiplication. For example, given any three events, A, B, and C, which are subsets of sample space Ω, we have:

The operations of union and intersection can be extended to a collection of sets, up to an infinite number of sets:

\[\cup_{i=1}^{\infty} E_i = \{ x \in \Omega : x \in E_i \text{ for some i} \}.\] \[\cap_{i=1}^{\infty} E_i = \{ x \in \Omega : x \in E_i \text{ for all i} \}.\]

The collection of events E1, E2, . . ., are pairwise disjoint if Ei ∩ Ej = ∅ for all i ≠ j.

References:

4. Examples in R

# Example sample space
S <- c( 1, 2, 3, 4, 5 )
# Subsets/Events
A <- c( 1, 2, 3 )
B <- c( 1, 3, 5 )

# Test if element is in set
is.element( 1, S ) # Returns: TRUE
is.element( 6, S ) # Returns: FALSE

# Elementary set operations
union( A, B ) # Returns: 1 2 3 5
intersect( A, B ) # Returns: 1 3
# Complement of 
setdiff( S, A ) # Returns: 4 5 6
# Complement of B
setdiff( S, B ) # Returns: 2 4 6

🡹

Coming soon

Return to: Probability; Sections; Index; Home page