Data Representation 1 Flashcards
What are Natural Numbers (N)?
positive integers (whole numbers) including 0.
N = {0, 1, 2, 3 …}
(infinite amount so impossible to define the set entirely)
What are Integer Numbers (Z)?
Whole numbers that can be positive or negative.
Z = { -3, -2, -1, 0, 1, 2, 3}
The natural number set is inside of Z
What are Rational Numbers (Q)?
Any number that can be expressed as a fraction: (integer over integer), or decimal that has a finite number of place or a repeating set.
5/1, 8, -3, 7/8, 12/15
N+Z are inside Q
What are Irrational Numbers?
Numbers that cannot be expressed as a fraction and are often special cases.
Pi, Root 2, e, Golden Ratio
What are Real Numbers (R)?
All of the sets of numbers are considered real. Any numerical value.
-4/5, root 9, -100/50
What are Ordinal Numbers?
Ordinal numbers indicate the positions of the values.
e.g. {“alpha”, “beta”, “gamma”}
the object “alpha” is the 1st, “beta” is the second and so on.
What is a Finite Set?
A set that had a limited number of elements.
{2, 3, 4}
What is an Infinite Set?
A set that has an unlimited number of elements.
What is Cardinality?
The number of elements in a set.
e.g. how many eggs in a box.
{2, 4, 6, 8}
cardinality 4.
What is a Countable Set?
The elements in a set can be tallied.
natural integer(s)
What is a Countably Infinite Set?
Elements that can be tallied but the end would not be reached.
• N (natural numbers)
• Z (integer numbers)
What is an Empty Set?
Represented by either {} or the symbol 0(w a cross).
The empty set has no elements.
An empty set has a cardinality of 0. It does not contain 0.
What are Subsets?
When all the elements of one set are contained in another- it is a subset.
Symbol: less than but curved
If the subset has fewer elements than the other, it is a PROPER subset.
AcB
What is Difference?
(set operation)
Can be written as A|B or A - B. Takes one set from another.
A = { 1, 3, 4, 6, 7, 8 }
B = { 0, 3, 5, 6, 7, 9 }
A - B = { 1, 4, 8 }
What is Intersection?
(set operation)
joins two sets together such that the resulting set contains elements common to both.
(elements can only appear once in the new set).
A = { 1, 3, 4, 6, 7, 8 }
B = { 0, 3, 5, 6, 7, 9 }
AnB = { 3, 6, 7 }
What is Union?
(set operation)
Joins two sets together so that the new set is a combination of both original sets.
Each value in a set can only appear once.
A = { 0, 1, 3, 5, 7, 9 }
B = { 0, 2, 4, , 8 }
AuB = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }
What is the CARTESIAN Product?
(set operation)
The set of all possible ordered pairs whose first component is a member of the first set and whose second component is a member of the second set.
A = { 1, 2, 3 }
B = { A, B }
A x B = { (1, A), (1, B), (2, A), (2, B), (3, A), (3, B) }
What is Unsigned binary (used for)?
To represent positive numbers
What is Signed binary (used for)?
To represent negative numbers
How do you calculate the range of numbers that can be represented by a given number of bits?
2^n - 1
How do you calculate the Absolute Error?
given value - actual value
How do you calculate the Relative Error?
absolute error/actual value
Why are Floating Point Numbers normalised?
To provide maximum level of precision for a given number of bits.
What are the Advantages and Disadvantages to Floating Point?
Allows for representation of a greater range of values with a given number of bits than fixed point.
(this is because FP can take advantage of positive and negative exponents)
Large Exponent + Small Mantissa = Large range, Little precision
Small Exponent + Large Mantissa = Small range, good precision
What are the Advantages and Disadvantages to Fixed Point?
Binary point close to the left = good precision, small range
Binary point close to the right = decreasing precision, large range
What is Underflow?
not enough bits available
What is Overflow?
too large to be represented with the given number of bits