Professional Documents
Culture Documents
Types of Numbers
Natural Numbers: Natural numbers are known as counting numbers that contain the
positive integers from 1 to infinity. The set of natural numbers is denoted as “N” and it
includes N = {1, 2, 3, 4, 5, ……….}
Whole Numbers: Whole numbers are known as non-negative integers and it does not
include any fractional or decimal part. It is denoted as “W” and the set of whole numbers
includes W = {0,1, 2, 3, 4, 5, ……….}
Integers: Integers are the set of all whole numbers but it includes a negative set of natural
numbers also. “Z” represents integers and the set of integers are Z = { -3, -2, -1, 0, 1, 2, 3}
Real Numbers: All the positive and negative integers, fractional and decimal numbers
without imaginary numbers are called real numbers. It is represented by the symbol “R”.
Rational Numbers: Any number that can be written as a ratio of one number
over another number is written as rational numbers. This means that any
number that can be written in the form of p/q. The symbol “Q” represents the
rational number.
Irrational Numbers: The number that cannot be expressed as the ratio of one
over another is known as irrational numbers and it is represented by the
symbol ”P”.
Complex Numbers: The number that can be written in the form of a+bi where
“a and b” are the real number and “i” is an imaginary number is known as
complex numbers “C”.
Imaginary Numbers: The imaginary numbers are the complex numbers that can
be written in the form of the product of a real number and the imaginary unit “i”
Divisibility
When one integer is divided by a second nonzero integer, the quotient may or may
not be an integer. For example, 12/3 = 4 is an integer, whereas 11/4 = 2.75 is not.
Therefore, a divides b + c.
EXAMPLE 3
What are the quotient and remainder when 101 is divided by 11?
Solution:
We have 101 = 11 · 9 + 2.
Hence, the quotient when 101 is divided by 11 is 9 = 101 div 11, and
the remainder is 2 = 101 mod 11.
EXAMPLE 4
What are the quo ent and remainder when −11 is divided by 3?
Hence, the quo ent when −11 is divided by 3 is −4 = −11 div 3, and the
remainder is 1 = −11 mod 3.
Use the definitions of even and odd to justify your answers to the
following questions.
a. Is 0 even?
b. Is −301 odd?
c. If a and b are integers, is 6a2b even?
d. If a and b are integers, is 10a + 8b + 1 odd?
Solution
a. Yes, 0 = 2·0.
b. Yes, −301 = 2(−151) + 1.
c. Yes, 6a2b = 2(3a2b), and since a and b are integers, so is 3a2b (being
a product of
integers).
d. Yes, 10a + 8b + 1 = 2(5a + 4b) + 1, and since a and b are integers, so is
5a + 4b (being a sum of products of integers).
Prime and Composite
Primes
Every integer greater than 1 is divisible by at least two integers, because a
positive integer is divisible by 1 and by itself. Positive integers that have exactly
two different positive integer factors are called primes.
Remark: The integer n is composite if and only if there exists an integer a such
that a | n and 1 <a<n.
Example
a. Is 1 prime?
b. Write the first six prime numbers.
c. Write the first six composite numbers.
Solution
a. No. A prime number is required to be greater than 1
c. 2, 3, 5, 7, 11, 13
d. 4, 6, 8, 9, 10, 12
EXAMPLE 1
The integer 7 is prime because its only positive factors are 1 and 7,
whereas the integer 9 is composite because it is divisible by 3.
EXAMPLE 2
The prime factorizations of 100, 641, 999, and 1024 are given by
100 = 2 · 2 · 5 · 5 = 2252
641 = 641
999 = 3 · 3 · 3 · 37 = 33 · 37
1024 = 2 · 2 · 2 · 2 · 2 · 2 · 2 · 2 · 2 · 2 = 210
The Sieve of Eratosthenes
- used to find all primes not exceeding a specified positive integer.
Composite
- be defined as numbers that have more than two factors. Numbers that are not
prime are composite numbers because they are divisible by more than two
numbers.
Examples:
Factors of 4 = 1, 2, 4 i.e.
Since 4 has more than two factors. So, 4 is a composite number.
Factors of 6 = 1, 2, 3, 6
Since 6 also has more than two factors. So, 6 is also a composite number.
Facts
The numbers 0 and 1 are neither prime nor composite numbers.
All composite numbers are always divisible by 1 and the number itself.
Greatest Common Divisors and Least Common Multiples
The largest integer that divides both of two integers is called the
greatest common divisor of these integers.
EXAMPLE 10
What is the greatest common divisor of 24 and 36?
Solution:
The positive common divisors of 24 and 36 are 1, 2, 3, 4, 6, and 12.
Hence,
gcd(24, 36) = 12.
EXAMPLE 11
Solution:
Solution: Because gcd(10, 17) = 1, gcd(10, 21) = 1, and gcd(17, 21) = 1, we conclude that
10, 17, and 21 are pairwise relatively prime.
Because gcd(10, 24) = 2 > 1, we see that 10, 19, and 24 are not pairwise relatively prime.
LCM is the short form for “Least Common Multiple.” The least common multiple is
defined as the smallest multiple that two or more numbers have in common.
Among the most important bases are base 2, base 8, and base 16.
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F,
Bytes, which are bit strings of length eight, can be represented by two
hexadecimal digits.
BASE CONVERSION