Untitled notebook
Section
collections:
sets:
a set is an unordered collection without repetition:
$ {1,2,4} $ ist the same set as {1, 2, 2, 4}
MapSet.new([1,2,4]) == MapSet.new([1,2,2,4])
to note that an element belongs to a set we use greek letter epsilon:
$1 \in {1, 2, 3}$ means that set includes the number 1
$3 \notin {1, 2, 3}$ means that set does not include the number 3
the epsilon symbol can be also written backwards
$ {1, 2, 3} \ni 1$
$3 \notin {1, 2, 3} \not\ni 3$
MapSet.member?(MapSet.new([1,2,4]), 1)
empty set can be written as
$\emptyset $ or ${}$
MapSet.new()
large sets can be noted as ($\mathbb{Z}$ means that is a set of integers)
${1, 2, 3..100}$ or ${ x \in \mathbb{Z} : 1 \leq x \leq 100 }$ the colon may be replaced by a vertical bar |
MapSet.new(1..100)
MapSet.new(1..100)
MapSet.new([33, 12, 73, 44, 23, 29, 47, 89, 61, 30, 43, 39, 45, 48, 57, 26, 69, 88, 63, 100, 71, 46,
31, 98, 81, 11, 37, 9, 76, 32, 34, 25, 28, 85, 91, 64, 6, 72, 68, 86, 51, 80, 38, 13, 59, 40, 77,
95, 41, 20, ...])