Tuesday, April 26, 2016

Estimate The Quotient And Remainder For A New Divisor

Assume there is a number a. Assume a is divided by b - the quotient is q and the reminder is r.

All numbers are positive integers (non zero).

Now you are given a new positive integer c (less than a).

Estimate the quotient and remainder when a is divided by c.


Solution:
The quotient will be b/c * q and the remainder same as before =r. But this is correct only if b/c is an integer.

In case where c is not a factor of b:
New quotient = Rounddown(b/c  * q, 0)
Now because we took only the integer part of the quotient, the decimal part still remains and that will affect the old remainder.

Truncate the value of b/c  * q and take only the decimal part: 
In Microsoft Excel, this will be (b/c  * q) - Rounddown(b/c  * q, 0)

Take the above value and multiple by the new divisor c. Add the product with the old remainder r. That will be the new remainder.

Meaning new remainder nr = [(b/c  * q) - Rounddown(b/c  * q, 0)] *c + r

Note:
If the new remainder is bigger than c, then  divide nr by c. Add the quotient from this division to nq. This sum will be the final quotient. The remainder from this division (nr / c) will be the final remainder.

No comments:

Post a Comment

Popular Posts

Featured Post

Whom Do We Trust

I came across this: APNews being the trusted source of news for half the world.  And there is Truth Social which also is read and trusted by...