Sets Flashcards
(41 cards)
What is specification?
Description of what the type does and the method it provides to do it.
What is implementation?
Code that actually does the work
What is a set?
A set is a group of things, either related or unrelated.
Does a set have to contain a group of things which are related?
No, it the set can contain either related or unrelated elements.
Does the order within a set matter?
No
Do sets contain duplicates?
No
What does ‘aEs’ mean?
‘a’ is a member of set ‘s’
What does ‘4E{1,2,3,4}’ mean?
‘4’ is a member of set ‘{1,2,3,4}
What would you change to ‘12E{1,2,3,4}’ to show that 12 is not part of the set.
Put a horizontal line through the E-like shape
What does ∅ signify?
An empty set or a null set.
What is U?
The universal set
{1,2,3,4,5} = {3,2,4,1,5}
Is this correct?
Yes, they both equal each other despite the differing order.
{1,2,3,4,5} = {1,2,3,3,4,2,1,5}
Is this correct?
Yes, because within sets duplicates are not important.
{1,2,3,4} = {1,2,3,4,5}
Is this correct?
No, for they do not contain the same elements.
S = {2,3,4,5} T = {1,2,3,4,5,6}
Which, if any, is the subset?
S is the subset as all of its elements are contained with T.
What does an underline ‘c’ symbol indicate?
For example, XcV?
It indicates that the first set is a subset of the second set.
X is a subset of V.
How would you indicate that X is not a subset of V?
XcV with ‘c’ being underlined and a horizontal line going though it.
S = {1,2,3} T = {1,2,3,4}
Is S a subset or also a proper subset of T?
S is a proper subset of T because it does not equal itself.
Can S be a subset of S?
Yes, all sets can subsets of themselves.
What is the powerset of B = {1,2}?
P(B) = { {}, {1}, {2}, {1,2} }
What is the powerset of C = {1,2,3}
P(C) = { {}, {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3} }
What is the powerset of D = {Coleraine, Belfast}
P(D) = { {}, {Coleraine}, {Belfast}, {Coleraine, Belfast} }
What does |A| mean?
The cardinality of A ie the number of elements in set A.
What is the cardinality of A = {1,2,3,4,5}
|A| = 5