4.4.2.2 Maths for regular expressions Flashcards

1
Q

What is a set?

A

an unordered collection of values in which each value occurs at most once.
X = {1,2,3,…}
… shows the set continues in the obvious way infinitely
{} = empty set

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

What is set building?

A

The process of creating sets by describing them using notation rather than listing the elements
e.g {x | x ∈ ℕ ∧ x ≥ 1 }

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

What is a member?

A

Describes a value or element that belongs to a set

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

What is a proper subset?

A

Where one set is wholly contained within another
Proper subset - the set that isn’t the subset contains some values not found in the subset
A ⊂ B where A is a proper subset of B
A ⊆ B where A is a subset of B

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

What is cardinality?

A

Number of elements in a finite set

X = {1,2,3} cardinality = 3

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

What is a countably infinite set?

A

Infinite set - set where the elements go on forever
… shows the set continues in the obvious way infinitely

Countable set - a set which can be counted off against a subset of natural numbers

Sets where the elements can be put into a one-to-one correspondence with the set of natural numbers
one that can be counted off by the natural numbers.
e.g set of N, you can count off each item of the set, but R is not because you can’t list all the numbers of the set, you don’t know what number is next

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

What is a cartesian product?

A

Combining the elements of two or more sets to create a set of ordered pairs.
Cartesian product of two sets, A and B,written A x B and read ‘A cross B’, is the set of all ordered pairs (a, b) where a is a member of A and b is a member of B.
e.g
A = {9, 57, 104}
B = {33, 66, 99}
C = {(9,33),(9,66),(9,99),(57,33)etc.}

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

Union

A

Where two sets are joined and all the elements of both sets are included in the joined set. If there are duplicates of the same value in two sets then you only keep one instance
Venn diagram - everything filled in

print (A | B)

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

Intersection

A

Describes which elements are common to both sets when two sets are joined - the duplicates (middle shaded in)

print (A & B)

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

Difference

A
Describes which elements differ when two sets are joined together - in venn diagram just one circle but without intersection. Everything which is set A but not in set B
A = {1,2,3,4,5}
B = {1,3,5,7,9}
A \ B = {2,4}
print (A ^ B)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a finite set?

A

A set whose elements can count up to a particular number using natural numbers, i.e the set has an end value

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