File tree Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Expand file tree Collapse file tree 5 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 45
45
46
46
随机选取两个正整数,它们互质(即最大公约数GCD为1)的概率是 $\frac{6}{\pi^2}$ , 所谓的 互质指两个数没有公共因子(如8和15互质,但8和12不互质,因为公约数为4)。
47
47
48
- 而这一结论是源自数论中关于 ** 互质数的密度* * 的研究,与黎曼ζ函数相关(难怪我看不懂了)。
48
+ 而这一结论是源自数论中关于 *互质数的密度* 的研究,与黎曼ζ函数相关(难怪我看不懂了)。
49
49
50
50
而用蒙特卡罗模拟步骤来计算 ${\pi}$:
51
51
Original file line number Diff line number Diff line change 5
5
#+DATE: 2022-11-13 日 17:01
6
6
练习2-24:
7
7
8
- [[file:~/code/scheme/SICP/img/chapter2/exercise-2-24.png][file:~/code/scheme/SICP /img/chapter2/exercise-2-24.png]]
8
+ [[file:.. /img/chapter2/exercise-2-24.png]]
Original file line number Diff line number Diff line change 32
32
(intersection-set set1 set2) ; => (1 2 3 3)
33
33
#+end_src
34
34
35
- =element-of-set?= 的时间复杂度依然是=O(n)= , =adjoin-set=的时间度为 =O(1)=, 因为已经不依赖 =element-of-set?= 函数了。
35
+ =element-of-set?= 的时间复杂度依然是 =O(n)= , =adjoin-set=的时间度为 =O(1)=, 因为已经不依赖 =element-of-set?= 函数了。
36
36
37
37
=union-set= 的时间复杂度为 =O(n)= ,因为需要遍历set1.
38
38
Original file line number Diff line number Diff line change 7
7
8
8
a. 将求和和求积的求导过程存储在表格中,通过操作类型获取过程并执行。因为 =number= 和 =same-variable= 不是调用过程,而是直接返回数值。
9
9
10
- b. 虽然作者说在3.3.3节,要介绍=put= 和=get= 的实现,但我们也可以提前想到如何实现=put= 和 =get=,使用 hashtable:
10
+ b. 虽然作者说在3.3.3节,要介绍 =put= 和 =get= 的实现,但我们也可以提前想到如何实现 =put= 和 =get=,使用 hashtable:
11
11
#+begin_src scheme
12
12
(define (variable? x) (symbol? x))
13
13
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ z是图2-24里的对象,即=(cons 'complex (cons 'rectangular (cons 3 4)))=
19
19
(list op type-tags))))))
20
20
#+end_src
21
21
22
- 当安装 =(put 'magnitude '(complex) magnitude)= 后,=(get op type-tags)= 语句的执行结果就不会为空,就能正确执行。
22
+ 当安装 =(put 'magnitude '(complex) magnitude)= 后, =(get op type-tags)= 语句的执行结果就不会为空,就能正确执行。
23
23
24
24
#+begin_src racket
25
25
(define (apply-generic op . args)
You can’t perform that action at this time.
0 commit comments