Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 19a50df

Browse files
author
Oleksandr Kulkov
authored
matrix form + style
1 parent a89160f commit 19a50df

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

src/algebra/polynomial.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,30 +88,37 @@ Thus starting with $B_0 \equiv a_0^{-1} \pmod x$ we will compute the sequence $B
8888

8989
The algorithm here might seem a bit more complicated than the first one, but it has a very solid and practical reasoning behind it, as well as a great generalization potential if looked from a different perspective, which would be explained further below.
9090

91-
### Division with remainder
91+
### Euclidean division
9292

93-
Consider two polynomials $A(x)$ and $B(x)$ of degrees $n$ and $m$. As it was said earlier you can rewrite $A(x)$ as:
93+
Consider two polynomials $A(x)$ and $B(x)$ of degrees $n$ and $m$. As it was said earlier you can rewrite $A(x)$ as
9494

95-
$$A(x) = B(x) D(x) + R(x), \deg R < \deg B$$
95+
$$A(x) = B(x) D(x) + R(x), \deg R < \deg B.$$
9696

97-
Let $n \geq m$, then you can immediately find out that $\deg D = n - m$ and that leading $n-m+1$ coefficients of $A$ don't influence $R$.
97+
Let $n \geq m$, it would imply that $\deg D = n - m$ and the leading $n-m+1$ coefficients of $A$ don't influence $R$. It means that you can recover $D(x)$ from the largest $n-m+1$ coefficients of $A(x)$ and $B(x)$ if you consider it as a system of equations.
9898

99-
That means that you can recover $D(x)$ from the largest $n-m+1$ coefficients of $A(x)$ and $B(x)$ if you consider it as a system of equations.
99+
The system of linear equations we're talking about can be written in the following form:
100+
$$\begin{bmatrix} a_n \\ \vdots \\ a_{m+1} \\ a_{m} \end{bmatrix} = \begin{bmatrix}
101+
b_m & \dots & 0 & 0 \\
102+
\vdots & \ddots & \vdots & \vdots \\
103+
\dots & \dots & b_m & 0 \\
104+
\dots & \dots & b_{m-1} & b_m
105+
\end{bmatrix} \begin{bmatrix}d_{n-m} \\ \vdots \\ d_1 \\ d_0\end{bmatrix}$$
100106

101-
The formal way to do it is to consider the reversed polynomials:
107+
From the looks of it, we can conclude that with the introduction of reversed polynomials
102108
$$A^R(x) = x^nA(x^{-1})= a_n + a_{n-1} x + \dots + a_0 x^n$$
103109
$$B^R(x) = x^m B(x^{-1}) = b_m + b_{m-1} x + \dots + b_0 x^m$$
104110
$$D^R(x) = x^{n-m}D(x^{-1}) = d_{n-m} + d_{n-m-1} x + \dots + d_0 x^{n-m}$$
105111

106-
Using these terms you can rewrite that statement about the largest $n-m+1$ coefficients as:
107112

108-
$$A^R(x) \equiv B^R(x) D^R(x) \pmod{x^{n-m+1}}$$
113+
The system may be rewritten as
109114

110-
From which you can unambiguously recover all coefficients of $D(x)$:
115+
$$A^R(x) \equiv B^R(x) D^R(x) \pmod{x^{n-m+1}}.$$
116+
117+
From this you can unambiguously recover all coefficients of $D(x)$:
111118

112119
$$\boxed{D^R(x) \equiv A^R(x) (B^R(x))^{-1} \pmod{x^{n-m+1}}}$$
113120

114-
And from this in turn you can easily recover $R(x)$ as $R(x) = A(x) - B(x)D(x)$.
121+
And from this, in turn, you can recover $R(x)$ as $R(x) = A(x) - B(x)D(x)$.
115122

116123
## Calculating functions of polynomial
117124

0 commit comments

Comments
 (0)