SICP Exercise Index

This page provides an index of the Structure and Interpretation of Computer Programs (a.k.a. SICP) exercises and my solutions to them.

If you've been here before and were expecting to see dates along with the exercises then apologies... As I've noted, SICP is quite a bit of work and we (the group I was working through the book with) have decided to move to watching the Berkeley SICP video lectures instead. I'm going to keep on ploughing through the book though.

Chapter 1: Building Abstractions with Procedures

1.1.6: Conditional Expressions and Predicates

1.1
1.2
1.3
1.4
1.5

1.1.7: Example: Square Roots by Newton's Method

1.6
1.7
1.8

1.2.1: Linear Recursion and Iteration

1.9
1.10

1.2.2: Tree Recursion

1.11
1.12
1.13

1.2.3: Orders of Growth

1.14
1.15

1.2.4: Exponentiation

1.16
1.17
1.18
1.19

1.2.5: Greatest Common Divisors

1.20

1.2.6: Example: Testing for Primality

1.21
1.22
1.23
1.24
1.25
1.26
1.27
1.28

1.3.1: Procedures as Arguments

1.29
1.30
1.31
1.32
1.33

1.3.2: Constructing Procedures Using Lambda

1.34

1.3.3: Procedures as General Methods

1.35
1.36
1.37
1.38
1.39

1.3.4: Procedures as Returned Values

1.40
1.41
1.42
1.43
1.44
1.45
1.46

Chapter 2: Building Abstractions with Data

2.1.1: Example: Arithmetic Operations for Rational Numbers

2.1

2.1.2: Abstraction Barriers

2.2
2.3

2.1.3: What Is Meant by Data?

2.4
2.5
2.6

2.1.4: Extended Exercise: Interval Arithmetic

2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16

2.2.1: Representing Sequences

2.17
2.18
2.19
2.20
2.21
2.22
2.23

2.2.2: Hierarchical Structures

2.24
2.25
2.26
2.27
2.28
2.29
2.30
2.31
2.32

2.2.3: Sequences as Conventional Interfaces

2.33
2.34
2.35
2.36
2.37
2.38
2.39
2.40
2.41
2.42
2.43

2.2.4: Example: A Picture Language

2.44
2.45
2.46
2.47
2.48
2.49
2.50
2.51
2.52

2.3.1: Quotation

2.53
2.54
2.55

2.3.2: Example: Symbolic Differentiation

2.56
2.57
2.58(a)
2.58(b)

2.3.3: Example: Representing Sets

2.59
2.60
2.61
2.62
2.63
2.64
2.65
2.66

2.3.4: Example: Huffman Encoding Trees

2.67
2.68
2.69
2.70
2.71
2.72

2.4.3: Data-Directed Programming and Additivity

2.73
2.74
2.75
2.76

2.5.1: Generic Arithmetic Operations

2.77
2.78
2.79
2.80

2.5.2: Combining Data of Different Types

2.81
2.82
2.83
2.84
2.85
2.86

2.5.3: Example: Symbolic Algebra

2.87
2.87(+)
2.88
2.89
2.90(1)
2.90(2)
2.90(3)
2.91
2.92(1)
2.92(2)
2.92(3)
2.93
2.94
2.95
2.96
2.97

Chapter 3: Modularity, Objects, and State

3.1.1: Local State Variables

3.1
3.2
3.3
3.4

3.1.2: The Benefits of Introducing Assignment

3.5
3.6

3.1.3: The Costs of Introducing Assignment

3.7
3.8

3.2.2: Applying Simple Procedures

3.9

3.2.3: Frames as the Repository of Local State

3.10

3.2.4: Internal Definitions

3.11

3.3.1: Mutable List Structure

3.12
3.13
3.14
3.15
3.16
3.17
3.18
3.19
3.20

3.3.2: Representing Queues

3.21
3.22
3.23

3.3.3: Representing Tables

3.24
3.25
3.26
3.27

3.3.4: A Simulator for Digital Circuits

