Data Rep (Number Systems + Bases) Flashcards
Fraction Definition
- The ratio between two integers (numerator : denominator)
Whole Numbers Definition
- A number with no fractional part, meaning there are no fractions or decimal place values after the number.
Natural Numbers (Definition, uses and Symbol)
- Positive whole numbers of the base 10 number system, ranging from 0 to infinity.
- Uses for everyday counting and ordering.
- Mathematical Symbol: ℕ = {0, 1, 2, 3, 4, 5, 6…}
Integer Numbers (Definition, Use in Programming, Symbol)
- Whole numbers that can hold a positive or negative value, including zero.
- Integers are one of the standard data types used when defining variables.
- Mathematical Symbol: ℤ = {…, -3, -2, -1, 0, 1, 2, 3…}
Rational Numbers (Definition, Symbol)
- A number which can be expressed as a fraction/quotient.
- Mathematical Symbol: ℚ
Irrational Numbers (Definition and Implication in Programming)
- A number that cannot be represented as a ratio of integers because their decimal expansions are non-terminating (infinite) and non-repeating (values after the decimal places never repeat in a pattern).
- As they have infinite decimal places, the programmer has to decide on the level of precision required and allocate a set amount of memory to storing the value.
Real Numbers (Definition, sub-catergories, and Implication in Programming)
- Any positive or negative value, that can include a fractional part.
- Integers, rational numbers, and irrational numbers are all real numbers.
- As they have infinite decimal places, the programmer has to decide on the level of precision required and allocate a set amount of memory to storing the value.
Ordinal & Cardinal Numbers (Definitions)
- Ordinal numbers identify the position of something within a list (first, second, third)
- Cardinal numbers indicate an amount, how much of something we have (0, 1, 2, 3)
Well-ordered list
- A group of related numbers with a set and defined order.
Note: To calculate the max number of permutations for bits, 2^n.
- If 8 bits are being used, we have 2^8 = 256 permutations (remember, this often includes zero, so 0-255).
Binary Prefixes
Kibi-byte: Ki, 2^10 bits
Mebi-byte: Mi, 2^20 bits
Gibi-byte: Gi, 2^30 bits
Tebi-byte: Ti, 2^40 bits
Decimal Prefixes
Kilo-byte: KB, 10^3 bits
Mega-byte: MB, 10^6 bits
Giga-byte: GB, 10^9 bits
Tera-byte: TBM 10^12 bits
Number Bases
- A number base indicates how many different digits are available when using a particular number system.
Is an unsigned integer positive or negative?
- A positive integer (it does not have a sign, which in this case is the ‘-‘ sign).
Two’s Complement
- A way of representing negative integers in binary.
- The MSB (most significant bit) is -128, not 128.
- A total of 256 numbers, from -128 to 127 can be represented.
-128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 |