東京大学 情報理工学系研究科 電子情報学専攻 2014年8月実施 専門 第3問
Author
Description
Let
Here quotient
(1) Calculate
(2) Complete a pseudocode of the polynomial division algorithm by filling (a) with appropriate expressions. Note that the four arithmetic operations for monomial terms (expressions that contain only one term, e.g.
Input: f, g
Output: q, r
q = 0, r = f
while (r ≠ 0 and deg(g) ≤ deg(r)) {
q = q + LT(r)/LT(g)
r = _____ (a) _____
}
(3) Prove that the algorithm introduced in (2) always terminates.
(4) The greatest common divisor (GCD) for polynomials
divides and - if a polynomial
divides and , then also divides
Input: f, g
Output: h
h = f
s = g
while (s ≠ 0) {
rem = remainder(h, s)
h = ______ (b) ______
s = ______ (c) ______
}
(5) Given arbitrary polynomials
Kai
(1)
Since
Therefore
(2)
- (a):
r - (LT(r) / LT(g)) * g
(3)
Let
Let
i.e.,
Since
Therefore
Since if
(4)
- (b):
s - (c):
rem
(5)
According to (3),
In GCD,
According to the analysis of (3), we know
To find the worst case, we need let
In this case, the degree of
The total number of steps is the length of this sequence plus the final step: