The Wayback Machine - https://web.archive.org/web/20240118182346/https://www.geeksforgeeks.org/quotient-remainder-theorem/
Open In App
Related Articles

Quotient Remainder Theorem

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

Quotient Remainder Theorem states that for any pair of integers a and b (b is positive), there exists two unique integers q and r such that:

a = b x q + r
where 0 <= r < b

Example 1:
If a = 22, b = 4
then q = 5, r = 2
22 = 4 x 5 + 2

Example 2:
If a = -19, b = 5
then q = -4, r = 1
-19 = 5 x -4 + 1

Use of Quotient Remainder Theorem:
Quotient remainder theorem is the fundamental theorem in modular arithmetic. It is used to prove Modular Addition, Modular Multiplication and many more principles in modular arithmetic.

Proof:

To prove Quotient Remainder theorem, we have to prove two things:
For any integer a and positive integer b:
1. q and r exist
2. q and r are unique

Existence of q and r:
Consider the progression …, a – 3b, a – 2b, a – b, a, a + b, a + 2b, a + 3b…
This extends in both directions.
By the Well-Ordering Principle, there must exist a smallest non-negative element x.
Thus, x = a – qb and x must be in the interval [0, b) because otherwise r-b would be smaller than r and a non-negative element in the progression.

Uniqueness of q and r:
Suppose we have another pair q0 and r0 such that a =b x q0 + r0, with 0 <= r0 < b.
b x q + r = b x q0 + r0
We see that r – r0 = b(q0 – q), and so q0 – q = b / (r – r0)
Since 0 <= r < b and 0 <= r0 < b, we have that -b < r-r0 < b
Hence, r- r0 = 0 that implies r = r0
So r – r0 = 0 = b(q0 – q)
which implies that q = q0.
This shows uniqueness.

Level Up Your GATE Prep!
Embark on a transformative journey towards GATE success by choosing Data Science & AI as your second paper choice with our specialized course. If you find yourself lost in the vast landscape of the GATE syllabus, our program is the compass you need.

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 01 May, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads