2009 Mar 02 00:02:16 hello 2009 Mar 02 00:02:24 hi 2009 Mar 02 00:03:08 this is the meeting time right? 2009 Mar 02 00:03:26 Think so 2009 Mar 02 00:04:10 -*- inimino wonders who all is here 2009 Mar 02 00:04:19 nobody here but us zombie processes. 2009 Mar 02 00:04:35 hehe 2009 Mar 02 00:04:57 quick show of hands? 2009 Mar 02 00:05:50 nicou? 2009 Mar 02 00:05:57 chrisconley? 2009 Mar 02 00:06:27 eerily quiet 2009 Mar 02 00:06:31 indeed 2009 Mar 02 00:06:40 here-hey all! 2009 Mar 02 00:07:02 Well, if nobody's gonna drink this beer ... 2009 Mar 02 00:07:28 hey chris 2009 Mar 02 00:08:33 I wonder where nicou and paul_hfx are 2009 Mar 02 00:08:38 did we decide on a new format for the meetings? 2009 Mar 02 00:09:10 chrisconley: not really, I think it's waiting for more people to give their opinions 2009 Mar 02 00:09:20 do you think itd be useful to post a full log of every meeting for archive purposes, inimino? 2009 Mar 02 00:09:29 mariorz had some ideas 2009 Mar 02 00:09:41 facedownH: yeah, nicou_ usually posts the logs 2009 Mar 02 00:09:48 ah 2009 Mar 02 00:10:03 hey all 2009 Mar 02 00:10:06 facedownH: but I'll do it this time if he doesn't wake up 2009 Mar 02 00:11:43 so should we start or wait a bit longer? 2009 Mar 02 00:12:21 i think we could start 2009 Mar 02 00:12:26 ok 2009 Mar 02 00:12:33 rather a lot to get through 2009 Mar 02 00:12:37 we're starting with 1.28 right? 2009 Mar 02 00:12:59 Yes, 1.28 as the last problem in 1.2 2009 Mar 02 00:13:11 ok 2009 Mar 02 00:13:44 whoops, i figured i missed this discussion last week so i didn't do it :) 2009 Mar 02 00:14:19 oh hehe 2009 Mar 02 00:14:35 busted ;-) 2009 Mar 02 00:14:59 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.28.scm 2009 Mar 02 00:15:04 http://mibbit.com/pb/DYjMiH 2009 Mar 02 00:15:07 ha 2009 Mar 02 00:17:42 it looks like you two might be the only good students here 2009 Mar 02 00:17:54 inimino: im unabel to get the foprmating right here http://inimino.org/SICP-wiki/doku.php?do=show&id=exercise_1.30 2009 Mar 02 00:17:57 whats the trick? 2009 Mar 02 00:18:04 s/unabel/unable/ 2009 Mar 02 00:19:25 mariorz: 2009 Mar 02 00:19:33 I fixed it 2009 Mar 02 00:19:53 inimino: ah cool 2009 Mar 02 00:20:19 inimo: in your solution you have: (remainder (one-to-zero (square n)) m))) 2009 Mar 02 00:20:49 But I think you need to take the remainder (modulo) before you convert 1 to 0 2009 Mar 02 00:21:39 aamar: I'm not sure, I'm confused by your answer too. 2009 Mar 02 00:22:46 Well, yours is a lot shorter -- that's good. 2009 Mar 02 00:24:22 hm... I see how yours works now 2009 Mar 02 00:25:33 Okay, the "test" procedure you have checks to see if something is a "nontrivial square root of 1" 2009 Mar 02 00:25:39 It's very elegant. I think it's correct 2009 Mar 02 00:25:58 ok 2009 Mar 02 00:26:46 I should have used better names than "test" 2009 Mar 02 00:27:07 yours looks correct also 2009 Mar 02 00:27:31 Should we move onto a problem where more people can participate? 2009 Mar 02 00:27:40 yes :-) 2009 Mar 02 00:27:49 == Section 1.3 == 2009 Mar 02 00:28:19 1.29 is section 1.3 right? 2009 Mar 02 00:28:59 ah, yes 2009 Mar 02 00:29:11 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.29.scm 2009 Mar 02 00:29:34 this one's also on the wiki I think 2009 Mar 02 00:29:44 rudybot: init http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.29.scm 2009 Mar 02 00:29:45 *offby1: error: make-evaluator: expecting a single `module' program; got more than a single expression 2009 Mar 02 00:29:47 damn 2009 Mar 02 00:29:57 http://mibbit.com/pb/kW1sdD 2009 Mar 02 00:31:24 offby1: so if I folded all those into one (define) would that work? 2009 Mar 02 00:32:28 aamar: looks good 2009 Mar 02 00:32:29 http://github.com/jcoglan/heist/blob/d4b6946d2dc4fe6837415a41a6fcd12e4fb0f42c/sicp/section-1-3.scm#L7-44 2009 Mar 02 00:32:48 inimino: yours matches up with mine 2009 Mar 02 00:32:57 yeah 2009 Mar 02 00:34:50 jcoglan: looks good too, what's Heist? 2009 Mar 02 00:35:32 jcoglan's implementation of scheme in ruby 2009 Mar 02 00:35:33 it's the Scheme engine I've been working on in Ruby 2009 Mar 02 00:35:41 oh, very cool 2009 Mar 02 00:35:47 first release came out this week 2009 Mar 02 00:35:54 nice 2009 Mar 02 00:36:17 Glad implementing scheme isn't a required part of SICP 2009 Mar 02 00:36:29 turns out I really had to make tail recursion work or parts of SICP were impossible 2009 Mar 02 00:36:33 I thought it was :-) 2009 Mar 02 00:36:39 jcoglan: ah 2009 Mar 02 00:36:42 later, later 2009 Mar 02 00:36:46 hehe 2009 Mar 02 00:37:07 okay, so no questions on this one? 2009 Mar 02 00:37:31 should we move on? 2009 Mar 02 00:37:37 let's 2009 Mar 02 00:37:56 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-30.ss 2009 Mar 02 00:38:02 http://mibbit.com/pb/gcGFTr 2009 Mar 02 00:38:40 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.30 2009 Mar 02 00:38:52 (was part of my 1.29 solution, but...) http://github.com/jcoglan/heist/blob/d4b6946d2dc4fe6837415a41a6fcd12e4fb0f42c/sicp/section-1-3.scm#L17-24 2009 Mar 02 00:40:04 This one was easy... 2009 Mar 02 00:40:05 all those look the same, but for the different choice of > or = 2009 Mar 02 00:40:15 yeah it was easy 2009 Mar 02 00:40:21 1.31 2009 Mar 02 00:41:24 http://mibbit.com/pb/B232B9 2009 Mar 02 00:41:30 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.31a.scm 2009 Mar 02 00:41:35 http://github.com/jcoglan/heist/blob/d4b6946d2dc4fe6837415a41a6fcd12e4fb0f42c/sicp/section-1-3.scm#L47-85 2009 Mar 02 00:42:02 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-31.ss 2009 Mar 02 00:45:30 inimino: why do you have square in approx-pi? 2009 Mar 02 00:46:21 aamar: I did that to cut down the number of multiplications required 2009 Mar 02 00:47:08 Oh okay, so your 10 terms corresponds to 20 terms for me or chrisconley' 2009 Mar 02 00:47:10 if you multiply (n..m) and then square it, it's quicker than multiplying (n,n,...m,m) 2009 Mar 02 00:47:20 :) 2009 Mar 02 00:47:21 if you rearrange the formula a bit you get a term like (4/3 * 4/3 * 6/5 * 6/5 * 8/7 * 8/7 ...) 2009 Mar 02 00:47:22 yeah 2009 Mar 02 00:47:35 inimino: there's a technique for doing fast exponentiation that takes advantage of that. 2009 Mar 02 00:47:47 so, use a list half the length but square the ters 2009 Mar 02 00:47:54 offby1: so I've heard 2009 Mar 02 00:48:22 jcoglan: yeah 2009 Mar 02 00:49:05 oh, here's the other half of mine: http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.31b.scm 2009 Mar 02 00:49:35 (just noticed mine wasn't all on one page) 2009 Mar 02 00:50:29 jcoglan -- I feel that the issue with doing your approach is that you end up getting a "worse" approximation, in a sense. 2009 Mar 02 00:50:52 how do you mean? 2009 Mar 02 00:51:15 For example if you just take 2 terms, you're getting 8 * (4/3)^2 + (6/5)^2 2009 Mar 02 00:51:18 Right? 2009 Mar 02 00:51:49 hm 2009 Mar 02 00:52:11 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.31 2009 Mar 02 00:52:18 Whereas the original formula would want you to do: 4 * 2/3 * 4/3 * 4/5 * 6/5 * 6/7 2009 Mar 02 00:52:37 You're off by a half-term. 2009 Mar 02 00:52:49 sorry back, jsut dumped what i had to the wiki 2009 Mar 02 00:53:11 -*- inimino is still thinking about jcoglan's approach 2009 Mar 02 00:54:04 mariorz: did you do the other part of 1.31.a? 2009 Mar 02 00:54:20 I think it's 8 * ((4/3)^2 * (6/5)^2) / 4 2009 Mar 02 00:54:57 inimino: i dont see it, i think i just did it in the repl 2009 Mar 02 00:55:18 mariorz: oh, ok 2009 Mar 02 00:57:13 jcoglan, come to think of it, you have a / 2n term which actually fixes the whole thing. 2009 Mar 02 00:57:28 ok, I get it now 2009 Mar 02 00:57:30 somehow missed that 2009 Mar 02 00:58:25 I'm not sure how it works exactly. 2009 Mar 02 00:58:26 I know I put in that term to produce the same number of numerator/denominator terms. wrote that solution a couple weeks ago so trying to retrace my reasoning 2009 Mar 02 00:59:07 certainly it's not as efficient as it could be, I was just looking for the simplest way to express the sequence 2009 Mar 02 00:59:11 it makes sense 2009 Mar 02 00:59:12 inimino: i found what i did on put it on the wiki (for finding pi) 2009 Mar 02 00:59:16 For 2 terms, you're doing 4 * 2 * (4/3)^2 * (6/5)^2 / 4 2009 Mar 02 00:59:26 probably someone should put somehting better mine is ugly 2009 Mar 02 00:59:29 I'm not sure if there's a difference in efficiency between jcoglan's and mine 2009 Mar 02 00:59:50 mariorz: ok, I'll reload the page 2009 Mar 02 01:00:41 inimo: efficiency wise I think they're the same 2009 Mar 02 01:01:25 aamar: yes I think they might be the same 2009 Mar 02 01:01:30 Anyway, the numbers work out, so I'm good to move on. 2009 Mar 02 01:02:39 1.32? 2009 Mar 02 01:02:56 yeah 2009 Mar 02 01:03:14 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-32.ss 2009 Mar 02 01:03:17 http://mibbit.com/pb/UVYKbJ 2009 Mar 02 01:03:37 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.32 2009 Mar 02 01:03:52 correction, for n=2, mine produces 8 * (4/3)^2 / 4, whereas it should be 8 * (4/3)^2 / 5 2009 Mar 02 01:04:08 works for high enough n, but at low n it's wrong 2009 Mar 02 01:04:48 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.32a.scm 2009 Mar 02 01:04:51 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.32b.scm 2009 Mar 02 01:05:15 1.32: http://github.com/jcoglan/heist/blob/d4b6946d2dc4fe6837415a41a6fcd12e4fb0f42c/sicp/section-1-3.scm#L88-116 2009 Mar 02 01:06:57 jcoglan - thanks, clears things up for me 2009 Mar 02 01:07:05 i have the same as inimino 2009 Mar 02 01:07:31 These answers are all identical, nearly. 2009 Mar 02 01:07:40 yeah, they seem to be 2009 Mar 02 01:07:55 chrisconley's iterative doesn't use null-value, but it appears you don't need it. 2009 Mar 02 01:08:38 -*- inimino looks 2009 Mar 02 01:10:18 my memory is a bit fuzzy; i'm not sure how i got away with that 2009 Mar 02 01:10:33 hm, well 2009 Mar 02 01:10:48 if you call on a series of no terms... 2009 Mar 02 01:11:49 (operation null-value term) should equal term for any reasonable operation; you rely on that fact 2009 Mar 02 01:11:52 then I'm not sure chrisconley's will terminate 2009 Mar 02 01:12:28 it starts with (term a) 2009 Mar 02 01:12:38 the other iterative solutions here start with null-value 2009 Mar 02 01:13:03 if you call (accumulatei + 0 cube 1 inc 1) 2009 Mar 02 01:13:29 then it will increment a, and it'll never equal b, so never terminate, I think 2009 Mar 02 01:13:46 but for a ≠ b it looks correct 2009 Mar 02 01:14:21 right 2009 Mar 02 01:14:26 yeah you're right 2009 Mar 02 01:14:30 ok 2009 Mar 02 01:14:39 1.33? 2009 Mar 02 01:14:41 good catch 2009 Mar 02 01:14:42 yeah 2009 Mar 02 01:14:45 yeah 2009 Mar 02 01:15:00 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapte 2009 Mar 02 01:15:00 r1/ex1-32.ss 2009 Mar 02 01:15:01 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-33.ss 2009 Mar 02 01:15:03 brb 2009 Mar 02 01:15:05 whoops 2009 Mar 02 01:15:11 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.33 2009 Mar 02 01:15:13 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.33.scm 2009 Mar 02 01:15:21 http://mibbit.com/pb/if5JVT 2009 Mar 02 01:17:10 i have a the same as aamar 2009 Mar 02 01:17:12 http://github.com/jcoglan/heist/blob/d4b6946d2dc4fe6837415a41a6fcd12e4fb0f42c/sicp/section-1-3.scm#L119-149 2009 Mar 02 01:17:42 i dont think i did b) 2009 Mar 02 01:17:53 aamar: was gcd defined in a prev section? 2009 Mar 02 01:18:03 um, I seem to have failed to use the filter parameter anywhere in the function 2009 Mar 02 01:18:52 Yes, I had gcd from 1.20 2009 Mar 02 01:19:50 http://mibbit.com/pb/f4YIRc 2009 Mar 02 01:19:59 Added it in though 2009 Mar 02 01:20:11 aamar: your's looks good 2009 Mar 02 01:20:15 ah i think its also a primitive 2009 Mar 02 01:20:28 in mzscheme 2009 Mar 02 01:20:58 Yes, in mit-scheme it seems to be as well 2009 Mar 02 01:21:16 chrisconley: I think you are supposed to pass the filter in as a paramete, you seem to have folded it into the filtered-accumulater function 2009 Mar 02 01:22:33 mariorz: yours looks good too 2009 Mar 02 01:23:01 the only difference I see between aamar's and mariorz is the extra overhead of calling combiner with null-value 2009 Mar 02 01:23:38 I think mine is the only one that wouldn't work at all though 2009 Mar 02 01:23:44 anything else on 1.33? 2009 Mar 02 01:24:38 1.34? 2009 Mar 02 01:24:51 yes 2009 Mar 02 01:24:53 we finally get lambdas :-) 2009 Mar 02 01:25:28 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.34 2009 Mar 02 01:25:47 ; Failure, because (f f) evaluates to (f 2), but then we get (2 2); the first 2 is not a function, so the interpreter fails. 2009 Mar 02 01:26:07 looks about like mine 2009 Mar 02 01:26:14 Yep, almost word for word. 2009 Mar 02 01:26:20 any questions on 1.34? 2009 Mar 02 01:26:46 nope 2009 Mar 02 01:26:57 1.35 2009 Mar 02 01:26:58 1.35 2009 Mar 02 01:27:05 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.35 2009 Mar 02 01:27:42 http://mibbit.com/pb/LRwdhf 2009 Mar 02 01:27:43 erm, I think I meant to flesh out the math a little more than that :/ 2009 Mar 02 01:27:52 at least I should have given the definition 2009 Mar 02 01:28:21 eh, it's clear enough 2009 Mar 02 01:28:24 :) 2009 Mar 02 01:29:26 yeah 2009 Mar 02 01:29:30 alrgiht, 1.36? 2009 Mar 02 01:30:12 ok 2009 Mar 02 01:30:24 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.36 2009 Mar 02 01:30:30 http://mibbit.com/pb/WtUou7 2009 Mar 02 01:32:04 looks almost identical again 2009 Mar 02 01:33:00 okay, any others? 2009 Mar 02 01:33:02 anybody else? 2009 Mar 02 01:33:09 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.36 2009 Mar 02 01:33:19 pretty similar i think 2009 Mar 02 01:33:56 yeah 2009 Mar 02 01:34:23 yes 2009 Mar 02 01:34:27 why "gr" ? 2009 Mar 02 01:34:34 I wondered that too 2009 Mar 02 01:35:07 aamar: not sure the eholw thing is a mess im having toruble seeing what belongs to what section 2009 Mar 02 01:35:14 will keep it cleaner for next section 2009 Mar 02 01:35:22 ok 2009 Mar 02 01:36:00 chrisconley used (gr) in 1.35 also 2009 Mar 02 01:36:25 oh, I guess it means golden ratio 2009 Mar 02 01:36:28 heh 2009 Mar 02 01:36:37 alright, 1.37? 2009 Mar 02 01:36:39 -*- offby1 growls 2009 Mar 02 01:36:54 indeed 2009 Mar 02 01:36:56 offby1: hungry? 2009 Mar 02 01:37:07 yeah, thanks! Whaddya got? 2009 Mar 02 01:37:30 -*- inimino hands offby1 a steak 2009 Mar 02 01:37:34 rudybot: eval (/ (add1 (sqrt 5)) 2) 2009 Mar 02 01:37:35 *offby1: ; Value: 1.618033988749895 2009 Mar 02 01:37:45 inimino: couldn't ask for anything better! 2009 Mar 02 01:38:03 alright, 1.37 2009 Mar 02 01:38:06 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.37 2009 Mar 02 01:38:25 inimino: http://offby1.ath.cx/~erich/all-you-can-hold-for-five-bucks.html 2009 Mar 02 01:38:35 you said "steak"? You can't handle the steak! 2009 Mar 02 01:39:00 heh 2009 Mar 02 01:39:31 http://mibbit.com/pb/OxJuKP 2009 Mar 02 01:41:09 http://pastebin.com/m177fded7 2009 Mar 02 01:41:17 fundamentally the same -- though I don't know why I called mine "const-frac" 2009 Mar 02 01:41:22 i seem to have to iterative versions 2009 Mar 02 01:41:32 maybe one isnt mine 2009 Mar 02 01:41:38 s/to/two/ 2009 Mar 02 01:41:53 aamar: looks the same 2009 Mar 02 01:43:37 aamar: I didn't see any good way to eliminate the i, since you pretty much have to start from the bottom 2009 Mar 02 01:44:04 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-37.ss 2009 Mar 02 01:45:17 yes, everyone's seems similar 2009 Mar 02 01:45:32 hm, we all seem to disagree on the required k for 4 digit accuracy 2009 Mar 02 01:45:40 I said 12, aamar 11, chrisconley 10. 2009 Mar 02 01:46:41 i think mine answer is really 11 2009 Mar 02 01:46:48 i cheated when rounding 2009 Mar 02 01:47:10 0.6180555555555556 2009 Mar 02 01:47:10 0.6180257510729613 2009 Mar 02 01:47:20 for 10 and 11 respectively 2009 Mar 02 01:47:31 that's what I had for 11 and 12 2009 Mar 02 01:47:47 same 2009 Mar 02 01:48:52 But if you round to 4 digits, I get (at 10) 0.6179775280898876 2009 Mar 02 01:49:06 which rounds to .6180 2009 Mar 02 01:50:04 hm, ok 2009 Mar 02 01:50:21 next? 2009 Mar 02 01:50:53 http://mibbit.com/pb/xgNXgO 2009 Mar 02 01:50:58 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.38 2009 Mar 02 01:51:24 rudybot: eval (/ (/ (add1 (sqrt 5)) 2)) 2009 Mar 02 01:51:25 *offby1: ; Value: 0.6180339887498948 2009 Mar 02 01:51:39 What number is one more than its reciprocal? 2009 Mar 02 01:51:45 Anyone? Bueller? 2009 Mar 02 01:52:15 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-38.ss 2009 Mar 02 01:52:24 i couldn't get the recursive version to work 2009 Mar 02 01:53:46 but i guess it wasn't in the question to do both anyway 2009 Mar 02 01:55:16 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.38 2009 Mar 02 01:55:38 i wrote a functio to output the series, trying to grok what you guys did seems way cleaner 2009 Mar 02 01:55:41 hm, you were supposed to use the one you already had, but... 2009 Mar 02 01:56:22 chrisconley: I think your cont-fract-r should work, though it looks like it should have another parameter 2009 Mar 02 01:58:49 thanks for the tip, maybe i can revisit it later 2009 Mar 02 01:58:58 39? 2009 Mar 02 01:59:11 yeah 2009 Mar 02 01:59:24 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-39.ss 2009 Mar 02 01:59:42 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.39 2009 Mar 02 02:00:39 http://mibbit.com/pb/krZlYX 2009 Mar 02 02:00:43 inimino: ours are pretty much identical 2009 Mar 02 02:01:33 looks the same, yeah 2009 Mar 02 02:02:41 i still dont understand what you guys did for the series in 1.38 2009 Mar 02 02:02:51 aamar's is the same with one lambda fewer 2009 Mar 02 02:02:56 yeah 2009 Mar 02 02:03:01 for the d 2009 Mar 02 02:03:07 oh, hm 2009 Mar 02 02:03:36 In Euler's expansion, Di = (i + 1) * 2/3 if (i + 1) % 3 = 0, else Di = 1 2009 Mar 02 02:03:48 that's how i computed it 2009 Mar 02 02:03:55 same 2009 Mar 02 02:04:44 I used if (= (remainder d 3) 2) which is equivalent 2009 Mar 02 02:04:48 i found it useful in these problems to list a bunch of the numbers like: 2009 Mar 02 02:04:53 i 1 2 3 4 5 ..... 2009 Mar 02 02:05:02 Di 1 2 11 4 1 1.... 2009 Mar 02 02:05:02 ahh cool 2009 Mar 02 02:05:06 thats sexy 2009 Mar 02 02:05:11 but lined up 2009 Mar 02 02:05:19 yeah 2009 Mar 02 02:05:26 yes 2009 Mar 02 02:05:27 that's a good way to see the pattern 2009 Mar 02 02:05:34 and make sure you have it right 2009 Mar 02 02:05:37 yeah i did that chrisconley but still came up with a huge ugly func to opuput the numbers 2009 Mar 02 02:06:24 mariorz's approach is fairly different, but seriesx returns the same numbers 2009 Mar 02 02:06:56 on 1.39, I prefer the approaches that wrote out the call as two lambdas stylistically. 2009 Mar 02 02:07:01 yours is way better 2009 Mar 02 02:07:47 hey nicou 2009 Mar 02 02:07:55 yeah 2009 Mar 02 02:08:03 sorry I couldn't make it 2009 Mar 02 02:08:15 np, we're on 1.39 2009 Mar 02 02:08:29 let me get my notes 2009 Mar 02 02:09:56 Actually, given the consistency on 1.39, should we go on to 1.40? 2009 Mar 02 02:10:09 http://pastebin.com/m100d3fc0 2009 Mar 02 02:10:10 yeah 2009 Mar 02 02:10:11 yeah, I guess we were done with 1.39 too 2009 Mar 02 02:10:42 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.40 2009 Mar 02 02:11:08 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.40 2009 Mar 02 02:11:20 yes, I have the same, just that I used square and cube instead of repeated multiplication 2009 Mar 02 02:11:37 yes, that one in the wiki 2009 Mar 02 02:11:53 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-40.ss 2009 Mar 02 02:12:19 oh yeah, i forgot i didn't finish this one 2009 Mar 02 02:12:35 so nevermind the solution i just posted :) 2009 Mar 02 02:12:36 http://mibbit.com/pb/EtEao3 2009 Mar 02 02:13:11 man i really tried to over complicate this 2009 Mar 02 02:13:14 brb 2009 Mar 02 02:14:15 i'm a little fuzzy on this newtons method 2009 Mar 02 02:14:38 why does sqrt require that you pass y^2 -x to the procedure? 2009 Mar 02 02:15:24 whereas you just pass the cubic function as is? 2009 Mar 02 02:16:06 the cubic function creates an "equation", right? 2009 Mar 02 02:16:10 -*- inimino tries to catch up 2009 Mar 02 02:16:36 x³ + ax² + bx + c 2009 Mar 02 02:16:47 -*- aamar is refreshing memory 2009 Mar 02 02:16:57 which is equivalent to y²-x but with degree 3 2009 Mar 02 02:17:11 so y^2 -x is just an equation which happens to compute the sqrt? 2009 Mar 02 02:17:16 chrisconley: that looks fine 2009 Mar 02 02:17:59 if y^2 - x = 0, then x is the square root of y, so, yes. 2009 Mar 02 02:18:08 y = sqrt(x) 2009 Mar 02 02:18:12 if y^2 - x = 0, then y is the square root of x, so, yes. (mixed up) 2009 Mar 02 02:18:36 but if you want to restate that in terms of "finding a zero" you need to manipulate that until you have = 0 on the end. 2009 Mar 02 02:18:36 it doesn't compute the square root 2009 Mar 02 02:18:50 it's an equation of which the square root is a zero 2009 Mar 02 02:19:03 y^2 = x ---> y^2 - x = 0 2009 Mar 02 02:19:05 right okay 2009 Mar 02 02:19:11 so by finding the zero you can compute the sqrt 2009 Mar 02 02:19:46 exactly, it doesn't compute it, but it has the square root as a zero, so this newton-rhapson procedure should find the zeroes of any function, and particularly, of y^2 - x=0, which is to say, the square root of x. 2009 Mar 02 02:19:49 ok thanks guys, that went in one ear and out the other before; thanks for clearing it up 2009 Mar 02 02:20:04 1.41 ? 2009 Mar 02 02:20:06 ok 2009 Mar 02 02:20:10 .41 2009 Mar 02 02:20:19 http://mibbit.com/pb/MjEaJg 2009 Mar 02 02:20:27 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-41.ss 2009 Mar 02 02:20:50 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.41 2009 Mar 02 02:20:52 aamar's looks fine to me 2009 Mar 02 02:21:00 (define (double f) 2009 Mar 02 02:21:00 (lambda (x) 2009 Mar 02 02:21:04 er sorry 2009 Mar 02 02:21:46 not much room to differ on this one 2009 Mar 02 02:21:50 yes 2009 Mar 02 02:21:50 yeah 2009 Mar 02 02:22:02 yeah, 42? 2009 Mar 02 02:22:08 1.42 -- another short one 2009 Mar 02 02:22:12 (define (compose f g) (lambda (x) (f (g x)))) 2009 Mar 02 02:22:21 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-42.ss 2009 Mar 02 02:22:23 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.42 2009 Mar 02 02:22:26 yep 2009 Mar 02 02:22:27 right 2009 Mar 02 02:22:35 yep 2009 Mar 02 02:22:42 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.42 2009 Mar 02 02:22:59 43 then? 2009 Mar 02 02:23:02 yes 2009 Mar 02 02:23:05 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.43 2009 Mar 02 02:23:07 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-43.ss 2009 Mar 02 02:23:15 http://mibbit.com/pb/JhLaYa 2009 Mar 02 02:23:26 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.43 2009 Mar 02 02:24:03 i didnt follow the hints advice 2009 Mar 02 02:25:05 mine is a little different from yours aamar 2009 Mar 02 02:25:26 I passed the procedure composed with itself as a state variable in an iterative process, then returned that variable as result when it's been composed enough times 2009 Mar 02 02:25:33 i like inimino 2009 Mar 02 02:25:34 s 2009 Mar 02 02:26:17 inimino, you have lambda (x) but x is not used anywhere... 2009 Mar 02 02:26:31 yeah 2009 Mar 02 02:26:32 aamar: that's to handle the n=0 case 2009 Mar 02 02:26:48 I mean in the "else" case 2009 Mar 02 02:26:55 the second lambda 2009 Mar 02 02:27:20 using the REPL in my head (pretty bad one, to be sure) you're going to get a function of a funciton 2009 Mar 02 02:27:31 inimino: yeah it returns a proc 2009 Mar 02 02:27:40 aamar: good point 2009 Mar 02 02:28:06 looks like I meant to have an x at the end of that and left it out 2009 Mar 02 02:28:19 (lambda (x) (compose f (repeated f (- n 1)))))) 2009 Mar 02 02:28:23 whoops 2009 Mar 02 02:28:54 (lambda (x) ((compose f (repeated f (- n 1))) x)))) 2009 Mar 02 02:29:01 that does it 2009 Mar 02 02:29:05 that's how it should end 2009 Mar 02 02:29:46 no 2009 Mar 02 02:29:53 i dont think its working 2009 Mar 02 02:30:03 ((repeated square 2) 5) 2009 Mar 02 02:30:05 5 2009 Mar 02 02:30:38 I don't think I actually tested any of these 2009 Mar 02 02:31:07 http://pastebin.com/m41bb5271 2009 Mar 02 02:31:15 nvm 2009 Mar 02 02:31:19 inimino: your fix works 2009 Mar 02 02:31:26 mariorz: ok, good 2009 Mar 02 02:31:27 nice 2009 Mar 02 02:32:24 1.44? 2009 Mar 02 02:32:26 nicou: looks good 2009 Mar 02 02:32:27 yeah 2009 Mar 02 02:32:43 http://inimino.org/~inimino/projects/2009/SICP/chap_1/1.44 2009 Mar 02 02:33:14 http://inimino.org/SICP-wiki/doku.php?id=exercise_1.44 2009 Mar 02 02:33:17 it's incomplete but, http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-44.ss 2009 Mar 02 02:33:20 inimino, mine's pretty much the same 2009 Mar 02 02:33:33 http://mibbit.com/pb/GTNljm -- 1.44 2009 Mar 02 02:35:24 mariorz is using something advanced 2009 Mar 02 02:35:41 the average func? 2009 Mar 02 02:35:42 chrisconley: I don't understand yours 2009 Mar 02 02:36:01 the period in the average function 2009 Mar 02 02:36:21 inimino: yeah i was having a brain block, looking at the solutions here, i was close but was missing it 2009 Mar 02 02:36:22 aamar: yeah it was suggested in #scheme 2009 Mar 02 02:36:35 ok 2009 Mar 02 02:36:45 ok 2009 Mar 02 02:37:13 yeah that looks beyond what we have at this point 2009 Mar 02 02:37:16 fixed: http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-44.ss 2009 Mar 02 02:38:21 looks like there's a little delay on github though 2009 Mar 02 02:38:56 1.45? 2009 Mar 02 02:39:01 oh, ok 2009 Mar 02 02:39:06 yeah, 1.45 2009 Mar 02 02:39:25 http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-45.ss 2009 Mar 02 02:39:37 oh 2009 Mar 02 02:39:48 I didn't get to these 2009 Mar 02 02:39:55 1.45 or .46 2009 Mar 02 02:40:03 yeah i didnt finish the last 2 2009 Mar 02 02:40:04 http://mibbit.com/pb/525qsb 2009 Mar 02 02:40:12 was going to use this extra week :P 2009 Mar 02 02:40:32 I was going to do them yesterday but it didn't happen ;-) 2009 Mar 02 02:41:03 yeah this was not a productive weekend for me at all 2009 Mar 02 02:41:15 someone tipped me in on "the wire" 2009 Mar 02 02:41:35 hehe 2009 Mar 02 02:41:43 aamar: did you do 46? 2009 Mar 02 02:42:18 we could always discuss 45 and 46 next meeting like we did with 28 today 2009 Mar 02 02:42:33 here's my 46 in any case: http://github.com/chrisconley/sicp-exercises/blob/ce328a20775419cf343faf5998e97666aed2146f/chapter1/ex1-46.ss 2009 Mar 02 02:42:41 yes I did get to 46 2009 Mar 02 02:42:55 http://mibbit.com/pb/njIAQ8 2009 Mar 02 02:43:13 Let's do .45 and .46 next week -- this week there was a lot of ground to cover. 2009 Mar 02 02:43:22 yeah sounds good 2009 Mar 02 02:43:49 inimino mentioned before about breaking up sections into weekly meetings; does this sound good to anybody? 2009 Mar 02 02:44:00 it'd be fine by me 2009 Mar 02 02:44:09 yeah 2009 Mar 02 02:44:09 sure 2009 Mar 02 02:44:18 i'm thinking 3 weeks between meetings and 3 hour long meetings aren't the way to go :) 2009 Mar 02 02:44:21 most def as these baltimore kids say 2009 Mar 02 02:44:25 yeah 2009 Mar 02 02:44:36 sure, more frequent shorter meetings will work better 2009 Mar 02 02:44:37 my memory fails me after 2 weeks 2009 Mar 02 02:44:43 me too 2009 Mar 02 02:44:43 mine too :( 2009 Mar 02 02:44:53 same 2009 Mar 02 02:44:54 do you want to try to do weekly? 2009 Mar 02 02:45:01 I can do it generally. 2009 Mar 02 02:45:02 works for me 2009 Mar 02 02:45:06 same here 2009 Mar 02 02:45:20 cool, let's try it then 2009 Mar 02 02:45:20 so we'll see in a week then 2009 Mar 02 02:45:22 The wiki and logs are terrific if someone has to skip some weekends 2009 Mar 02 02:45:30 yeah good point 2009 Mar 02 02:45:32 yeah 2009 Mar 02 02:45:42 agree 2009 Mar 02 02:45:46 any idea what we should aim for for next week? 2009 Mar 02 02:45:56 2.8? 2009 Mar 02 02:46:26 2.6 maybe 2009 Mar 02 02:46:28 we should finish 1.45, 1.46, and up to 2.16 sounds fine, 2.1 is really light 2009 Mar 02 02:46:31 I haven't even read ahead, so no ideas 2009 Mar 02 02:46:44 nicou: ok, sounds good 2009 Mar 02 02:46:52 2.16 itself is a tough one 2009 Mar 02 02:47:00 other than that, agreed, it's not too bad. 2009 Mar 02 02:47:09 ok sounds good to me too 2009 Mar 02 02:47:11 2.16 is "very difficult" 2009 Mar 02 02:47:19 oh 2009 Mar 02 02:47:25 so the authors say 2009 Mar 02 02:47:30 ah. 2009 Mar 02 02:47:37 It's actually not heartening to hear the authors of SICP say that. 2009 Mar 02 02:47:48 haha, no not at all 2009 Mar 02 02:47:49 I got up to that one and got stuck. 2009 Mar 02 02:47:53 but we can play with a couple of ideas, and maybe then try to implement them 2009 Mar 02 02:47:57 well then let's shoot for that and maybe not everyone will get 2.16 in time 2009 Mar 02 02:48:01 ok cool 2009 Mar 02 02:48:06 Sounds great. 2009 Mar 02 02:48:07 yeah 2009 Mar 02 02:48:19 inimino: are good to post the logs? 2009 Mar 02 02:48:53 oh, if you could post them that'd be fine, I'm missing 10 mins or so 2009 Mar 02 02:49:18 i think i have them to post too 2009 Mar 02 02:49:23 ok, I'll post them 2009 Mar 02 02:49:42 unless you want to nicou, I think I just sent you the missing bits 2009 Mar 02 02:50:12 either way would be fine, there's no difference :p 2009 Mar 02 02:50:19 thanks 2009 Mar 02 02:50:20 cool, so up to 2.16 for next sun? 2009 Mar 02 02:50:22 cool thanks 2009 Mar 02 02:50:25 alright I'll do it 2009 Mar 02 02:50:35 mariorz: yep, sounds good 2009 Mar 02 02:50:39 yeah 2009 Mar 02 02:50:45 allright, later everyone 2009 Mar 02 02:50:46 thanks everyone, see ya next week! 2009 Mar 02 02:50:50 see ya! 2009 Mar 02 02:50:55 inimino, ok thanks, see ya in a week 2009 Mar 02 02:50:56 great, see ya