Sets and Strings Flashcards
Does order matter for substrings and subsets?
Order matters in substring but not subsets
How to calculate number of subset?
2^n where n is the length of the set
Does empty characters matter in strings?
No
Number of substring?
n(n+1)/2
Does order and repetition matter in sets?
No
Size of a set
A set has size n if it contains n different elements
Subsets (⊆)
Let U be a set. Then any collection of element of U is a subset of U
(∪)
The Union Let U and V be two sets. The the union of U and V is the set consisting of all elements of U and all strings of V. (Its like adding the two sets together)
(∩)
The intersection. Let X and Y be two sets. The intersection is X and Y is the collection of all elements which lie in both sets
The difference ()
Let L1, L2 be pair of sets. We define the difference of these two sets, written L1\L2 to be the collection of all elements that are in L1 and not in L2 (its like L1 - L2)
Equal sets
To show two sets equal, A has to be a subset of B and B has to be a subset of A
∣A∣
The size of A