3.28
3.29
3.30
3.31
3.32

3.3.5: Propagation of Constraints

3.33
3.34
3.35
3.36
3.37

3.4.1: The Nature of Time in Concurrent Systems

3.38

3.4.2: Mechanisms for Controlling Concurrency

3.39
3.40
3.41
3.42
3.43
3.44
3.45
3.46
3.47
3.48
3.49

3.5.1: Streams Are Delayed Lists

3.50
3.51
3.52

3.5.2: Infinite Streams

3.53
3.54
3.55
3.56
3.57
3.58
3.59
3.60
3.61
3.62

3.5.3: Exploiting the Stream Paradigm

3.63
3.64
3.65
3.66
3.67
3.68
3.69
3.70
3.71
3.72
3.73
3.74
3.75
3.76

3.5.4: Streams and Delayed Evaluation

3.77
3.78
3.79
3.80

3.5.5: Modularity of Functional Programs and Modularity of Objects

3.81
3.82

Chapter 4: Metalinguistic Abstraction

4.1.1: The Core of the Evaluator

4.1

4.1.2: Representing Expressions

4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10

4.1.3: Evaluator Data Structures

4.11
4.12
4.13

4.1.4: Running the Evaluator as a Program

4.14

4.1.5: Data as Programs

4.15

4.1.6: Internal Definitions

4.16
4.17
4.18
4.19
4.20
4.21

4.1.7: Separating Syntactic Analysis from Execution

4.22
4.23
4.24

4.2.1: Normal Order and Applicative Order

4.25
4.26

4.2.2: An Interpreter with Lazy Evaluation

4.27
4.28
4.29
4.30
4.31

4.2.3: Streams as Lazy Lists

4.32
4.33
4.34

4.3.1: Amb and Search

4.35
4.36
4.37

4.3.2: Examples of Nondeterministic Programs

4.38
4.39
4.40
4.41
4.42
4.44
4.45
4.46
4.47
4.48
4.49

4.3.3: Implementing the Amb Evaluator

4.50
4.51
4.52
4.53
4.54

4.4.1: Deductive Information Retrieval

4.55
4.56
4.57
4.58
4.59
4.60
4.61
4.62
4.63

4.4.3: Is Logic Programming Mathematical Logic?

4.64
4.65
4.66
4.67
4.68
4.69

4.4.4.5: Maintaining the Data Base

4.70

4.4.4.8: Frames and Bindings

4.71
4.72
4.73
4.74
4.75
4.76
4.77
4.78
4.79

Chapter 5: Computing with Register Machines

5.1: Designing Register Machines

5.1

5.1.1: A Language for Describing Register Machines

5.2

5.1.2: Abstraction in Machine Design

5.3

5.1.4: Using a Stack to Implement Recursion

5.4
5.5
5.6

5.2: A Register-Machine Simulator

5.7

5.2.2: The Assembler

5.8

5.2.3: Generating Execution Procedures for Instructions

5.9
5.10
5.11
5.12
5.13

5.2.4: Monitoring Machine Performance

5.14
5.15
5.16
5.17
5.18
5.19

5.3.1: Memory as Vectors

5.20
5.21
5.22

5.4.3: Conditionals, Assignments, and Definitions

5.23
5.24
5.25

5.4.4: Running the Evaluator

5.26
5.27
5.28
5.29
5.30

5.5.1: Structure of the Compiler

5.31
5.32

5.5.5: An Example of Compiled Code

5.33
5.34
5.35
5.36
5.37
5.38

5.5.6: Lexical Addressing

5.39
5.40
5.41
5.42
5.43
5.44

5.5.7: Interfacing Compiled Code to the Evaluator

5.45
5.46
5.47
5.48
5.49
5.50
5.51
5.52

2 comments:

  1. Hey,
    I REALLY appreciated the thorough explanations. Your solutions are verbose and informative. These are really helping me learn SICP well.

    Thanks so much.

    ReplyDelete
  2. Glad you're finding them useful!

    ReplyDelete