Tagged: Structure and Interpretation of Computer Programs
Who has been given the cash changing problem?
Some class, somewhere, has obviously been given the recursive money changing problem as a piece of work, because I have had several hundred visits in the last week from people seeking to get a grip on it.
Here’s the best solution, either buy Structure and Interpretation of Computer Programs or simply read it for free online.
Related articles
- Read Structure and Interpretation of Computer Programs for Free on the iPad (accidentaltechnologist.com)
- Understanding recursion (antoarts.com)
- Modified “sicp/Introduction.page” (gwern.net)
- Recursion First (blogs.msdn.com)
An idea I saw on normblog
Norman Geras is a great man. He’s a social, not a computer, scientist, and this year I have been mainly reading computer books. Still, here’s an idea I have pinched off his website (he got it from here). Match the prompts to books you have read in the last year – in my case mainly computer books.
One time on holiday: Understanding the Linux Virtual Memory Manager
Weekends at my house are: Code Complete
My neighbour is: Programming Pearls
My boss is: The Mythical Man Month
My superhero secret identity is: The Annotated Turing
You wouldn’t like me when I’m angry because: Mussolini’s Italy
I’d win a gold medal in: The Little Schemer
I’d pay good money for: Structure and Interpretation of Computer Programs
If I were Prime Minister I would: Groovy in Action
When I don’t have good books, I: P, NP, and NP-Completeness
Loud talkers at the cinema should be: Albion’s Fatal Tree
Related articles
- Fifty thinkers, zero belief in God (newhumanist.org.uk)
- What Is the Most Influential Programming Book? (news.slashdot.org)
My first R program
Having used Groovy (which makes the scripting environment feel familiar) and some Scheme (via Structure and Interpretation of Computer Programs), R does feel completely alien, but it still feels like a steep learning curve.
But here’s my short script -
unpatched <- read.csv("~/unpatched.txt")
unpatchcons <- transform(unpatched, realm=realm*60 + reals)
attach(unpatchcons)
linelog<-lm(realm~size)
plot(size, realm, log="y")
abline(reg=linelog, untf=TRUE, col="blue",lty=3)
detach(unpatchcons)
And here’s the graph (of Linux kernel compile times) it generates – the blue line is obviously a very bad fit!
Related articles
- Number Representation in 2′s Power using PHP (demlaip.wordpress.com)
- Topcoder – MountainWalk (tuanwiki.wordpress.com)
- Web And Scripting Programming Language Job Trends – August 2011 (regulargeek.com)
- Introducing the lackeyml format (cartesianproduct.wordpress.com)
- Sicp (sicpebook.wordpress.com)
- New electronic version of SICP released ” SICP (sicpebook.wordpress.com)
- The price of syntactical sugar? (cartesianproduct.wordpress.com)
Something more on Fibonacci numbers
My earlier blog about the Fibonacci series gets a lot of hits, so I thought I would write something more, as clearly there is interest.
Once again this is from “Structure and Interpretation of Computer Programs” (available for free here electronically):
Let and
. Then
.
So .
(1)
(2) Then
(3) Simplifying (2)
(4) Simplifying further – from (1):
(5)
(6) We know that so we can restate (5) as
So (7)
But also and (7) can be restated as
In other words, .
Related Articles
- Something interesting about Fibonacci numbers (cartesianproduct.wordpress.com)
- Numbers in Nature – the Movie (delamagente.wordpress.com)
The lambda calculus and closures in Groovy
No sooner had I written about the lambda calculus and Structure and Interpretation of Computer Programs than I sat in a lecture on closures in Groovy and was presented with a structure like this (which multiplies two numbers, in this case 3 and 4):
Which immediately reminded me of one of Alonzo Church‘s formulations of lambdas – eg:
More to come…
Related Articles
- Some differences between lambda-calculus and Lisp (2). (kazimirmajorinc.blogspot.com)
- Hacker News | Compiling to lambda-calculus: Turtles all the way down (news.ycombinator.com)
- Some differences between lambda-calculus and Lisp (1). (kazimirmajorinc.blogspot.com)
Coming up… the lambda calculus
Another thing that The Annotated Turing taught me is what all those lambdas that I have seen over the last 25 years were about, or at least it introduced me to what they were about.
So I have just ordered a copy of Structure and Interpretation of Computer Programs: and I can guess that some blog posts will eventually follow.
Oh no. Maybe I am turning into a LISP hacker – having finally reached the age that all these guys were when I first became aware of them (older, actually).
Related Articles
- Bought on a whim but seems like a good one (cartesianproduct.wordpress.com)
- The importance of Turing’s findings (cartesianproduct.wordpress.com)
- Hacker News | Compiling to lambda-calculus: Turtles all the way down (news.ycombinator.com)



