Coder Social home page Coder Social logo

sicp-solutions.net's Introduction

sicp-solutions.net's People

Contributors

producermatt avatar sgignoux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

sicp-solutions.net's Issues

Ex 2.1 Bug

The solution has a bug. For the reason, check here. In short, you need to use abs on the result of gcd.

Ex 1.10

Both g(n) and h(n) should be piecewise functions where

  • g(n) = 2 ^ n (when n > 0); 0 (when n = 0);
  • h(n) = 2 ^ h(n-1) (when n > 1); 2 (when n = 1); 0 (when n = 0)

Will you have more solutions

Hi, will there be more solutions for the remaining exercises?
These are very nice and useful, and I want to thank you for these nice solutions so far @sgignoux

mistake in your solution of the Exercise 1.13

Dear Sébastien,
I believe I have found a mistake in your solution of the Exercise 1.13
from SICP.

In the proof, you state that 0 < ψ < 1. Since ψ = (1 - sqrt(5)) / 2 ≃
−0.62, this is clearly not the case. You should add an absolute value to
the proof.

Exercise 1.14 Typo

Towards the end of the solution for 1.14 (below the text "by continuing to apply the formulas") it is stated that the summands should be:

T(n-10i,1) for T(n,3)
T(n-25i,1) for T(n,4)
T(n-50i, 1) for T(n,5)

But it seems it should be:

T(n-10i,2) for T(n,3)
T(n-25i,3) for T(n,4)
T(n-50i,4) for T(n,5)

Ex 1.13 - concluding statement.

Your solution to ex 1.13 helped me a lot to understand it; thank you.

In your concluding statement

This show that φ^n/√5 will never be further away from the value of Fib(n) than 1

I would change this to

This shows that φ^n/√5 will never be further away from the value of Fib(n) than 1/2

Since the previous statement bounds the value of φ^n/√5 to Fib(n) +/- 1/2

Exercise 2.10: off by one

Interval boundaries should be checked as well:

#;1> (div-interval (make-interval 1 2) (make-interval 22 0))

Error: (/) division by zero
1.0
0

        Call history:

        <eval>    [div-interval] (lower-bound y)
        <eval>    [lower-bound] (min (car i) (cdr i))
        <eval>    [lower-bound] (car i)
        <eval>    [lower-bound] (cdr i)
        <eval>    [div-interval] (mul-interval x (make-interval (/ 1.0 (upper-bound y)) (/ 1.0 (lower-bound y))))
        <eval>    [div-interval] (make-interval (/ 1.0 (upper-bound y)) (/ 1.0 (lower-bound y)))
        <eval>    [div-interval] (/ 1.0 (upper-bound y))
        <eval>    [div-interval] (upper-bound y)
        <eval>    [upper-bound] (max (car i) (cdr i))
        <eval>    [upper-bound] (car i)
        <eval>    [upper-bound] (cdr i)
        <eval>    [div-interval] (/ 1.0 (lower-bound y))
        <eval>    [div-interval] (lower-bound y)
        <eval>    [lower-bound] (min (car i) (cdr i))
        <eval>    [lower-bound] (car i)
        <eval>    [lower-bound] (cdr i) <--

Exercise 1.6

For some reason, it doesn't go into an infinite loop for me, ( I use the Pretty-big interpreter in DrRacket)
and the result is almost the same except for the natural numbers that have a natural square root, s.t (sqrt 4)
with normal if (sqrt 4) gives 2.0000xxxxxx which x's represent some garbage of numbers
but with the If procedure, it produces the natural number 2 w/o any fractions

Typo in solution 1.14

Hi, thank you for making your solutions and work available. It is nice having your insight available as I work through the wizard book!

In your solution for 1.14 you have a slight typo in the below section

Let's break it down:

- There are 4 green nodes for `(c x 2)` corresponding to how many time you can subtract a dime from 12, plus one.
- Then for each of the green node, there is the option of using only dime, which is the case that we looked at first.

You say dime, but in the example you are showing nickels.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.