Skip to content

SICP习题解答:第二章(上)


Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304

Warning: preg_replace_callback(): Unknown modifier 'c' in /home/tianyicui/cuitianyi.com/wp-content/plugins/wp-codebox/geshi/geshi.php on line 3304
?View Code SCHEME
;; 2.1
;; 2.2
;; 2.3
; 第一种表示
; 第二种表示
; 公用函数
;; 2.4
;; 2.5
; x and y are natural numbers
;; 2.6 目前最激动人心的题目
;; 2.7 为什么这么重复的题目啊
;; 2.8
;; 2.9 对于加法,结果的上(下)界即两上(下)界之和,故宽度就是两宽度之和,即(a-b)+(c-d)=(a-c)-(b-d)。减法有相同的结论。对于乘法,(a-b)*(c-d)!=(ac-bd);例如宽度相同的(0,1)、(1,2)、(2,3)两两做乘法运算得到(0,2)、(0,3)、(2,6)三个宽度不同的区间。除法类似。
;; 2.10
"Divide by a interval that contains zero -- div-interval";; 2.11 其实归结起来只有三种情况:0、1或2个区间包括0。
"["",""]\n";;;
;; 2.12
"±";; 2.13 a(1+b%)*c(1+d%)=ac(1+b%+d%+b%d%)~=ac(1+b%+d%)
;; 2.14 程序将 (div-interval A A) 与 (div-interval A B) 做相同的处理,而没有意识到前者的两个参数并非是独立的。也即,当同一个变量在式子中多次出现时,程序不能意识到它的每次出现必须取相同的值。
;; 2.15 我认为这公式的两个形式是完全等价的,在Alyssa系统上产生的区间限界不同,是由于Alyssa系统的本质缺陷,而非两个形式的优劣。
;; 2.16 当同一个变量在式子中多次出现时,程序不能意识到它的每次出现必须取相同的值。每个变量出现的次数不同会导致Alyssa系统得出的结果不同。无缺陷的区间算术包等价于以下问题:多变量的多项式,每个变量有其取值范围,求多项式的值的取值范围。这个问题属于 Interval Computation 的范畴:http://www.lsi.upc.edu/~robert/mirror/interval-comp/
;; 2.17
;; 2.18
;; 2.19
; 根据问题的定义,改变表中元素的顺序不会影响回答。
;; 2.20
;; 2.21
;; 2.22 第一个程序中,程序从前往后处理things中的元素,却每次把平方后的元素加到answer的头部,故结果的顺序会相反。第二个程序中,当cons的两个参数分别是list和元素时,结果并不是把元素加到list后面。
;; 2.23
;; 2.24 (1 (2 (3 4)))。
;; 2.25
;; 2.26
; (1 2 3 4 5 6)
; ((1 2 3) 4 5 6)
; ((1 2 3) (4 5 6))
;; 2.27
;; 2.28
;; 2.29
; (a)
; (b)
;  (c)
; (d) 只需更改right-branch和branch-structure中的cadr为cdr
;; 2.30
; 直接定义
; 使用高阶函数
;; 2.31
;; 2.32 将子集分为包含与不包含(car s)两种情况。
;; 2.33
;; 2.34
;; 2.35
; 或
;; 2.36
;; 2.37
;; 2.38
; 3/2
; 1/6
; (1 (2 (3 ())))
; (((() 1) 2) 3)
; 结合律,以及inital是op的零元。
;; 2.39
;; 2.40
;; 2.41
;; 2.42
;; 2.43 原程序中每个 (queen-cols k) 只需调用一次,而这个程序中,为了计算 (queen-cols k),需要调用 k 次 (queen-cols (- k 1));大约需要k!T的时间。
;; 2.44
;; 2.45
;; 2.46
;; 2.47
;; 2.48
;; 2.49
; (a)
; (b)
; (c)
; (d) 来源 http://d.hatena.ne.jp/laughing/20081115/1226737187,有修正
;; 2.50
;; 2.51
;; 2.52
; (a) 略
; (b)
; (c)
 

11 Comments

  1. sqybi wrote:

    a dream to host…我记得我以前用这个theme的时候经常有各种各样的bug…

    Wednesday, December 31, 2008 at 20:42 | Permalink
  2. Leo wrote:

    Hi, 翼若垂天
    我是和你一样的大一生,无意间来到你的博客,
    看到你大一就拿到 acm 金牌特别羡慕,
    我其实对编程也很感兴趣,只不过我们这边C++的教学质量实在是不高,因此有一种有心无力的感觉,因为不知道从什么地方开始。
    所以我想问问你觉得有什么建议如果要学好C++的话?有什么书好看?

    You should have my email address when I submitted this comment, so feel free to contact via my email address, I will be looking forward to your comment…..

    Saturday, January 17, 2009 at 17:53 | Permalink
  3. RoMax wrote:

    话说。。你是不是可以考虑着首页不要那么长。。

    Friday, January 30, 2009 at 22:27 | Permalink
  4. Li wrote:

    Hi,
    我无意中找到了你的SICP习题解答,真是喜出忘外,同时也羡慕你在这方面的能力。
    如果你愿意的话,请跟我联系。我还想问你怎么能够找到SICP的教学光碟呢。

    Best Withes
    Li

    Wednesday, February 4, 2009 at 02:39 | Permalink
  5. nehzilrz wrote:

    Hi,dd牛
    我是一个正在准备省选的OIer
    希望能与你进行一下关于此的交流

    mail:nehzilrz@yeah.net
    qq :248423750

    Friday, February 27, 2009 at 17:03 | Permalink
  6. Bi Ran wrote:

    我们上学期的编程课学的就是scheme,教材也是SICP
    一学期的课学的太少了
    不过这东西学了用处不大……主要是长长见识

    Friday, March 13, 2009 at 16:46 | Permalink
  7. wecing wrote:

    dd你怎么消失了……

    Sunday, July 5, 2009 at 19:24 | Permalink
  8. flyink wrote:

    我来是想问下~~WORDPRESS租什么样的空间比较好啊~~~

    Sunday, September 27, 2009 at 12:33 | Permalink
  9. 116 wrote:

    请问以下问题楼主有什么高见:
    define the set A={(x,y)belong to R^2,X^2+y^2 小于等于1}, and the point b=(3,3)belong to R^2. find all hyperplanes separating the set A and the point b.
    Hint:
    a)provide a graphic sketch of the problem
    b)break the problem into three or more simpler subproblems
    c)slove these subproblems one by one,starting with the simplest

    Friday, October 23, 2009 at 02:45 | Permalink
  10. Phil wrote:

    dd牛您2009年一年都没有更新…

    Thursday, January 7, 2010 at 17:18 | Permalink
  11. MaoYu wrote:

    全部阅览完毕。
    2009年估计是DD静心学习的一年。
    我也大一,曾今的OIer,很想参加ACM。不过学校以前好像没有人参加过,我想问问怎么报名啊?很复杂吗?我自己可以负责吗?

    Friday, February 12, 2010 at 21:50 | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*