<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><!-- generator="wordpress/2.3.3" --><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
<channel>
	<title>Comments for SICP по-русски</title>
	<link>http://sicp.sergeykhenkin.com</link>
	<description>Структура и интерпретация компьютерных программ: заметки и решения</description>
	<pubDate>Sun, 21 Feb 2010 21:21:06 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.3</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/sicp-russian-comments" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="sicp-russian-comments" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Comment on Решение упражнения 1.12 из SICP by Anonymous</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-12/#comment-9433</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 21 Feb 2010 08:24:44 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-12/#comment-9433</guid>
		<description>&lt;pre&gt;
(define (f x y)
        (cond ((or (&gt; y x) (&lt; y 1)) 0)
              ((or (= x 1) (= y 1)) 1)
        (else (+ (f (- x 1) (- y 1)) (f (- x 1) y))))
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre>
(define (f x y)
        (cond ((or (&gt; y x) (&lt; y 1)) 0)
              ((or (= x 1) (= y 1)) 1)
        (else (+ (f (- x 1) (- y 1)) (f (- x 1) y))))
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 2.39 из SICP by магомед</title>
		<link>http://sicp.sergeykhenkin.com/2008/01/31/sicp-exercise-solution-2-39/#comment-9391</link>
		<dc:creator>магомед</dc:creator>
		<pubDate>Mon, 15 Feb 2010 15:08:59 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2008/01/31/sicp-exercise-solution-2-39/#comment-9391</guid>
		<description>вот втором случае можно также сделать
(define (my-left-reverse sequence)
  (fold-left (lambda (x y) (append (list y ) x)) nil sequence))</description>
		<content:encoded><![CDATA[<p>вот втором случае можно также сделать<br />
(define (my-left-reverse sequence)<br />
  (fold-left (lambda (x y) (append (list y ) x)) nil sequence))</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on SICP или Азбука для настоящих программистов by bobry</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/13/sicp-or-the-true-programmer-abc-book/#comment-9304</link>
		<dc:creator>bobry</dc:creator>
		<pubDate>Sun, 07 Feb 2010 14:58:43 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/13/sicp-or-the-true-programmer-abc-book/#comment-9304</guid>
		<description>очень жаль, что даже в северной столице найти книгу практически невозможно
а сайт московского издательства уже достаточно давно не работает</description>
		<content:encoded><![CDATA[<p>очень жаль, что даже в северной столице найти книгу практически невозможно<br />
а сайт московского издательства уже достаточно давно не работает</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.12 из SICP by синдикат</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-12/#comment-9048</link>
		<dc:creator>синдикат</dc:creator>
		<pubDate>Thu, 21 Jan 2010 15:12:05 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-12/#comment-9048</guid>
		<description>&lt;code&gt;(define (paskal row col)
  (if (or (= col 1) (= row col))
      1
      (+ (paskal (- row 1) col)
         (paskal (- row 1) (- col 1)))))&lt;/code&gt;
Принципиально не отличается (=</description>
		<content:encoded><![CDATA[<p><code>(define (paskal row col)<br />
  (if (or (= col 1) (= row col))<br />
      1<br />
      (+ (paskal (- row 1) col)<br />
         (paskal (- row 1) (- col 1)))))</code><br />
Принципиально не отличается (=</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.11 из SICP by синдикат</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-11/#comment-9046</link>
		<dc:creator>синдикат</dc:creator>
		<pubDate>Thu, 21 Jan 2010 13:51:45 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-11/#comment-9046</guid>
		<description>Роман Жуков правильно заметил насчёт отрицательных, поэтому моя программа получилась так:

&lt;code&gt;
(define (fib3 n)
  (if (&lt; n 3)
      n
      (fib3-iter 2 1 0 n)))

(define (fib3-iter a b c count)
  (if (= count 0)
      c
      (fib3-iter (+ a b c) a b (- count 1))))
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Роман Жуков правильно заметил насчёт отрицательных, поэтому моя программа получилась так:</p>
<p><code><br />
(define (fib3 n)<br />
  (if (&lt; n 3)<br />
      n<br />
      (fib3-iter 2 1 0 n)))</p>
<p>(define (fib3-iter a b c count)<br />
  (if (= count 0)<br />
      c<br />
      (fib3-iter (+ a b c) a b (- count 1))))<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.37 из SICP by smersh</title>
		<link>http://sicp.sergeykhenkin.com/2007/10/24/sicp-exercise-solution-1-37/#comment-8880</link>
		<dc:creator>smersh</dc:creator>
		<pubDate>Sat, 09 Jan 2010 18:45:01 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/10/24/sicp-exercise-solution-1-37/#comment-8880</guid>
		<description>У меня получилось 12, с таким вот кодом:
&lt;code&gt;
(define (cont-frac Ni Di k)
  (define (proc count)
    (/ (Ni count) (+ (Di count)
      (if (= count k)
          1
          (proc (+ count 1))))))
  (proc 1))

(define (fixed-point f first-guess tolerance)
  (define (close-enough? v1 v2)
    (&lt; (abs (- v1 v2)) tolerance))
  (define (try prev count)
    (let ((next (f count)))
         (if (close-enough? prev next)
             count
             (try next (+ count 1)))))
  (try first-guess 1))

(define (c-f-c k)
  (/ 1 (cont-frac (lambda (i) 1.0)
                  (lambda (i) 1.0)
                  k)))

(fixed-point c-f-c 1 0.00005)
&lt;b&gt;12&lt;/b&gt;
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>У меня получилось 12, с таким вот кодом:<br />
<code><br />
(define (cont-frac Ni Di k)<br />
  (define (proc count)<br />
    (/ (Ni count) (+ (Di count)<br />
      (if (= count k)<br />
          1<br />
          (proc (+ count 1))))))<br />
  (proc 1))</p>
<p>(define (fixed-point f first-guess tolerance)<br />
  (define (close-enough? v1 v2)<br />
    (&lt; (abs (- v1 v2)) tolerance))<br />
  (define (try prev count)<br />
    (let ((next (f count)))<br />
         (if (close-enough? prev next)<br />
             count<br />
             (try next (+ count 1)))))<br />
  (try first-guess 1))</p>
<p>(define (c-f-c k)<br />
  (/ 1 (cont-frac (lambda (i) 1.0)<br />
                  (lambda (i) 1.0)<br />
                  k)))</p>
<p>(fixed-point c-f-c 1 0.00005)<br />
<b>12</b><br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.18 из SICP by JessicaFletcher</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/29/sicp-exercise-solution-1-18/#comment-8821</link>
		<dc:creator>JessicaFletcher</dc:creator>
		<pubDate>Wed, 06 Jan 2010 05:06:36 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/29/sicp-exercise-solution-1-18/#comment-8821</guid>
		<description>&lt;pre&gt;
(define (* a b)
  (cond (= b 0) a
        (even? b) (* (+ a b) (- b 1))
        (else (* (double a) (half b)))))
        
(define (even? b)
  (if (= b 1) true
      false))
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<pre>
(define (* a b)
  (cond (= b 0) a
        (even? b) (* (+ a b) (- b 1))
        (else (* (double a) (half b)))))

(define (even? b)
  (if (= b 1) true
      false))
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.22 из SICP by smersh</title>
		<link>http://sicp.sergeykhenkin.com/2007/10/10/sicp-exercise-solution-1-22/#comment-8768</link>
		<dc:creator>smersh</dc:creator>
		<pubDate>Wed, 30 Dec 2009 17:21:19 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/10/10/sicp-exercise-solution-1-22/#comment-8768</guid>
		<description>2Johnny нужно установить новый язык SICP (установка работает только с последней версией drscheme!). Там рантайм уже есть в стандартной библиотеке.
http://www.neilvandyke.org/sicp-plt/</description>
		<content:encoded><![CDATA[<p>2Johnny нужно установить новый язык SICP (установка работает только с последней версией drscheme!). Там рантайм уже есть в стандартной библиотеке.<br />
<a href="http://www.neilvandyke.org/sicp-plt/" rel="nofollow">http://www.neilvandyke.org/sicp-plt/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.13 из SICP by sindikat</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-13/#comment-8561</link>
		<dc:creator>sindikat</dc:creator>
		<pubDate>Thu, 17 Dec 2009 12:14:10 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/20/sicp-exercise-solution-1-13/#comment-8561</guid>
		<description>Вот как решил эту задачу я. Скажите, правильно ли это?

Сначала доказал, что (φ^n - ψ^n) / √5 равен 0 при n=0 и равен 1 при n=1.

Затем вывел такую формулу:

(φ^n - ψ^n) / √5 = (φ^n-1 - ψ^n-1) / √5 + (φ^n-2 - ψ^n-2) / √5 -- по определению функции Фибоначчи.

Перенёс правую часть уравнения влево, извлёк общие множители:

(φ^n - ψ^n - φ^n-1 + ψ^n-1 - φ^n-2 + ψ^n-2) / √5 = (φ^n-2 * (φ^2 - φ - 1) - ψ^n-2 * (ψ^2 - ψ - 1)) / √5 = 0

Осталось вычислить (φ^2 - φ - 1) и (ψ^2 - ψ - 1), которые оказались равны нулю.

(φ^n-2 * 0 - ψ^n-2 * 0) / √5 = 0 -- тождество.

ЧТД</description>
		<content:encoded><![CDATA[<p>Вот как решил эту задачу я. Скажите, правильно ли это?</p>
<p>Сначала доказал, что (φ^n - ψ^n) / √5 равен 0 при n=0 и равен 1 при n=1.</p>
<p>Затем вывел такую формулу:</p>
<p>(φ^n - ψ^n) / √5 = (φ^n-1 - ψ^n-1) / √5 + (φ^n-2 - ψ^n-2) / √5 &#8212; по определению функции Фибоначчи.</p>
<p>Перенёс правую часть уравнения влево, извлёк общие множители:</p>
<p>(φ^n - ψ^n - φ^n-1 + ψ^n-1 - φ^n-2 + ψ^n-2) / √5 = (φ^n-2 * (φ^2 - φ - 1) - ψ^n-2 * (ψ^2 - ψ - 1)) / √5 = 0</p>
<p>Осталось вычислить (φ^2 - φ - 1) и (ψ^2 - ψ - 1), которые оказались равны нулю.</p>
<p>(φ^n-2 * 0 - ψ^n-2 * 0) / √5 = 0 &#8212; тождество.</p>
<p>ЧТД</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Решение упражнения 1.3 из SICP by синдикат</title>
		<link>http://sicp.sergeykhenkin.com/2007/08/14/sicp-exercise-solution-1-3/#comment-8523</link>
		<dc:creator>синдикат</dc:creator>
		<pubDate>Tue, 15 Dec 2009 15:08:39 +0000</pubDate>
		<guid>http://sicp.sergeykhenkin.com/2007/08/14/sicp-exercise-solution-1-3/#comment-8523</guid>
		<description>Сначала написал на Си, потом перевёл на Лисп. Косность мышления сказалась (=

&lt;pre&gt;
(define (square x) (* x x))

(define (sqsum2 x y z)
  (if (&gt; x y)
      (if (&gt; y z)
          (+ (square x) (square y))
          (+ (square x) (square z)))
      (if (&gt; x z)
          (+ (square x) (square y))
          (+ (square y) (square z)))))
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Сначала написал на Си, потом перевёл на Лисп. Косность мышления сказалась (=</p>
<pre>
(define (square x) (* x x))

(define (sqsum2 x y z)
  (if (&gt; x y)
      (if (&gt; y z)
          (+ (square x) (square y))
          (+ (square x) (square z)))
      (if (&gt; x z)
          (+ (square x) (square y))
          (+ (square y) (square z)))))
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
