Maths for Regular Expressions/sets/subsets Flashcards
What is a set and an important rule of sets?
What are the three types of sets?
A set is an unordered collection of values or symbols.
Any value or symbol occurs at most once.
Sets can be common, finite and infinite
What is the notation used for a set?
A = {1,2,3,4,5}
B = {-1,0,3,16,18}
C = {red, orange, yellow}
A set is usually denoted by a capital letter
A member is usually denoted by a lowercase letter
What are some commonly used sets?
Natural numbers, the set of integers, real numbers and rational numbers and empty sets
How is an empty set represented
- A = { Ø } or {} means an empty set
What is the cardinality of a set?
What is the cardinality of sets A and B?
A = {1,2,3}
B = {}
The cardinality of a set is the number of elements in the set. The cardinality of set A is 3 and the cardinality of set B is 0 (empty sets have a cardinality of 0)
What does the symbol | mean?
- the symbol | means “such that”
What does the x represent?
- x represents the values of the set listed after the | symbol
What does N mean?
- N means natural numbers
what does the∊symbol mean?
-The∊symbol indicates membership so x ∊ N is read as “x belongs to N”
What does x >= 1 mean?
- x >=1 means where x is greater or equal to one
What does the ^ symbol mean
The ^ symbol stands for “and”
Why do we use sets?
- Means we can group objects together and view them as a single entity
- A set becomes an abstraction
- Set theory and logic have a close relationship
- Many programming languages support sets as an abstract data type
What is an infinite set?
An infinite set may be countable or uncountable.
- It has an infinite number of elements
(this includes natural, integer and real number sets)
What is a finite set?
- A finite set is one whose elements can be counted off by natural numbers up to a certain number.
- It has a finite number of elements
What is a countably infinite set?
Give examples of countably infinite sets
- Contains an infinite number of elements which can be mapped one to one to the set of of natural numbers.
- Natural and integer numbers are infinite countable sets
What is an uncountably infinite set?
Contains an infinite number of elements which cannot be mapped one to one to the set of of natural numbers. Real numbers are an uncountable finite set
What is compact representation/format?
It uses set comprehension to compact the set into a formula. for example : B = { n2 | n ∊ N ^ n < 5 }
What is the cartesian product of two sets X and Y?
Can be written as X x Y or (X cross Y) is the set of all crossed pairs (x, y) where x is a member of X and y is a member of Y.
X = {1, 3, 5}
Y = {12, 25, 40}
Z = X x Y
Z = {(1, 12), (1, 25), (1, 40), (3, 12), (3, 25), (3, 40), (5, 12), (5, 25), (5, 40)}