yangsx


Joined 2 years ago
Homeworks submitted:
Homework comments:
1
0

About Me

No description provided.

Classes

Survey of Artificial Intelligence

Class status: Under Construction
Role: Student
. 0% complete

Introduction to Algorithms (MIT 6.046J)

Class status: Established
Role: Student
. 0% complete

Structure and Interpretation of Computer Programs

Class status: Established
Role: Student
. 7% complete

Submitted Assignments

Structure and Interpretation of Computer Programs: Lesson 2, HW 1

Just the first two exercises.

Ex 1.9

First version

(+ 4 5)

(inc (+ 3 5))

(inc (inc (+ 2 5)))

(inc (inc (inc (+ 1 5))))

(inc (inc (inc (inc (+ 0 5)))))

(inc (inc (inc (inc 5))))

(inc (inc (inc 6)))

(inc (inc 7))

(inc 8)

9

This is a recursive process.

Second version

(+ 4 5)

(+ 3 6)

(+ 2 7)

(+ 1 8)

(+ 0 9)

9

This is an iterative process.

Ex 1.10

(A 1 10) ; 1024

(A 2 4) ; 65536

(A 3 3) ; 65536

f calculates 2n, g calculates 2^n, and h calculates (2^(2^(2^...2))) with 2 occurring n times.


yangsx 2 years ago