Polynome Remainder
This assumes:
- Polynomials
- [Polynome Division](Polynome Division)
This is a trick one can use to determine the remainder or the polynome input (or the other way). If the polynome $P(x)$ is divided by $(x - x_{0})$ then the remainder is the same as calculating $P(x_{0})$. In this case $x_{0}$ is the zero-point of the divisor in the division.
Example
Our polynome:
$P(x) = x^2 + x - 1$
Our divisor:
$(x - 2)$
It’s zero-point:
$(x - 2 = 0) | + 2 = (x = 2)$
The hack:
Here I have made use of a fictive function returning the remainder from the division:
$r = Remainder((x^2 + x + 1) \div (x - 2)) = P(2)$
Demonstration:
We will now calculate the remainder without performing the division:
- $r = P(x) = x^2 + x - 1$
- $r = P(2) = 2^2 + 2 - 1$
- $r = P(2) = 4 + 2 - 1$
- $r = P(2) = 6 - 1$
- $r = P(2) = 5$
- $r = 5$