0% found this document useful (0 votes)
65 views

Division Algorithm

The document discusses the division algorithm and provides examples of using it to divide integers. It defines the division algorithm and proves some properties about it, including that the remainder of dividing the square of an integer by 4 is 0 or 1. It also provides practice problems and proofs related to the division algorithm.

Uploaded by

Jiaqi Xu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
65 views

Division Algorithm

The document discusses the division algorithm and provides examples of using it to divide integers. It defines the division algorithm and proves some properties about it, including that the remainder of dividing the square of an integer by 4 is 0 or 1. It also provides practice problems and proofs related to the division algorithm.

Uploaded by

Jiaqi Xu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

D

IVISION ALGORITHM

What is “Algorithm”?
An ALGORITHM is a process or set of rules to be followed in calculations or other
problem-solving operations, especially by a computer". In mathematics and computer science, an
algorithm is a self-contained step-by-step set of operations to be performed. Algorithms perform
calculation, data processing, and/or automated reasoning tasks.
The English word 'algorithm' comes from Medieval Latin word algorism and the Greek
word "arithmos". The word 'algorism' (and therefore, the derived word 'algorithm') comes from
Al-Khwārizmī, a Persian mathematician, astronomer, geographer, and scholar.
Definition:
Let a and b be two integers with b > 0 or b  0. Then there exist unique integers q, r such
that a = bq + r, where 0 ≤ r < b or 0 ≤ r < |b|. The integer q is called the quotient and r, the
remainder while a is the dividend and b is the divisor.
Proof:
Without loss of generality, assume that a≥0 and consider the set S = {a+bx : x ∈ Z}  N.
Clearly, a ∈ S and hence S is a non-empty subset of N. Therefore, by Well-Ordering Principle, S
contains its least element, say s0. That is, there exists x0 ∈ Z, such that s0 = a + bx0. We claim that
0 ≤ s0 < b. As s0 ∈ S ⊂ N, one has s0 ≥ 0. So, let if possible assume that s0 ≥ b. This implies that s0
− b ≥ 0 and hence s0 − b = a + b(x0 − 1) ∈ S, a contradiction to the assumption that s0 was the
least element of S. Hence, we have shown the existence of integers q, r such that a = qb +r with 0
≤ r < b. 
Uniqueness:
Let if possible q1, q2, r1 and r2 be integers with a = q1b + r1 = q2b + r2, with 0 ≤ r1 ≤ r2 < b.
Therefore, r1 − r2 ≥ 0 and thus, 0 ≤ (q1 − q2)b = r2 − r1 < b. Hence, we have obtained a multiple of
b that is strictly less than b. But this can happen only if the multiple is 0. That is, 0 = (q 1 − q2)b =
r2 − r1. Thus, one obtains r1 = r2 and q1 = q2 and the proof of uniqueness is complete.
Corollary. Let a, b  Z, b  0. There exist unique integers q and r such that a = bq + r
wher
e
0  r < |b|.
Proof:

NUMBER THEORY | DIVISION ALGORITHM | CICS COMPUTER SCIENCE 1|Page


Let a, b  Z, b  0. Consider the following two cases that is when b> 0 and b < 0.

NUMBER THEORY | DIVISION ALGORITHM | CICS COMPUTER SCIENCE 2|Page


Case 1. When b > 0. By division algorithm (DA), there exist q and r such that a = bq + r where 0
 r < |b|.
Case 2. When b < 0. Here |b| > 0. By division algorithm, there exist unique integers q’ and r’
such that a = |b|q’ + r’ where 0  r’ < |b|.
Now, |b| = -b since b < 0. It follows that
a = (-b)q’ + r’
a = (b)(-q’) + r’ and let q = -q’ and r’ = r

So, a = bq + r where 0  r < |b|.


So, an integer can be expressed uniquely with the use of division algorithm for even and odd
integer in the form of:
a) Even
a = bq + 0 where b = 2 and r = 0
b) Odd
a = bq + 1 where b = 2 and r = 1
for some integers q.

Examples:
1. Write 10 in a form of a = bq + r.
3

By definition of DA, we need to remember that r must be in between of 0 and |b|.


Now, let us use the what so called a long division.
quotient

