Sets Flashcards

1
Q

What is specification?

A

Description of what the type does and the method it provides to do it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is implementation?

A

Code that actually does the work

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a set?

A

A set is a group of things, either related or unrelated.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Does a set have to contain a group of things which are related?

A

No, it the set can contain either related or unrelated elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Does the order within a set matter?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Do sets contain duplicates?

A

No

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does ‘aEs’ mean?

A

‘a’ is a member of set ‘s’

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does ‘4E{1,2,3,4}’ mean?

A

‘4’ is a member of set ‘{1,2,3,4}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What would you change to ‘12E{1,2,3,4}’ to show that 12 is not part of the set.

A

Put a horizontal line through the E-like shape

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does ∅ signify?

A

An empty set or a null set.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is U?

A

The universal set

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

{1,2,3,4,5} = {3,2,4,1,5}

Is this correct?

A

Yes, they both equal each other despite the differing order.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

{1,2,3,4,5} = {1,2,3,3,4,2,1,5}

Is this correct?

A

Yes, because within sets duplicates are not important.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

{1,2,3,4} = {1,2,3,4,5}

Is this correct?

A

No, for they do not contain the same elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
S = {2,3,4,5}
T = {1,2,3,4,5,6}

Which, if any, is the subset?

A

S is the subset as all of its elements are contained with T.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does an underline ‘c’ symbol indicate?

For example, XcV?

A

It indicates that the first set is a subset of the second set.
X is a subset of V.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How would you indicate that X is not a subset of V?

A

XcV with ‘c’ being underlined and a horizontal line going though it.

18
Q
S = {1,2,3}
T = {1,2,3,4}

Is S a subset or also a proper subset of T?

A

S is a proper subset of T because it does not equal itself.

19
Q

Can S be a subset of S?

A

Yes, all sets can subsets of themselves.

20
Q

What is the powerset of B = {1,2}?

A

P(B) = { {}, {1}, {2}, {1,2} }

21
Q

What is the powerset of C = {1,2,3}

A

P(C) = { {}, {1}, {2}, {3}, {1,2}, {2,3}, {1,3}, {1,2,3} }

22
Q

What is the powerset of D = {Coleraine, Belfast}

A

P(D) = { {}, {Coleraine}, {Belfast}, {Coleraine, Belfast} }

23
Q

What does |A| mean?

A

The cardinality of A ie the number of elements in set A.

24
Q

What is the cardinality of A = {1,2,3,4,5}

25
What is the cardinality of S = { ∅, {A}, {B}, {A,B} }?
|S| = 4
26
{1,2,3}U{3,4,5} = ?
{1,2,3,4,5}
27
{1,2}U∅ = ?
{1,2}
28
{1,2,3}n{3,4,5} = ?
{3}
29
{1,2}n∅ = ?
30
What is a disjoint set?
Disjoint sets have no elements in common.
31
{1,2,3} - {3,4,5} = ?
{1,2}
32
What does (AUB)' mean?
' means complement. | This means that everything that not within the A and B union.
33
What is the difference between a set and a multiset?
In a set, duplicates are not allowed. | In a multiset, duplicates are allowed.
34
Is {1,2,3,4,4} a set or a multiset?
A multiset because it has duplicates.
35
{a,a,a,b,b,c,c,d,d,d} | What is the multiplicity of a?
3
36
{a,a,a,b,b,c,c,d,d,d} | What is the multiplicity of d?
3
37
{a,a,a,b,b,c,c,d,d,d} | What is the cardinality of the above multiset?
10
38
{1,3,6,1,3,1}U{1,7,6,1,3,6} = ?
{1,1,1,3,3,6,6,7} Only the max number of values from the multiset containing the most is taken.
39
{1,3,6,1,3,1}n{1,7,6,1,3,6} = ?
{1,1,3,6} Only the min number of values is taken from each multiset where each multiset has the same value.
40
In an array 0-4, values with a set are ? when | false, true, true, false, true
{1,2,4}
41
How could you represent this multiset in an array 0-9? | {2,4,7,2,4,2,4,6,6}
{0,0,3,0,3,0,2,1,0,0}