Aald HH $ @d HHHHff@  d Footnote TableFootnote**.\t.\t/ - :;,.!?6 `04  `1TOCHeading1Heading2   EquationVariablesfeg @e @f ehejekelemeneo a q b a 4 ) I >= )<$lastpagenum> *<$monthname> <$daynum>, <$year> +"<$monthnum>/<$daynum>/<$shortyear> ,;<$monthname> <$daynum>, <$year> <$hour>:<$minute00> <$ampm>kFi -"<$monthnum>/<$daynum>/<$shortyear> .<$monthname> <$daynum>, <$year> /"<$monthnum>/<$daynum>/<$shortyear> 0 <$fullfilename> 1 <$filename>f@ 2 <$paratext[Title]> 3 <$paratext[Heading1]> 4 <$curpagenum> 5 <$marker1> 6 <$marker2> 7 (Continued) 8+ (Sheet <$tblsheetnum> of <$tblsheetcount>) 9Heading & Page <$paratext> on page<$pagenum> :Pagepage<$pagenum> ;See Heading & Page%See <$paratext> on page<$pagenum>. < Table All7Table<$paranumonly>, <$paratext>, on page<$pagenum> =Table Number & Page'Table<$paranumonly> on page<$pagenum>  FFA HHA JJ LzA NN PP  ?5y  va<$5  u;5 ! u>nu5 " t >:e\ ( j j >k_P . j j"hne @ j vmore A j vmo_ F { vd, _ d v v"e f { v/ume] h j ja ei u j ji>a v { v nae w j v pae x j je e y j vedid { {cudu j v dv j j dw j j dx j j)d} j j hed { j$etd j jHedY j jeardZ j jppac j vc j vnc j ve& c j v<exc j vnuc j ve c j vnuc j vpt>c j v<umc j vambc! j v'<$c" j v>gec# j vc$ j vc% j vFc& j vc' j vAc( j vc) j vc* q vc+ j vc, j vNc- j vc. j vc/ j vvc0 j vuc1 j vuc2 j vtc3 j vjc4 j vc5 j vjc6 j vjc7 j v{c8 j vvc9 j v{c: j vjc; j vjc< j v{el j jjc> j vjc? j vjc@ j v{cA j vjcB j vjcC j vjcD j vjcE q vjcF j v{cG j vjcH { vjcI j vjd v vjcK j vjcL j vjcM j vjcN j vjcO j vjcP j vjcQ j vjd j jjcS j vjcT j vjcU j vjcV  j vjcW  j vjcX  j vjcY  j vjcZ  j vjc[  { vjc\  j vjd  j jqc^ j vjc_ j vjc` j vjca j vjcb j vjcc  j vjcd  j vjce  j vjcf  j vjcg  j vjch  j vjci  { vjcj  j vjck  j vjcl  j vjcm  j vjcn  j vjco  j vjcp  j vjcq  j vjcr  j vjcs  j vjct  j vje v vje ! vjcw " j vje # v vqcy $ j vjcz % j vjc{ & j v{c| ' j vjc} ( j vvc~ ) j vjc * j vjc + j vjc , j vjc - j vjc . j vjc / j vjc 0 j vjc 1 j vjc 2 j vjc 3 j vje 4 j vjc 6 { vjc 7 j vjc 8 j vjc 9 j vjc : j v{c ; j vjc < j vjc = j vjc > j vjc ? j vjc @ j vjc A j vjc B j vjc C { vjc D j vjc E j vjc F j vjc G j vjc H j v{c I j vjc J j vjc K j vjc L j vjc M j vjc N j vjc O j vjc P j vjc Q j vjc R j vjc S j vjc T j vvc U j vvc V j vjc W j vvc X { vjc Y j vjc Z j vjc [ j vjc \ j vjc ] j vjc ^ j vjc _ j vjc ` j vjc a j vjc b j vjc c j vjc d j vjc e j vjc f j vjc g { vjc h j vjc i j v{c j j vjc k j vjc l j vjc m j vjc n j vjc o j vjc p j vjc q j vjc r j vjc s j vjc t j vjc u j vjc v j v{c w j vjc x j vjc y j vjc z j vjc { j vjc | j vjc } j vjc ~ j vjc  j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j v{c j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j vjc j v{c j vjc j vjc { vjc j vje j vje j vje j vje j vje j vje j vje j vje j vjc v vjc j vjc j vjd j vjd j vjd j vjd j vjd j vjd j vjd j vjd { vjd j vjd j vjd j vjd j vjd j vjd j vjd j vjd j vjd j vje j jjd j vjd j vje j jjd j vjd j vjd j vjd j vjd j vjd j vjd j vjd" j vjd$ j vjd% j vjd& j vjd' j vjd( j vjd) j vjd, j vjd. v vjd[ j jjd\ j j{em j jjeo j vjdc j vjep j vjeq j vjer j vjeu j jje v vje# j jje$ j jvev j jjew j jje| j jjey j jje} j jje k ve v vje v vje v vje j j{e v vje v vj5 {Td dq5jjPFddq6jjJHddq7jj8CdHm3R q897 jjHm3R H RH R FootnoteHr@ q98:7 $ jHr@ HzHz  Single LineH'q:9<7) j;;Footnote v  5_;:{     HD q<:=7 eqHD HH  Double LineH q=<@7e$>?j Double Line j5c>?=j5e?>=ee jH q@=B7 AA Single Linej5hA@HZqB@C7q TableFootnoteEGxR qCB7 9EGxR EPwEPw  TableFootnoteod_sDLLHH5xE5 HH)F e   HH5zFN5 HHlEE DHH5{G6 HH @>?HDo UT UT` .  HH5}HJ6HHlGG  HUV 5~I6 HUV AAJUUh  f15e AHUV 5JH6HUV lII HH_tKD xHHR Lw ` F Stream Data Abstraction ) `  L ) == (cons (delay )) QUR UT` A ) fUP UT`  (define (stream-car s) (car s)) {UN UT` 4  UL UT` 5z((define (stream-cdr s) (force (cdr s))) ` d  HH_vLD{HHlSKK HUV 5M5 THUV NUUe !  HUV 5NPF5~HUV lMM H$ 5O5 UUH$ JHPUUe "  H$ 5PN5H$ lOO d_QSSamatHH_RQ TUTHHvre> (delaySUT ` v ϪList HOPs to Stream HOPs a&UT UT` UN T;UR UT` ( UL(define (list-ref lst n) sPUP UT` e  (if (= n 0) eUN UT`  (car lst) zUL UT` % (list-ref (cdr lst) (- n 1)))) UJ UT` S KUH UT` (define (stream-ref s n) UF UT`  (if (= n 0) UD UT`  ( stream-car  s) UB UT` 4 (stream-ref ( stream-cdr  s) (- n 1)))) U@ UT`   U> UT`  "U< UT` h  7U: UT` (define (map proc lst) LU8 UT`  (if (null? lst) aU6 UT` '() vU4 UT`  (cons (proc (car lst)) NU2 UT` $ (map proc (cdr lst))))) U0 UT`  U. UT` _(define (stream-map proc s) U, UT` am (if ( stream-null?  s) U* UT`  the-empty-stream U( UT` (d9 ( cons-stream  (proc ( stream-car  s))  U& UT` UT? (stream-map proc ( stream-cdr  s))))) ) sU$ UT` e  3U" UT` UT HU UT` ar t]U UT`  rU UT` (c lHH_SQHUTHHlLVRR  d_TtrVV HH_UT (HH/` V UT UT`  UR UT` c (define (filter pred lst) 3UP UT` )  (cond ((null? lst) '()) HUN UT`  ((pred (car lst)) ]UL UT` ˪ (cons (car lst) prUJ UT` ) (filter pred (cdr lst)))) UH UT` ma) (else (filter pred (cdr lst))))) UF UT` s) UD UT` (define (stream-filter pred s) UTUB UT` < (cond (( stream-null?  s)  the-empty-stream ) U@ UT` ' ((pred ( stream-car  s))  U> UT` UT5 ( cons-stream  ( stream-car  s) U< UT` ˪D (stream-filter pred ( stream-cdr  s)))) U: UT` = (else (stream-filter pred ( stream-cdr  s))))) /U8 UT`  DU6 UT`  YU4 UT` u !(define (enum-interval low high) nU2 UT`  (if (> low high) U0 UT`  '() U. UT` 2 (cons low (enum-interval (+ low 1) high)))) U, UT` )  PU* UT` &(define (enumerate-interval low high) U( UT` ed (if (> low high) U& UT` ( the-empty-stream U$ UT` ( cons-stream  low UHU" UT` : (enumerate-interval (+ low 1) high)))) +U UT`  HH_VTTHHlSYUU eamd_Wd YYU>UTHH_XW HHU< Ym- ` rSome Simple Streams &UT UT` (e ;UR UT` d  PUP UT` ));; Recursive definition eUN UT` (define (integers-from n) zUL UT` al (cons-stream n TUJ UT` f ) (integers-from (+ 1 n)))) UH UT`  UF UT` (e$(define integers (integers-from 1)) UTUD UT` U* TUB UT` in eU@ UT` lo;; Examples using stream HOP  U> UT` ˪(define no-sevens "U< UT` st6 (stream-filter (lambda (n) (not (divisible? n 7))) 7U: UT`  ˪ integers)) enLU8 UT` +  aU6 UT` UT0(define (divisible? x y) (= (remainder x y) 0)) vU4 UT`   U2 UT`  (stream-ref no-sevens 100) eamU0 UT`  ;Value: 117 U. UT`   YHH_YWHHlV\XX d_Z\\amHH_[Z HHe;;eUN UT\ `  ULSieve of Eratosthenes &UT UT`  UT ;UR UT` ;; Sieve ePUP UT` (define (sieve s) eUN UT`  (cons-stream egezUL UT` 1) (stream-car s) U*UJ UT`  (sieve (stream-filter ;;UH UT` re (lambda (x) UF UT` s 5 (not (divisible? x (stream-car s)))) UD UT` ! (stream-cdr s))))) UB UT`  U8 TU@ UT` U6 T U> UT`  in*(define primes (sieve (integers-from 2))) "U< UT`   7U: UT`  (stream-ref primes 200) 0)LU8 UT`   ;Value: 1229 1aU6 UT`   HH`\ZHHlY_[[ d`.]__amHH`/^] HH7eUN_ `  More Stream Utilities &UT UT`   T;UR UT`  (define (add-streams s1 s2) PUP UT`  ve (cond ((stream-null? s1) s2) -steUN UT`  ˪ ((stream-null? s2) s1) UJzUL UT`   (else UJ UT`  UT: (cons-stream (+ (stream-car s1) (stream-car s2)) UH UT`  (n3 (add-streams (stream-cdr s1) UF UT`  tr8 (stream-cdr s2)))))) U6UD UT`   nUB UT`  si(define (scale-stream c s) UTU@ UT`  U:' (stream-map (lambda (x) (* x c)) s)) 0) U> UT`  V"U< UT` UT(define (show-stream s n) 7U: UT`  (cond ((= n 0) 'done) LU8 UT` * (else (write-line (stream-car s)) aU6 UT` 6 (show-stream (stream-cdr s) (- n 1))))) vU4 UT`  U2 UT` !(define (stream-map2 proc s1 s2) U0 UT`  (if (stream-null? s1) U. UT` S the-empty-stream U, UT` UT) (cons-stream (proc (stream-car s1) U* UT` ve* (stream-car s2)) U( UT` % (stream-map2 proc  U& UT` (e0 (stream-cdr s1) (U$ UT` re4 (stream-cdr s2))))) 3U" UT` " am rHH`1_] HHl\b^^  nd`I` s)bb trHH`Ja` THHstream sb ` 'Stream of Fibonacci numbers &UT UT` $ -l ;UR UT` U6 (define fibs PUP UT` % ho (cons-stream cdreUN UT` U4 0 zUL UT` & UT (cons-stream nUJ UT` c  1 U0UH UT` ' % (add-streams (stream-cdr fibs) UF UT` ( pt fibs)))) UTUD UT` ) am rUB UT` * (show-stream fibs 9) U@ UT` + 0  U> UT` , U(1 "U< UT` - 1 7U: UT` . ap2 LU8 UT` / 3 aU6 UT` 0 5 vU4 UT` 1 cd8 U2 UT` 2 13 4 U0 UT` 3 21 HH`Lb`m rHHl_eaa d`sc neeHH`tdc trHH&`JHHe ` 6 re Square Roots &UT UT` 7  ;UR UT` 8 f &;; Previous procedural implementation PUP UT` (define (sqrt x) eUN UT` 9 ho (define (try guess) zUL UT` :  (if (good-enough? guess) cUJ UT` ; UT guess UH UT` < ˪ (try (improve guess)))) amUF UT` = UT (define (improve guess) UD UT` > UD! (average guess (/ x guess))) *UB UT` ? f (define (good-enough? guess) U>U@ UT` @ 1 (close? (* guess guess) x))  U> UT` A UT (try 1)) 3 "U< UT` B  HH`vec13HHlbhdd d`fhhHH`gf  nHH`th  ` C Stream of Square Roots ) `  U@ UT` N 1 (show-stream (sqrt-stream 2) 7) #U> UT` O UT1. try8U< UT` P ˪1.5 MU: UT` Q 1.4166666666666665 bU8 UT` R 1.4142156862745097 wU6 UT` S d1.4142135623746899 U4 UT` T 1.414213562373095 U2 UT` U 1.414213562373095 U0 UT` V ;Value: done U. UT` W  HH`hfHHlekgg daist-kkUTHHaji lUPHHeinb) 2)) Nk  G ` X UL"Stream to Desired Tolerance Limit &UT UT`  on t;UR UT` UT(define (stream-limit s tol) tPUP UT` Y  (define (iter s) =eUN UT` Z  (let ((f1 (stream-car s)) zUL UT` [ ss, (f2 (stream-car (stream-cdr s)))) ) UJ UT` \ s)" (if (close-enuf? f1 f2 tol) UH UT` ] 7 f2 UF UT` ^ U<# (iter (stream-cdr s))))) ` QUD UT` _ 66 (iter s)) UTUB UT` ` 42 8U@ UT` a UT(define (close-enuf? x y tol)  U> UT` b T (< (abs (- x y)) tol)) 2"U< UT` c 1. 27U: UT` d UT&(stream-limit (sqrt-stream 2) 1.e-5) LU8 UT` e ;Value: 1.4142135623746899 aU6 UT` f  HHakiHHlhnjj dalnnHHaml HH  Desired n t ` f URWitch of Agnesi (d&UT UT` w t  o;UR UT` x Y(define (witch x) PUP UT` y ˪ (/ 4 (+ 1 (* x x)))) strg  h UTh [ ` ! 2  r  # r @The bell-shaped witch of Maria Agnesi can be constructed in the UH)  # Bfollowing way. Start with a circle of diameter a, centered at the ?  # _Dpoint (0,a/2) on the y-axis. Choose a point A on the line y = a and inU  # tCconnect it to the origin with a line segment. Call the point where 1.k  # d?the segment crosses the circle B. Let P be the point where the ;V  # 74Cvertical line through A crosses the horizontal line through B. The  @ # Awitch is the curve traced by P as A moves along the line y = a. HHanlnHHlkqmm dao qq HHapo TUTHH UTitch x) q  y ` g ))Trapezoidal Integration &UT UT` h ! ;UR UT` i #(define (trapezoid f a b h) MPUP UT` j c (let ((dx (* (- b a) h)) eUN UT` k g  (n (/ 1 h))) ezUL UT` l nt (define (iter i sum) #UJ UT` m ) (let ((x (+ a (* i dx)))) tUH UT` n in (if (>= i n) oUF UT` o ig sum meUD UT` p w (iter (+ i 1) UB UT` q se$ (+ sum (f x)))))) reU@ UT` r (* dx  U> UT` s h  (iter 1 izo"U< UT` t B. (+ (/ (f a) 2) wi7U: UT` u ra! (/ (f b) 2)))))) yLU8 UT` v  aU6 UT` w (define (witch x) vU4 UT` x  (/ 4 (+ 1 (* x x)))) mmU2 UT` y  U0 UT` z (trapezoid witch 0. 1. .1) U. UT` { ;Value: 3.1399259889071587 U, UT` |  U* UT` } Y(trapezoid witch 0. 1. .01) U( UT` ~ ;Value: 3.141575986923129  U& UT`  UT HHaqotpeHHlntpp h))dar) ett(dinHHasr etHHv t (it UF ` "Stream of Approximations to  p &UT UT` )  B;UR UT` (define (keep-halving R h) )))PUP UT` r (cons-stream (R h) TeUN UT` * (keep-halving R (/ h 2)))) zUL UT` wi :UJ UT` (show-stream (keep-halving ) yUH UT` 3 (lambda (h) (trapezoid witch 0 1 h)) UF UT` +  0.1) UTUD UT` U0 10) tUB UT` 1.3.1399259889071587 ` {U@ UT` 993.1411759869541287 UT U> UT` U*3.1414884869236115 ape"U< UT` 013.141566611923134 7U: UT` 153.1415861431731273 LU8 UT` 3.1415910259856252 aU6 UT` 3.1415922466887523 lvU4 UT` 3.1415925518645325 U2 UT` 3.1415926281584774 U0 UT` 3.1415926472319597 U. UT` ;Value: done U, UT` t U* UT` (stream-limit U( UT` 4 (keep-halving (lambda (h) (trapezoid witch 0 1 h)) UT U& UT` B 0.5) (dU$ UT` g  1.e-9) UP3U" UT` ;Value: 3.1415926534345684 HU UT`  ]U UT` / 1;; This requires 65,549 evaluations of the witch rU UT` ep lHHatr amHHlqwss  dau ww1.3.HHavu .11HH&UT Y w ` 4 Accelerating the Stream 15&UT UT` U8 T= ` 15Given a sequence of values: S  h 88j, k, l, m, ... 3.i `  2 ` 3.(If we know that  R  has the form 3.  h o T ` ueThen:   h tn *eUR UT` (s azUP UT` ˪ (define (accel-halving-seq s p) h)UN UT` 0  (let ((2^p (expt 2 p))) UL UT` .5 (let ((2^p-1 (- 2^p 1))) 9UJ UT` % (stream-map2 (lambda (Rh Rh/2) UH UT` ( (/ (- (* 2^p Rh/2) 54UF UT` he Rh) HUD UT` a 2^p-1))  UB UT`  s s"U@ UT` & (stream-cdr s))))) HHawuHHltzvv daxzzti tHHayx HHzen h zk ` Rapid Acceleration &UT UT` e (define (make-tableau s p) orm;UR UT`  (define (rows s order) PUP UT`  (cons-stream s eUReUN UT` a3 (rows (accel-halving-seq s order) h)zUL UT` 0 & (+ order p)))) UJ UT` ( (rows s p)) UH UT`  UF UT` p2(define (richardson-accel s p) ` UD UT` . (stream-map stream-car (make-tableau s p))) UB UT`  U@ UT` UT (show-stream  U> UT`  (richardson-accel "U< UT` ; (keep-halving (lambda (h) (trapezoid witch 0 1 h)) .1) cdr7U: UT`  2) aLU8 UT`  5) aU6 UT` 3.1399259889071587 vU4 UT` 3.1415926529697855 xU2 UT` 3.1415926536207945 U0 UT` 3.141592653589793 U. UT` 3.1415926535897944 U, UT`  U* UT` k (stream-limit (richardson-accel d U( UT` UT (keep-halving - U& UT` UR5 (lambda (h) (trapezoid witch 0 1 h)) U$ UT` s- .1) 3U" UT`  2) HU UT` r) 1.e-9) ]U UT` ;Value: 3.1415926536207945 t ` s 0This requires only 73 evaluations of the witch! (dHHazx HHlwyy .ele mhicrdte -lvth =QuickDraw PICT #%v t t``` ttHH tt@                  !&#"  ""!  ! #"""$"$ !"".//@?= :6:&   "  !"((    =EndInset ʨ"!-euvje!- '×[char[R],id[num[0.00000000,"0"]]]O!-euvke!- 'times[char[R],id[char[h]]]|/veuvle-vX '5times[char[R],id[fract[char[h],num[2.00000000,"2"]]]]Sa-/veuvme-vX '5times[char[R],id[fract[char[h],num[4.00000000,"4"]]]]edM%d<-$'equal[over[plus[times[indexes[1,0,num[2.00000000,"2"],char[p]],char[R],id[over[char[h],num[2.00000000,"2"]]]],minus[times[char[R],id[char[h]]]]],plus[indexes[1,0,num[2.00000000,"2"],char[p]],minus[num[1.00000000,"1"]]]],plus[char[A],times[indexes[0,1,char[C],char[x]],indexes[1,0,char[h],times[num[2.00000000,"2"],char[p]]]],times[indexes[0,1,char[D],num[2.00000000,"2"]],indexes[1,0,char[h],times[num[3.00000000,"3"],char[p]]]],char[ldots]]]NWHeuvneu#ݸ'$'equal[times[char[R],id[char[h]]],plus[char[A],times[char[B],indexes[1,0,char[h],char[p]]],times[char[C],indexes[1,0,char[h],times[num[2.00000000,"2"],char[p]]]],times[char[D],indexes[1,0,char[h],times[num[3.00000000,"3"],char[p]]]],char[ldots]]]NHeu000vod5%Leftd6Rightvd7m[ Reference"dDhaumdQtiardTde0,dW]][ndZ[c,td]haind`m[00dcnd,1df"]xed i00,"d l]]d od rd udx a r$f a CellTiny.  f b 0 Bullet1\t. f cCellBody. f d  CellHeading. f e 0 Footnote. lf fTHeading1Body. f gT Heading2Body. f hT  HeadingRunInBody. f i l yIndented. f j  Scheme. f k Body. f l   TableFootnote. f mT  TableTitleT:Table : .  f nPTitleBody. f o T  TableTitleT:Table : . f p   CellHeading. f q  Scheme. f r   CellFooting. f s  SchemeSig. +>@ t  tlHeader. @ u  Ta>Footer. f v Body. f w Scheme. f zEg. Numbered1.\tNumbered. f { THeading1Body.  f | Bulleted\t. @f }T Heading1ContBody. f Body. f CellBody. f Equation. f  HighlightNumberd.  f . Numbered.\t. f CellTiny. $f $. Bullet2-\t.  f  Bullet1\t. +33f +33. SubNumbered < >.\t.   Emphasis EquationVariables         SchemeFont           .Thin  Medium Double Thickph@  Very Thin-=-     oH p rH p rH p rH p rH p rFormat A   ou v b vu v v vou v a vu v v vFormat Beue U e V UComment @ afe d BlackT!WhiteddAReddd Greendd  Blued Cyand Magentad Yellow=M=  M.Times.P Times-RomanM.Arial Rounded MT Bold.B M.Times.B Times-Bold M.Courier.B Courier-Bold M.Courier.BICourier-BoldOblique M.Helvetica.B-Helvetica-Bold M.Symbol.PSymbol M.Times.I Times-ItalicArial Rounded Monotype Bold Courierr HelveticaSymbolTimesRegularRomanrMediumBoldedBold RegularObliqueItalic(m=%/J~A&f"eVgkiSL%Lg E&0%i:^3F"Pur2