Jump to content

Probability/Set Theory

From Wikibooks, open books for an open world


Introduction

[edit | edit source]

The overview of set theory contained herein adopts a naive point of view. A rigorous analysis of the concept belongs to the foundations of mathematics and mathematical logic. Although we shall not initiate a study of these fields, the rules we follow in dealing with sets are derived from them.

Definition. (Set) A set is a well-defined collection of distinct object(s), which are called element(s).

A set.

Remark.

  • If x belongs to (or is contained in) a set S , we write x∈S.
  • If x does not belong to the set S , we write x∉S.
  • When x and y are equal, denoted by x=y, x and y are different symbols denoting the same object(s). (When x and y are not equal, we write x≠y, and they are different things.)
  • Because of the vagueness of the term "well-defined", some may not accept this "definition" as a definition of set. Sometimes, a set may be left as a primitive notion, i.e., an undefined term.

Example. (Collection that is not "well-defined")

  • The collection of easy school subjects is not a set, since "easy" is not well-defined.

We have different ways to describe a set, e.g.

  • word description: e.g., a set S is the set containing the 12 months in a year;
  • listing: elements in a set are listed within a pair of braces, e.g., S= def {January, March, February, April, May, June, July, August, September, October, November, December};
the ordering of the elements is not important, i.e. even if the elements are listed in different order, the set is still the same. E.g., {January, February, March, April, May, June, July, August, September, October, November, December} is still referring to the same set.
  • set-builder notation:{⏟The set ofx⏟all elements x:⏟such that P(x)⏟the property P(x) holds}
(the closing brace must also be written.)
For example, S= def {x:x is a month in a year}.

Example. (Empty set) The set {} is called an empty set, and it contains no element. It is commonly denoted by ∅ also.

Clipboard

Exercise.

Is {∅} an empty set?

Yes.
No.



Example.

  • apple∈{apple, orange, banana};
  • ∅∈{∅};
  • ∅∉∅.
Clipboard

Exercise.

Select all element(s) belonging to the set {∅,{∅},{{∅}}}.

∅
{∅}
{∅,{∅}}
{{∅}}
{{∅,{∅}}}



Example.

  • Let S1 be the set containing all outcomes from rolling a six-faced dice. Then, we can express the set S1 as {1,2,3,4,5,6}.
  • Let S2 be the set containing all outcomes from tossing a coin. Then, we can express the set S2 as {H,T} where H stands for "heads" and T stands for "tails".
Clipboard

Exercise. Amy participates in a lucky draw where the grand prize is a car. Suppose we say that the outcome is 1 if Amy gets the grand prize, and 0 otherwise, what is the set containing all outcomes?

Solution

The set is {0,1}.

Definition. (Set equality) When two sets are equal, they contain the same elements.

Remark.

  • Equivalently, two sets A and B are equal if each element of A is also element of B and each element of B is also element of A.
  • We use A=B to denote sets A and B are equal (A≠B is used to denote A and B are not equal).

Example.

  • {∅}={x:x is a empty set}.
  • ∅={}≠{{}}={∅}.
  • {2,3,5}={x:x is a prime number that is not greater than 5}

Example. Let S1 be the set containing all odd outcomes from rolling a six-faced dice. Also, let S2 be the set containing all outcomes that are not even from rolling a six-faced dice. Then, S1=S2={1,3,5}.

Definition. (Universal set) Universal set, denoted by U, is the set that contains all objects being considered in a particular context.

Remark.

  • In the context of probability, a universal set, which is usually denoted by Ω instead, is the set containing all outcomes of a particular random experiment, and is also called a sample space.

Example. The sample space of rolling a six-faced dice is Ω={1,2,3,4,5,6}.

Clipboard

Exercise. What is the sample space of tossing a coin? (Use H to stand for the outcome "heads" and T to stand for the outcome "tails".)

Solution

The sample space is Ω={H,T}.

Definition. (Cardinality) Cardinality of a finite set is the number of its elements.

Remark.

  • A set is said to be finite if it is empty set or it contains n∈ℕ elements (ℕ is the set containing all positive integers).
  • Cardinality of set S can be denoted by #(S) (or |S|).
  • Infinite set is a set containing infinite number of elements.
  • We will leave the cardinality of infinite set undefined in this book, but it can be defined, in a more complicated way.

Example.

  • #({{1},2,3})=3.
  • #(∅)=0.
  • ℕ (the set containing each positive integer) is an infinite set.
Clipboard

Exercise.

Calculate #({∅,{∅}}).

0
1
2
3
None of the above.



Example. Let Ω be the sample space of rolling a six-faced dice and S be the set containing all odd outcomes from rolling a six-faced dice. Then, #(S)=3 and #(Ω)=6.

Clipboard

Exercise. A student is asked to show that two sets A and B are equal in a question of his assignment. In that question, one of the given condition is that #(A)=#(B). The student then makes the following argument:

Since #(A)=#(B), it follows that A=B.

Is his argument correct? If not, provides an example of sets A and B such that #(A)=#(B) but A≠B.

Solution

The argument is wrong. We can take, for example, A={1} and B={2}. Then, #(A)=#(B)=1 but {1}≠{2}.

Subsets

[edit | edit source]

We introduce a relationship between sets in this section.

Definition. (Subset) A is a subset of B, denoted by A⊆B if each element of set A is an element of set B.

Remark.

  • If A is not a subset of B, then we write A⊈B.
  • By referring to the definitions of subsets and set equality, we can see that A=B is equivalent to (or if and only if) A⊆B and B⊆A.
  • The notation A⊇B means that A is a superset of B, which means that B is a subset of A.
  • This notation and terminology are seldom used.

Definition. (Venn diagram) A Venn diagram is a diagram that shows all possible logical relations between finitely many sets.

Remark.

  • It is quite useful for illustrating some simple relationships between sets, and making the relationships clear.
  • We may also add various annotations in the Venn digram, e.g. cardinality of each set, and the element(s) contained by each set.

Illustration of subset by Venn diagram:

A ⊆ B (A ≠ B):

*-----------------------*
|                       |
|                       |
|   *----------*        | <---- B
|   |          |        |
|   |    A     |        |
|   |          |        |
|   *----------*        |
*-----------------------*

Example.

  • {1,3}⊆{1,2,3}.

Venn digram:

*--------------------*
|   *----------*  2  | 
|   |    1  3  |     |
|   *----------*     |
*--------------------*
  • {{1}}⊈{1,2,3} ({1}∉{1,2,3}).
  • It can be proved that ∅⊆S for each set S.

Example. Let Ω be the sample space of rolling a six-faced dice and S be the set containing all odd outcomes from rolling a six-faced dice. Then, S⊆Ω.

Clipboard

Exercise. Let P be the set containing all prime outcomes from rolling a six-faced dice. Is P a subset of S?

Solution

No, since 2∈P but 2∉S.


Example. (Intervals) Intervals are commonly encountered subsets of ℝ. If a and b are real numbers such that a<b, then (a,b)= def {x∈ℝ:a<x<b};[a,b)= def {x∈ℝ:a≤x<b};(a,b]= def {x∈ℝ:a<x≤b};[a,b]= def {x∈ℝ:a≤x≤b}. In particular, (−∞,∞)=ℝ.

We also have [−∞,∞], which is the set containing all extended real numbers, i.e., [−∞,∞]=(−∞,∞)∪{−∞,∞}. Such notation is occasionally used. (Extended real number system is obtained by adding ∞ and −∞ to the real number system.)

Definition. (Proper subset) A set A is a proper subset of set B if A⊆B and A≠B;. We write A⊊B in this case.

Remark.

  • If a set A is not a proper subset of B, then we write A⊊̸B (but we rarely write this).
  • The notation A⊋B means that A is a proper superset of B, which means that B is a proper subset of A.
  • This notation and terminology are seldom used.

Example.

  • The set {1,2} is not a proper subset of itself, i.e., {1,2}⊊̸{1,2}.
  • {1}⊊{1,2}.

Definition. (Complement) Let A be a subset of universal set U. The (absolute) complement of A, denoted by Ac, is the set {x∈U:x∉A}.

Example. If A={1,2,3} and U={1,2,3,4,5}, then Ac={4,5}.

Venn diagram:

*-----------------------*
|                       |
|    A           4  5   |
|   *----------*        | 
|   |          |        | <---- U
|   |  1 2  3  |        |
|   |          |        |
|   *----------*        |
*-----------------------*
Clipboard

Exercise.

Find ∅c.

U
{U}
∅
{∅}
None of the above.




Set operations

[edit | edit source]

Probability theory makes extensive use of some set operations, and we will discuss them in this section.

Definition. (Union of sets) The union of set A and set B, denoted by A∪B, is the set {x:x∈A or x∈B}.

Union of two sets is indicated by the red region.

Remark.

  • A∪B is read 'A cup B'.

Example.

  • {apple,orange}∪{orange,red}={apple,orange,red}.

Venn diagram:

*----------------*
|                |
|  red   *-------*--------*
|        | orange|        |
*--------*-------*        |
         |       apple    |
         *----------------*

In the following, some basic properties possessed by the union operation: commutative law and associative law, are introduced.

Proposition. (Properties of union of sets) Let A,B and C be sets. Then, we have

