Finite Sets Flashcards
What are relations aka, in a database?
Tables
Relations are finite sets of tuples. What are three consequences of them being finite sets?
- Order Independent
- No duplicates
- All tuples have the same type
Define “extensionality” as it applies to sets.
If two sets have the same elements; they are, by definition, the same set.
What are the two principles of sets?
No duplicates - at most one instance of an element in a given set
Order Independant - order does not contribute to the identity of a set
How do we write “u is an element of the set v” in notation?
u ∈ v
What is the union of two sets?
A set of elements in A and B, i.e. every element from each set
What is the intersection of two sets?
Elements that are in both sets A and B.
What is the difference of two sets?
The elements that are in set A but not set B
How do you write the empty set of type T?
ØT
When is A a subset of B?
When all elements in A are also elements in B
What is separation in sets, and how do we write it?
A way of picking out subsets
{x ∈ *A *• *P[x] *}
That is, those elements in A that satisfy the predicate P[x].
E.g: {x ∈ A • x>3}
means the set of elements in A that are greater than 3
Very much like predicates in C#
What is the powerset of a set, how do we notate it, and what is it’s type?
Set of all subsets of a set
P(S)* *where S is a set.
The type is Set(Set(T)) where T is the type of the elements in the set being powersetted.
E.g. S = {0, 1}
P(S) = { ØN, {0}, {1}, {0, 1} }