灯下 登录
计算机科学 / SICP / 3.5.2 Infinite Streams

Exercise 3.61 · 习题

Exercise 3.61: Let S be a power series
(Exercise 3.59) whose constant term is 1. Suppose we want to find the
power series 1

/

S, that is, the series X such that S
X
=
1.
Write S
=
1
+

S
R where S
R is the part of S after the
constant term. Then we can solve for X as follows:
S

X

=

1
,

(
1
+

S
R

)

X

=

1
,

X
+

S
R


X

=

1
,

X

=

1

S
R


X
.
In other words, X is the power series whose constant term is 1 and whose
higher-order terms are given by the negative of S
R times X. Use
this idea to write a procedure invert-unit-series that computes 1

/

S

for a power series S with constant term 1. You will need to use

mul-series from Exercise 3.60.

练习 3.61:设 S 是一个常数项为 1 的幂级数(练习 3.59)。假设我们想求幂级数 1/S,即满足 S·X = 1 的级数 X。写 S = 1 + Sᴿ,其中 Sᴿ 是 S 去掉常数项后的部分。则可按如下方式求解 X:S·X = 1,(1 + Sᴿ)·X = 1,X + Sᴿ·X = 1,X = 1 − Sᴿ·X。换言之,X 是常数项为 1、高次项由 −Sᴿ 乘以 X 给出的幂级数。利用这一思路,写一个过程 invert-unit-series,它对常数项为 1 的幂级数 S 计算 1/S。你需要用到练习 3.60 中的 mul-series。