(a) A∪B=B∪A (commutative law);
(b) A∪(B∪C)=(A∪B)∪C (associative law).

Remark.

  • Because of the associative law, we can write the union of three or more sets without ambiguity. For instance, we can write A∪B∪C directly, since A∪(B∪C)=(A∪B)∪C.

Example. Let A1={1,2},A2={3,4,5} and A3={6,7}. Then,

  • ⋃i=13Ai=A1∪A2∪A3={1,2,3,4,5,6,7}
  • ⋃i=23Ai=A2∪A3={3,4,5,6,7}
  • A1∪A3={1,2,6,7}.

(⋃i=mnAi means Am∪Am+1∪⋯∪An (n>m), and ⋃i=m∞Ai means Am∪Am+1∪⋯.)

Definition. (Intersection of sets) The intersection of set A and set B, denoted by A∩B, is the set {x:x∈A and x∈B}.

Intersection of two sets.

Remark.

  • A∩B is read 'A cap B'.

Example.

  • {1,2,3}∩{2,3,4}={2,3}.
  • {1,2,3}∩{4,5,6}=∅.

Definition. (Disjoint sets) Sets A and B are disjoint (or mutually exclusive) if A∩B=∅.

Example. The sets {1,2,3} and {4,5,6} are disjoint.

Remark.

  • I.e., A and B are disjoint if they have no element in common.
  • More than two sets are said to be disjoint if they are pairwise disjoint.

Venn diagram

*-----*       *-----*       *-----*       
|     |       |     |       |     |
|  A  |       |  B  |       |  C  |
*-----*       *-----*       *-----*

(A, B and C are disjoint)
      
*----------------*
|                | <---- D 
| *--*   *-------*--------*               
| |  |   |       |        | 
*-*--*---*-------*        | <--- E
  |  |   |                |
  *--*   *----------------*
   ^
   |
   F

(D, E and F are not disjoint, but E and F are disjoint)

Proposition. (Properties of intersection of sets) Let A,B and C be sets. Then, we have

(a) A∩B=B∩A (commutative law);
(b) A∩(B∩C)=(A∩B)∩C (associative law);

Remark.

  • Likewise, we denote Am∩Am+1∩⋯∩An by ⋂i=mnAi (n>m).
  • Also, we denote Am∩Am+1∩⋯ (never ends) by ⋂i=m∞Ai.
  • For (a), the equation can be interpreted as "distributing" A∪ into the bracket.
  • For (b), the equation can be interpreted as "distributing" A∩ into the bracket.

Example. For every positive integer j, defines Aj={n∈ℕ:n≥j}. Then, ⋂i=110Ai={1,2,3,…}∩{2,3,4,…}∩⋯∩{10,11,12,…}={10,11,12,…}={n∈ℕ:n≥10}=A10.

The following result combines the union operation and intersection operation.

Proposition. (Distributive law) Let A,B and C be sets. Then, the following statements hold.

(a) A∩(B∪C)=(A∩B)∪(A∩C);
(b) A∪(B∩C)=(A∪B)∩(A∪C).

Example. Let A={1,2,3},B={2,3,4} and C={1,5,6}. Verify that the distributive law (a) holds for these three sets, i.e., show that A∩(B∪C)=(A∩B)∪(A∩C) for these three sets A,B,C.

Solution. First, A∩(B∪C)=A∩{1,2,3,4,5,6}={1,2,3}. On the other hand, (A∩B)∪(A∩C)={2,3}∪{1}={1,2,3}.

Clipboard

Exercise. Verify that the distributive law (b) holds for these three sets.

Solution

First, A∪(B∩C)=A∪∅=A={1,2,3}. On the other hand, (A∪B)∩(A∪C)={1,2,3,4}∩{1,2,3,5,6}={1,2,3}.


Definition. (Relative complement) The relative complement of set A in set B, denoted by B∖A, is the set {x:x∈B and x∉A}.

The relative complement of A (left) in B (right) (B∖A), given by the red region.

Remark.

  • If U is the universal set and A is a subset of U, then Ac=U∖A.
  • B∖A is read 'B take away A'.

Example.

  • {1,2,3}∖{1,2}={3};
  • {1,2,3}∖{1,2,3}=∅;
  • {1,2,3}∖{4,5,6}={1,2,3}.

