Data Representation Flashcards
Real Number
Any and all existing sets of numbers
Rational number
A rational number is a positive or negative number which can be fractional. The symbol is Q.
Integer
Any whole positive or negative number. The symbol is Z.
Natural Number
Whole, positive numbers including 0, The symbol is N.
Irrational Number
A number that cannot be represented as a fraction or ratio, the decimal form will contain infinite repeating values.
Ordinal Number
Values that indicate place value e.g. 1st, 2nd…
What is cardinality?
The number of elements in a set (the length)
Countable set
The elements in a set can be tallied
Countably infinite set
The elements in a set can be tallied but the result would not be reached
Cartesian product
The resulting of two sets possible ordered pairs e.g. A = {1,2,3} and B = {A, B} then
A x B = {{1,A},{1,B},{2,A},{2,B},{3,A},{3,B}}
What is the Union?
A ∪ B –> Belong to set A, set B or both
What is the Intersection?
A ∩ B –> Belong to both
Is a member symbol?
∈
Is NOT a member symbol?
∉
What is the difference between a subset ⊆ , and a proper subset ⊂
We say “A is a proper subset of B” if, A is a subset of B but, A is not equal to B.
Base 10? Base 2? Base 16?
Base 10: Decimal
Base 2: Binary
Base 16: Hexadecimal
How to find the number of binary permutations?
2^no of bits
To reverse this and find the number of bits, you find Log2(permutations)
How do you determine the max value you can create from a binary length?
2n - 1
Convert 5C (Hexadecimal) into binary and then denary
- Split hex into nibbles,
5 = 0101
C = 12 = 1100 - Binary = 01011100
- 01011100 Converted to denary = 92
Convert Denary Number 92 into Hexadecimal?
- Put into binary 92 = 01011100
- Split into nibbles and convert to Hex
0101 = 5
1100 = 12 = C - Join, Answer = 5C
How do you calculate signed binary min value?
-2n/2
How do you calculate signed binary’s max value?
2n-1/2
Define twos complement?
Where the most significant binary bit is negative
What are the binary addition rules?
0+0 Carries 0 Result 0
0+1 Carries 0 Result 1
1+1 Carries 1 Result 0
1+1+1 Carries 1 Result 1
What are the binary subtraction rules?
Flip the bits, +1 and then perform binary addition
How do you convert Floating point to denary?
+/- Mantissa x 2^+/-Exponent
What does a normalised floating point expression look like?
Positive begins with 01
Negative begins with 10
(floating point uses twos complement)
What is the benefit of normalised floating point?
It maximises precision for a given number of bits and provides a unique representation
What is the mantissa?
Represents the significant bits of a number. The larger the bits used here, the greater the precision.
What is the exponent?
The power. The larger the number of bits, the greater the range of numbers
What is a cancellation error?
Adding a very small number to a very big number will not change the result
What is an underflow error?
The result of the calculation is too small to fit into the number of bits
What is an overflow error?
The result of the calculation is too large to fit into the number of bits