divisor dividend

remainder

So, we can rewrite this in a form of a = bq + r. Hence 10/3 = (3)(3) + 1.


Example 2:
1. Let a = 30 and b = 7. Find q and r that satisfies division algorithm.
Again, by the form of DA that is a = bq + r it could be write as:
30 = (7)(q) + r
Again using long division on what you have learned in your senior high school, it can easily
determine the value of q and r. Here the value of q = 4 and r = 2. Note that r here is still in
between or in the range of 0 to |b|
2. Let a = -15 and b = 4. Find q and r that satisfies division algorithm.

Using again on what so called a long division, we could determine the quotient as well
as its remainder. Remember on what you have learned in performing long division when
you were in your senior high school.

quotient
divisor dividend

remainder
On this example you will notice that r = -3 is not on the range of 0 to |b|. Although our
solution is correct but still we could not say that the r here is -3 since it does not follow the
definition of DA. So what are we going to do is to follow the DA by trying a trial and error
method. Remember that a = bq + r. So;
-15 = (4)(q) + r
- 15 = (4)(-3) + (-3) correct but r is not on the range of0 to |b|.
How about if:
-15 = (4)(-4) + (1)
Here, a = -15, b = 4, q = -4 and r = 1 which is a correct equation and r = 1 follows the range of 0
to |b|. Therefore, the value of q is -4 and the value of r is 1.

Example 3. Proving.
a) Prove that the square of an integer has a remainder of 0 or 1 when divided by 4.
Proof:
1. Assume that x be an integer so x  Z.
2. By definition of division algorithm, x can be expressed in two cases such as x = 2a (even) and
x = 2a + 1 (odd).
3. Now, x2 = (2a)2 and x2 = (2a + 1)2. So, x2 = 4a2 and x2 = 4a2 + 4a +1. Let a2 = k then x2 = 4k
and it could be written in a form of x2 = 4k + 0 and for x2 = 4a2 + 4a + 1 = 4(a2 + a) + 1 for a2 + a
=k thus it could be written in a form of x2 = 4k + 1. Hence by definition of division algorithm
that is a = bq + r, it is clearly seen that b = 4 which is divisor while r = 0 and r = 1.
4. Therefore, the square of an integer has a remainder of 0 or 1 when divided by 4.

b) Prove that if a is an odd integer, then a2 has the form of 8k + 1 for some k  Z.
Proof:
1.Assume that a is an odd integer.
2. By definition of division algorithm with b = 2, it implies that a = 2q + 0 (eq.1) or a = 2q + 1
(eq. 2). Noticing that eq. 2 gives that a is an odd.
3. So, we can say that a = 2q + 1 and we need to show that a2 is in the form of 8k + 1. Now, a2 =
(2q + 1)2 = 4q2 + 4q + 1 = 4(q2+q) + 1. Recall that if q is odd then q2 is also odd and so as the sum
of q2 and q that is q2 + q is even.
4.On the other hand, if q is even then q2 is also even and so as q + q2 is also even.

5.Here in both cases, q + q2 are both even so q + q2 = 2k for some k Z.

6. Therefore, a2 = 4(2k) + 1 = 8k + 1. 

Name: Ona, Pauline Mae M. Date:


Section: CS-1202 Score:
Practice Exercises
Division Algorithm
Direction: Using the definition of division algorithm that is a = bq + r where a is the dividend, b
is the divisor, q is the quotient and r is the remainder and 0 ≤ r < b, find q and r by completing
the table given below.
a b q r
123 17 7 4
-87 3 -29 0
49 22 2 5
-143 18 -7 17
663 21 31 12

Direction: Prove the following:


a) Prove that: “If n is not divisible by 3, then n2 + 2 is divisible by 3.”

1. Suppose that n=3q+r where r=1 and q is an integer.


2. By using substitution, n=(3q+1)^2+2 then by simplify n=(9q^2+6q+1+2) then by
factoring, n=3(3q^2+2q) where (3q^2+2q) can be q.
3. So n=3q+r where r=0.
4. Since there is no remainder, therefore n^2+2 is divisible by 3.

b) Prove that “Every perfect square is either a multiple of 4 or of the form 4q + 1 for
some integer q.”

You might also like