Theorem. (De Morgan's laws) Let B,A1,A2,… be sets. Then, B∖(A1∪A2∪⋯)=(B∖A1)∩(B∖A2)∩⋯ and B∖(A1∩A2∩⋯)=(B∖A1)∪(B∖A2)∪⋯

Remark.

  • Special case: If B=U, then the equations become (A1∪A2∪⋯)c=A1c∩A2c∩⋯ and (A1∩A2∩⋯)c=A1c∪A2c∪⋯.

Example. Let A={1,2,3},B={1,3},C={1,2,3,4}, and let the universal set be U={1,2,3,4,5}. For these three sets A,B,C,

(a) Verify that A∖(B∪C)=(A∖B)∩(A∖C).

(b) Verify that C∖(A∪B)=(C∖A)∪(C∖B).

Solution.

(a) First, A∖(B∪C)=A∖{1,2,3,4}=∅. On the other hand, (A∖B)∩(A∖C)={2}∩∅=∅. So, we have the desired equality.

(b) First, C∖(A∪B)=C∖{1,2,3}={4}. On the other hand, (C∖A)∪(C∖B)={4}∩{2,4}={4}.

Clipboard

Exercise. Verify that (A∪B∪C)c=Ac∩Bc∩Cc for these three sets A,B,C.

Solution

First, (A∪B∪C)c=({1,2,3,4})c={5}. On the other hand, Ac∩Bc∩Cc={4,5}∩{2,4,5}∩{5}={5}.


Definition. (Power set) The power set of a set A, denoted by 𝒫(A), is the set of all subsets of A, i.e., {S:S⊆A}.

Example.

  • 𝒫({1,2})={∅,{1},{2},{1,2}};
  • 𝒫(∅)={∅} (power set of an empty set is not an empty set).

Remark.

  • Power set of a set containing n elements contains 2n elements.

Example. Let Ω={H,T} be the sample space of tossing a coin (H and T stand for "heads" and "tails" respectively). Then, 𝒫(Ω)={∅,{H},{T},{H,T}}.

Clipboard

Exercise. Suppose we toss a coin twice. Then, the sample space of this random experiment is Ω={HH,HT,TH,TT} where HH means "heads" followed by "heads", HT means "heads" followed by "tails", etc. Notice that the order matters, and hence HT is different from TH.

(a) Find the power set 𝒫(Ω). (Suggestion: check whether your power set contains 24=16 elements.)

(b) Define the set S to be the set containing subsets of Ω that includes the outcome HH. That is, S={X⊆Ω:HH∈X}. Find #(S).


Solution

(a) The power set is 𝒫(Ω)={∅,{HH},{HT},{TH},{TT},{HH,HT},{HH,TH},{HH,TT},{HT,TH},{HT,TT},{TH,TT},{HH,HT,TH},{HH,HT,TT},{HH,TH,TT},{HT,TH,TT},{HH,HT,TH,TT}} (b) By observing the power set in (a), we can see that 8 subsets (green one) of Ω contains the outcome HH. So, #(S)=8.

Definition. (n-ary Cartesian product) The n-ary Cartesian product over n sets S1,…,Sn, denoted by S1×⋯×Sn, is {(s1,…,sn):si∈Si for each i∈{1,…,n}}.

Remark.

  • It can be proved that #(S1×⋯×Sn)=#(S1)×⋯×#(Sn).
  • (s1,…,sn) is ordered, i.e., the order matters for the things inside it.
  • When n=2, (s1,s2) is called an ordered pair.
  • It is common to use ℝn to denote ℝ×ℝ×⋯×ℝ⏟n times.

Example. Let A={1,2},B={2,3} and C={3,4}. Then,

  • A×B={(1,2),(1,3),(2,2),(2,3)}.
  • B×C={(2,3),(2,4),(3,3),(3,4)}.
  • A×B×C={(1,2,3),(1,2,4),(1,3,3),(1,3,4),(2,2,3),(2,2,4),(2,3,3),(2,3,4)}.
Clipboard

Exercise. A restaurant offers a set lunch where the customer can choose one food/drink from each of group A,B,C:

  • group A: egg, beacon
  • group B: steak, salmon
  • group C: tea, milk, water

We define the sets A,B,C, corresponding to these three groups A,B,C:

  • A={egg,beacon}
  • B={steak,salmon}
  • C={tea,milk,water}

(a) Find the set A×B×C, which contains every possible combination of choices made by the customer.

(b) Suppose the tea in the restaurant is out of stock, so the customer cannot choose tea in group C now. Suppose the set A×B×C∗ now contains every possible combination of choices made by the customer. What should be the set C∗? What is the cardinality of the set A×B×C∗?

Solution

(a) The set A×B×C is given by A×B×C={(egg,steak,tea),(egg,steak,milk),(egg,steak,water),(egg,salmon,tea),(egg,salmon,milk),(egg,salmon,water),(beacon,steak,tea),(beacon,steak,milk),(beacon,steak,water),(beacon,salmon,tea),(beacon,salmon,milk),(beacon,salmon,water)} (b) The set C∗ should be {milk,water}. The cardinality of the set A×B×C∗ is 2×2×2=8.