Loading web-font TeX/Main/Regular

Saturday, January 2, 2016

Kerla Sho, New Year Update

CS Course Day 33.

GitHub Code repositories since last update:

ASJava_4.01-4.12
ASJava_5.01-5.12
SICP 2.17, 2.20, 2.22, 2.23
CS106A_Assignment 2: Simple Java


Structure and Interpretation of Computer Programs (which is a full course, not just a book) has gotten a lot easier after I decided to follow the exercise assignments in Professor Brian Harvey's Spring 2011 syllabus. Even if I am running on an accelerated pace, I think I'm fine if I do the same work that Berkeley and Stanford students do.

I feel hesitant every time I say this, but the level of relative ease when I follow the structure of university programs is pretty noticeable. But I think it also has to do with me being able to better understand the material in more manageable chunks. Hey how about that, you gotta train smart in academics too, not just athletics.

On New Year's Day I got started on the 2nd assignment of Mehran Sehami's CS106A course. The course is Stanford's introduction to Computer Science for EE & CS majors. I took 2.5 hours to finish the first problem in the assignment, and got done right before going to a New Year's get together. I finished the rest of the assignment today. The first 2 hours and 10 minutes were spent trying to unknot myself and making things worse, and below is the result 15 minutes after throwing out all the code and starting fresh. I got the pyramid right side up a couple minutes later.



The big lesson is thought structure. The way these problems work is there's a way to pay 20 hours and maximal effort with mediocre results, or 10 minutes and no effort with full return. This extreme curve for problems in Informatics makes me think people like Nick Bostrom are definitely on to something in their view of the nature of intelligence. Maybe. I feel as though life is more linear, or maybe we're just used to seeing it that way. The world is pretty unforgiving in favor of who has the advantage.. so jury's out.

The mistake I made was not understanding the nature of the problem exactly. I had an approximate grasp of what I had to solve and what I had to do to solve it, but without the necessary tools of experience and brain-wiring to rely on.There is no winging new things unless you're interested in what not to do (which at an early stage is important). I wasn't sure to use a while or a for loop (hint: use for's when your iteration is definite, while when it's indefinite) and, here's the big part: didn't understand how my for-loops were iterating. That's kinda important. Anyway the result was a mess.

When I started over, I decided not to do it the way I thought others would have me do. I'm not a professional yet so how can I know? All I'd get is a crude approximation without any knowledge of the whys/ So I started building the algorithm the way it made sense to me: you have a number of bases and you have a rank number, both of which count down to 1. Vertical position is uses rank as a parameter, and horizontal position uses the formula: center position - base number * the width of the bricks, + rank * half the brick width. What that gives you is a value that starts out less than center, and eventually passes it. Rank starts equal to the number of bricks at base (this number is passed into the method) and counts down. The base number starts equal to Rank at each rank iteration and counts down to 1. So at Rank = 14: Base = 14,13,12,... etc. This means the program draws bricks at the widest level first, which is why I got the pyramid upside down: wrong vertical parameter. Easy fix.

The rest of the assignment went smoothly. It took me 2.5 hours to finish the remaining 5 problems.

Not much else to say at the moment. I think things are going smoothly. They can be faster and I need to make that happen. I get closer to getting my full list of work done each day. When I get to that point I'll add more. Now that we're at the start of the month - I want to have SICP and CS106A completely finished by February. I'm just about starting Calculus again and Electronic Circuits. I have an EC reading from months ago that I'll do, and then go back and apply my work style from CS to it. If you can do the exercises you don't really know the material. If you don't know the material you can't be nimble and inventive, and perform to your potential when you set out to build something. It all comes back to the same thing: it's on you to put in the work. I really look forward to burning through the EE work.

I started surveying MIT's 6.01 Intro to EECS I. I'm not an MIT student so I don't have access to the labs & etcetera, but I want a better picture of the path ahead. I'm just doing all the readings and watching all the lectures and recitations. I don't count it as taking a course but there's a use anyway. I think I'll survey 6.02 Intro to EECS II, which focuses on digital communication systems, afterwards. I just checked and the lectures and readings are all there so we're good. It's like sparknotes for independent study. I have a whole curated reading list cut out for me :). 6.002x, the Circuits and Electronics course I do take very seriously and I will get a certificate in all 3 modules on edX.

That's that, more when more's happened.
















No comments:

Post a Comment