Hello /prog/
I am reading SICP, should i do all exercises of the book?
I can't wrap my head around the code.
I've even googled for solutions, but i have to write them down and follow/write each call with pencil.
Seriously, i wouldn't have problem with most of the algorithms given if i could use some other language.
Do i fail at maths?
help.
Name:
Anonymous2007-11-24 19:28
WHAT PART OF READ SICP DO YOU NOT UNDERSTAND?!
Name:
Anonymous2007-11-24 19:47
>>1
You are not ready for Scheme, you will never become an EXPERT PROGRAMMER.
Name:
Anonymous2007-11-24 20:32
Some of the exercises are very rigorous but yes you fail if you can't do most of them.
Name:
Anonymous2007-11-24 22:31
rigorous
That word does not mean what you think it does.
rigorous
adj 1: rigidly accurate; allowing no deviation from a standard;
"rigorous application of the law"; "a strict
vegetarian" [syn: strict]
2: demanding strict attention to rules and procedures;
"rigorous discipline"; "tight security"; "stringent safety
measures" [syn: stringent, tight]
3: (of circumstances; especially weather) causing suffering;
"brutal weather"; "northern winters can be cruel"; "a
cruel world"; "a harsh climate; "a rigorous climate";
"unkind winters" [syn: brutal, cruel, harsh, unkind]
???
Name:
Anonymous2007-11-24 23:52
>>6
Well done, you can use a dictionary. Now can you also figure out why that adjective does not apply to the exercises in SICP?
I am reading SICP, should i do all exercises of the book?
Basically, yes. I skipped the HUEG ones.
I've even googled for solutions, but i have to write them down and follow/write each call with pencil.
You know, there're actual Scheme interpreters available. No need to use pencil and paper. Stop googling for solutions, though.
Seriously, i wouldn't have problem with most of the algorithms given if i could use some other language.
You're just too trapped in thinking in (what I assume to be) C-inspired languages.
Do i fail at maths?
I don't understand how math even enters the equation here. I'm no mathematican, and I encountered many of the mathematical concepts in the exercises for the first time. The concepts are explained well enough for them not to become an obstacle.
Name:
Anonymous2007-11-25 7:25
You're just too trapped in thinking in (what I assume to be) C-inspired languages.
Imperative vs Functional. Lern2paradigm.
Name:
Anonymous2007-11-25 7:29
Imperative vs Functional. Lern2paradigm.
I can't believe how dense you are.
OP here, so .. i am doing this exercise, write an iterative factorial.
Looking at the recursive one, we see
(define (f n) (* n (f (- n 1))))
There's only one call to itself, therefore writing it as an iterative function is easy.
however, then it asks me to write A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. Write a procedure that computes f by means of a recursive process. Write a procedure that computes f by means of an iterative process.
I simply cannot come up with something, each function results to 3 calls to itself if n>2.
How the fuck?? ... how.
Can someone please explain?
I mean, just the logic, seriously.
Name:
Anonymous2007-11-25 20:46
>>21 In general, an iterative process is one whose state can be summarized by a fixed number of state variables, together with a fixed rule that describes how the state variables should be updated as the process moves from state to state and an (optional) end test that specifies conditions under which the process should terminate.
Think about it.
The state of the program can be summarized by four variables: i, f(i - 1), f(i - 2), and f(i - 3). Given these variables, it is trivial to compute f(i). The state transformation substitutes (i + 1) for i, f(i) for f(i - 1), f(i - 1) for f(i - 2), and f(i -2) for f(i - 3). For n > 3, f(n) can be computed by setting i := 3 and iterating; computation stops when i = n.