Lecture 1a. NumberSets (1) (1)
Computing with Numbers
Author: Dr. Rameez Asif
Institution: University of East Anglia, School of Computing Science
Contents
Number Sets
Computing with Real Numbers
Number Systems
Computer Representation of Numbers
Number Sets
N: Natural Numbers
Z: Integer Numbers
Q: Rational Numbers
R: Real Numbers
C: Complex Numbers (not really numbers in conventional sense)
Natural Numbers
Defined as: N = {1, 2, 3, 4, ...}
Countable: Can be listed infinitely with a defined position.
Example: 10 is the 10th natural number.
Definition Variations
Some definitions include 0: N0 = N ∪ {0}.
Disagreement exists between sources (e.g., French vs. Americans).
Integer Numbers
Defined as: Z = {..., -5, -4, ..., 0, 1, 2, ...}
Countable list includes both positive and negative integers.
Positive, negative, non-negative, and non-positive classifications.
Some authors prefer Z+ (positive) instead of N.
Rational Numbers
Defined as: Q = {x : x = a/b, a ∈ Z, b ∈ N}
Includes all numbers that can be expressed as fractions.
Subset relation: Z ⊂ Q.
Between any two rational numbers exists another rational number (dense).
Countability of Rational Numbers
Can be listed through specific rules, showing they are countable.
Example sequence of positive rational numbers is established.
Decimal Representations of Rational Numbers
Can be finite or infinite (e.g., -1/8 = -0.125, 11333/4510 = 2.5).
Infinite decimal representations can consist of cyclical sequences.
The Euclidean Algorithm
Method to find the greatest common divisor (gcd) of two numbers.
Steps include repeated division and remainder comparison.
Applicable to natural numbers making it efficient compared to prime factorization.
Real Numbers
Include all previously mentioned numbers plus irrational numbers.
Irrational numbers: Cannot be expressed as fractions and have infinite non-repeating decimals (e.g., √2, π).
Cantor's Findings
Georg Cantor proved that the set of real numbers is uncountable.
Example for irrationality: Proof of √2 being irrational through contradiction.