To learn the language of sets and tuples:
A set is an unordered collection of objects.
The following are sets:
Sets don’t inherently have an order.
A set is a finite set if it has a finite number of elements.
Any set that is not finite is an infinite set.
Let \(A\) be a finite set. The number of different elements in \(A\) is called its cardinality.
The cardinality of a finite set is denoted \(|A|\).
A set is a finite set if it has a finite number of elements.
Any set that is not finite is an infinite set.
Let \(A\) be a finite set. The number of different elements in \(A\) is called its cardinality.
The cardinality of a finite set is denoted \(|A|\).
\(\{1,2,3\}\) is a finite set. Its cardinality is \(3\).
A set is a finite set if it has a finite number of elements.
Any set that is not finite is an infinite set.
Let \(A\) be a finite set. The number of different elements in \(A\) is called its cardinality.
The cardinality of a finite set is denoted \(|A|\).
\(\{1,2,3\}\) is a finite set. Its cardinality is \(3\).
“all multiples of 7” is an infinite set. Cardinality here is a little more complicated… We will get back to that!
\(a \in A\) means \(a\) is an element of \(A\).
\(a \notin A\) means \(a\) is not an element of \(A\).
\(a \in A\) means \(a\) is an element of \(A\).
\(a \notin A\) means \(a\) is not an element of \(A\).
Let \(A = \{\)“apples”, “bananas”, “oranges”\(\}\)
“apples” \(\in A\)
“blueberries” \(\notin A\)
\([a,b]\) is the set of whole numbers \(\geq a\) and \(\leq b\).
\((a,b)\) is the set of whole numbers \(> a\) and \(< b\).
\([a,b]\) is the set of whole numbers \(\geq a\) and \(\leq b\).
\((a,b)\) is the set of whole numbers \(> a\) and \(< b\).
\([1,5] = \{1,2,3,4,5\}\)
\((1,5) = \{2,3,4\}\)
\([1,5) = \{1,2,3,4\}\)
Sets are commonly expressed using set notation.
Within braces, we can write a rule consisting of a function, a vertical bar, and a set to which the function is applied.
We can express the set \(\{\frac{1}{2}, \frac{1}{4}, \frac{1}{8} \}\) as…
\(A\) is a subset of \(B\) if and only if every element of \(A\) is an element of \(B\).
Can also be written: \(A \subseteq B\)
Let \(A = \{1,3,5\}\) and \(B = \{1,2,3,4,5\}\).
\(A \subseteq B\).
Let \(A = \{1,2,3\}\) and \(B = \{3,2,1\}\).
\(A \subseteq B\) and \(B \subseteq A\).
\(A = B\) if and only if every element of \(A\) is an element of \(B\) and conversely every element of \(B\) is an element of \(A\). That is, \(A \subseteq B\) and \(B \subseteq A\).
Let \(A = \{1,2,3\}\) and \(B = \{3,2,1\}\).
\(A \subseteq B\) and \(B \subseteq A\), so \(A=B\)
\(A \cap B\) is the set of elements that are both in \(A\) and in \(B\).
\(A = \{\)Apples, Bananas\(\}\)
\(B= \{\)Bananas, Oranges\(\}\)
\(A \cap B =\) {Bananas}
\(A \cup B\) is the set of elements that are in either \(A\) or \(B\).
\(A = \{\)Apples, Bananas\(\}\)
\(B= \{\)Bananas, Oranges\(\}\)
\(A \cup B =\) {Apples, Bananas, Oranges}
A \(k\)-tuple is an ordered sequence of \(k\) elements, which we write down in parentheses, \((a_1,a_2,\ldots,a_k)\).
The most common tuple seen in math is the coordinate pair \((x,y)\) on a graph.
A 2-tuple is commonly called an ordered pair.
Two tuples are equal if and only if all of their corresponding elements are equal. \((a_1,a_2,\ldots,a_k)\) iff for all \(i\in[1,\ldots,k]\) we have \(a_i=b_i\).
The basic operation to create tuples is the Cartesian Product of two sets.
The of \(A\) and \(B\), \(A \times B = \{(a,b)|\) for all \(a \in A\) and for all \(b \in B\}\)
Let \(L=\{a,b,c\}\) and let \(D = \{0,1\}\) \(L \times D = \{(a,0),(a,1),(b,0),(b,1),(c,0),(c,1)\}\) \(D \times L = \{(0,a),(0,b),(0,c),(1,a),(1, b),(1,c)\}\) \(L \times L = L^2 = \{(a,a),(a,b),(a,c),(b,a),(b, b),(b,c),(c,a),(c, b),(c,c)\}\)
The cartesian product is associative: \(D \times(L \times D) = (D \times L) \times D\).
The cartesian product is not necessarily commutative: \(D\times L \neq L \times D\).
Some other structures we may use:
Concatenation is used to join two strings or lists by putting all elements of the second string behind all elements of the first.
The concatenation of “hello” and “world” is “helloworld”.
A series is a sum of a sequence of numbers, replacing commas by plus signs.
Any finite sequence, such as (\(x_1, x_2,\ldots, x_n\)), has a series \(x_1 + x_2 +\ldots+ x_n\) with a well-defined value.
This can also be written with summation notation: \(\sum_{i\in[1,n]}x_i\).
The Sum rule states: Suppose that each element of a set has an assigned type. Then the total number of elements is the sum of the numbers of elements of each type.
The Product rule states: Suppose that elements of a set have features that can be chosen independently. Then the number of elements is the product of the numbers of choices.
The best way to demonstrate what this means is by example…
The permutations of \(n\) distinct items are the set of all \(n\)-tuples that never repeat any item.
Let \(A = \{Bob, Alice, Chris\}\)
All permutations of \(A\):
\(\big\{\{Bob, Alice, Chris\}, \{Bob, Chris, Alice\},\)
\(\{Alice, Chris, Bob\}, \{Alice, Bob, Chris\},\)
\(\{Chris, Bob, Alice\}, \{Chris, Alice, Bob\}\big\}\)
The number of permutations of \(n\) items is \(n!\) (\(n\) factorial).
As a reminder, \(n! = n \cdot (n-1) \cdot (n-2) \cdot \ldots \cdot 1\).
Let \(A = \{Bob, Alice, Chris\}\)
The number of possible permutations of \(A\) is \(3! = 3 \cdot 2 \cdot 1 = 6\).
Let’s go back to our previous example.
You have a set of six different math books, five different philosophy books, and three different religion books.
We want to know the number of ways to arrange three of the 14 books on the shelf and get one of each type.
Let’s break this down…
Let’s draw out why this works…
A \(k\)-combination is a set with \(k\) elements chosen from a set of \(n\) possible items with no repeats.
(Since these are sets, order does not matter!)
Compute all \(2\)-combinations of \(\{a,b,c\}\).
\(\{a,b\},\{a,c\}, \{b,c\}\)
The \(2\)-permutations of \(\{a,b,c\}\) would be \((a,b), (b,a), (a,c), (c,a), (b,c), (c,b)\).
The number of \(k\)-combinations of a set of size \(n\) is \({n \choose k}\), read as “\(n\) choose \(k\)”.
Other ways you may see “\(n\) choose \(k\)” written:
\({n \choose k} = \frac{n!}{k!(n-k)!}\)
Why does this formula work? Some reasoning behind this by example…