Fundamentals I
This website is for a prior semester of CS2500. Please go to http://www.ccs.neu.edu/course/cs2500 for the current semester, and update your bookmarks accordingly.
Welcome to Fundamentals I at Northeastern University, College of Computer Science.
This course is an introduction to computing and programming. Its major goal is to introduce students to the principles of systematic problem solving through programming and the basic rules of computation.
The course does not assume any prior programming
experience. It is therefore suitable for all freshman students—
Blog
Mon Dec 9, 2013
The End
Hungry Henry is done, Fundamentals I is over. All the best with your remaining finals.
Fri Dec 6 12:39:07 EST 2013
It has also come to our attention that tutors push students to put all functions into a local construct. Again, this is wrong. As discussed in the last two lectures, functions must go local if they need access to parameters/variable definitions from this context. Otherwise, you are better off with global (module-level) functions because you can test them. Also see the relevant section in HtDP/2e about this issue as well as the sample code from class.
Fri Dec 6 11:25:49 EST 2013
Warning
Some TAs appear to have given the advice to use an image as the current state of the client (big-bang). While "this idea works", it is the anti-thesis of what this course teaches and following this advice is guaranteed to lower your score a lot.
Using images as the state of big-bang is garage programming.
A software developer always uses structure data instead. Structured data explains the state and its interpretation informs anybody who must fix/improve/modify how the various ideas hang together. If a program’s performance were ever affected by re-drawing a new state too often (because things really change only when a message from HH’s server arrives), a programmer would cache the image of the state separately.
As HtDP/2e explains several times, this idea has been recognized as a central feature of successful software system and has been labeled as the Model-View-Control (MVC) architecture.
Mon Dec 2 10:53:36 EST 2013
Please study the code from today’s lecture and try to work through the design of at least one event handling function for the clients in preparation for Wednesday.
The extended deadline for problem set 12 is Friday (12/6) midnight.
Today’s Boston Globe carries a story on Bootstrap.
Sunday
Prof. Felleisen has translated the answers to the 10 design questions into a top-level design for the digit-guessing game. The top half of the file is the result of the November 25 lecture; the bottom half is the design. In preparation for Monday’s lecture, pleaseFeel free to send Prof. Felleisen your modified file with test cases added.
Thursday
Happy Thanksgiving
Tue Nov 26 11:37:02 EST 2013
Mon Nov 25 20:38:38 EST 2013
Prof. Ahmed will hold office hours tomorrow (Tuesday) from 2pm to 3pm.
Mon Nov 25 12:03:56 EST 2013
Prof. Felleisen will hand back the physical copies of the second exam today between 4 and 5:30pm in his office.
Fri Nov 22 14:06:21 EST 2013
The GAME
One player, the dealer, picks a digit. When (a given number of) N other players, the guessers, have told the dealer that they are ready, the guessing may begin.
Each guesser may make one guess at a time and request an immediate response from the dealer. The response is either "correct" or "incorrect". When a guesser picks the correct number, the dealer also tells all other guessers that the game is over.
Which information must reside in/is created in the server?
Which information must reside in/is created in the clients?
Which information must flow from a client to the server?
Which information must flow from the server to a specific player?
When does information flow from the server to the clients and vice versa?
What is a good data representation for the messages from the clients to the server?
What is a good data representation for the messages from the server to the clients?
Which events should the server react to? How about the client(s)?
Which parts of the server’s state of information changes over time and needs to be tracked in its state? What is a good data representation?
Which parts of each client’s state of information changes over time and how does it change? What is a good data representation?
Thu Nov 21 17:17:08 EST 2013
Please take a look at Problem Set 12, which was supplemented today with (1) an explanation of the grading policy and (2) a section on how to prepare yourself for next week’s lab (help session on the problem set).
Thu Nov 21 12:16:58 EST 2013
Here is the code from Wednesday’s regular lecture.
Wed Nov 20 14:34:34 EST 2013
Here are solutions for the second midterm exam and for the honors supplement. Please look these over before you try to approach a TA or instructor to ask about grading issues.
Tue Nov 19 22:02:20 EST 2013
Here is the code from Monday’s honors lecture.
Mon Nov 18 16:25:43 EST 2013
Prof. Felleisen’s office hours tomorrow are canceled due to the grading session.
Fri Nov 15 19:03:35 EST 2013
We are having problems with the scoring of problem set 8. To provide you feedback, we graded it twice: the base score was 35 for the first round and 60 for the second. Expect correct grades early next week (hopefully by Tuesday).
Fri Nov 15 12:12:29 EST 2013
Extra Points
Congratulations, the exam is behind you.
We understand that some of you might be worried about losing so many points over the first part of the semester. If you are interested in demonstrating your skills in a hands-on fashion and in gathering extra points, the last problem set is your chance.
Problem Set 12 will count for 150 base points, which is 3x the average value of a problem set, plus 150 bonus points. Obtaining all base points would dramatically raise your homework average. Obtaining all possible points may even lift your homework average above 100% for some of you, which will then affect your overall average.
Thu Nov 14 11:26:53 EST 2013
As requested by students in the Th 9am class, the deadline for problem set 10 has been postponed by 24 hours.
Also as requested, I have posted the quick-sort code I code-walked yesterday.
Wed Nov 13 20:50:37 EST 2013
Location of Exam
Exam 2 is tomorrow (Thursday, Nov 14th) from 6pm to 9pm.
Students in Felleisen’s section will take the exam in 200RI.
Students in Van Horn and Razzaq’s sections will take the exam in 108SN.
Students in Ahmed’s section will take the exam in 305SH.
Tue Nov 12 13:56:45 EST 2013
As announced in class last week, the honors review session will be held tonight, from 7pm to 9pm in 366 WVH. Bring all your questions. The TAs will answer them.
Thu Nov 7 17:07:28 EST 2013
The lab sessions next week will be Q & A sessions. Bring your questions. The TAs will answer.
If you need bold{alternative arrangements} (conflicts, DRC), please email to Leena Razzaq by Tuesday NOON.
Wed Nov 6 11:44:22 EST 2013
Some students asked for two code fragments (grow a binary search tree, navigate a tree) that we did not finish in class. Do use them in preparation for the exam.
Tue Nov 5 21:35:42 EST 2013
Some problems from problem set 9 are now marked extra credit. If you have solve them, turn in solutions. If not, focus on Hungry Henry first.
Tue Nov 5 09:20:07 EST 2013
The code-walk masters report that the schedule for Code Walks filled up. If you did not get a response, your email arrived too late and you are on a wait list. As people withdraw from code walks, the code-walk masters will fill up the schedule with people from the wait list.
We are also considering a way to make up for lost homework points without damage to existing grades. Specifically, we will probably offer a distributed Hungry Henry game for the last problem set, which will count at an extraordinarily high weight. Since the weakest homework score is dropped from the final computation, the extra weight of the last problem set can help you raise your homework score.
Mon Nov 4 16:10:58 EST 2013
For finger exercises for this week or exercises on problem set 9 that call for read-xexpr and similar functions, please use the teachpack from Lab 8 (last week). It supplements the "2htdp/batch-io" teachpack.
Mon Nov 4 08:53:24 EST 2013
The tutors have release preliminary grades and feedback on your Hungry Henry designs. Please check the hand-in server as you work on problem set 9.
Repeat As of next week, we will be offering a way to earn extra points. For details, see Code Walks a new section on the Problem Sets page.
Sun Nov 3 15:02:46 EST 2013
As you prepare for the second exam, here is a sample exam2 for you to practice with. (Two known typos: In problem 4, it should say (define-struct song (title artist length)). In problem 5’s definition of tree2, change 105 to 100.)
For students in the honors section, here is a sample exam2 honors-supplement.
Fri Nov 1 21:56:51 EDT 2013
Code from honors lecture on Monday 10/28: representing sets as lists and sets as functions.
Fri Nov 1 12:17:52 EDT 2013 and 21:56:51 EDT 2013
As of next week, we will be offering a way to earn extra points. For details, see Code Walks a new section on the Problem Sets page.
Thu Oct 31 10:49:56 EDT 2013
use the failing test case to make a small test case that fails,
isolate test and function in separate tab, then add bad function call at bottom,
use the stepper and compare actual steps with expected steps,
articulate error, fix and run test suite.
Wed Oct 30 11:17:45 EDT 2013
We have added a margin note to Problem Set 8
; Any -> Boolean ; is the given value a list of anything? (define (list? x) (or (empty? x) (cons? x)))
; Posn Posn -> Posn ; move avatar p closer to the waypoint wp by SPEED pixels ; ASSUME: avatar doesn't have to 'snap' to waypoint because it gets close (check-within (move-avatar (make-posn 10 (- 10 SPEED)) (make-posn 10 10)) (make-posn 10 10) EPSILON) ; move along Y axis (check-within (move-avatar (make-posn (+ 10 SPEED 1) 10) (make-posn 10 10)) (make-posn 11 10) EPSILON) ; move along X axis (check-within (move-avatar (make-posn 10 10) (make-posn 13 14)) (make-posn 13 14) EPSILON) ; warning: test relies on SPEED = 5 (check-within (move-avatar (make-posn 15 22) (make-posn 10 10)) (make-posn (+ 10 (* 5/13 8)) (+ 10 (* 12/13 8))) EPSILON) ; warning: test relies on SPEED = 5 (define (move-avatar p wp) (local ((define d (distance wp p)) (define d-SPEED (- d SPEED)) (define wp.x (posn-x wp)) ; wp.x is just a funky name (define wp.y (posn-y wp))) (make-posn (+ wp.x (* (/ (- (posn-x p) wp.x) d) d-SPEED)) (+ wp.y (* (/ (- (posn-y p) wp.y) d) d-SPEED)))))
Mon Oct 28 13:46:24 EDT 2013
Evan questioned problem 8.1 in class today. While the first part is correctly formulated, the second part used to provide inconsistent (invalid) structure type and data definition. The corrections to the structure type definition are in red; to avoid confusion, I have removed the old fields. – Matthias
[60 ~ 52]
A-ish
[51 ~ 43]
B-ish
[42 ~ 36]
C-ish
[35 ~ 30]
D-ish
[29 & below]
F
Thu Oct 24 23:12:36 EDT 2013, Fri Oct 25 15:08:09 EDT 2013
Here are solution for the first midterm exam and for the honors supplement Please look it over before you try to approach a TA or instructor to ask about the grading policy.
Thu Oct 24 16:57:28 EDT 2013
Some missing quiz 4 grades, exam grades, and homework 5 grades have been posted.
Mon Oct 21 14:44:58 EDT 2013
Quiz grades up to quiz 4 and honors quiz 5 are posted. If you are getting 0s on quizzes, come ask questions in office hours!
Fri Oct 18 15:27:25 EDT 2013
Computes the arctangent of the given number:
Thu Oct 17 19:10:04 EDT 2013
- One student asked whyworks in ISL whilefails.ISL insists that a function application has the shape
(Name Expression ... Expression)
That is, the first position must be a named function.In contrast, ISL with lambda allows arbitrary expression in this same position:(Expression Expression ... Expression)
- We sadly had to leave the interpreter for BSL unfinished. To finish it, you will need a function
; Symbol Number Expression -> Expression ; replace all occurrences of x in e with n ; or plug in n for x in e (check-expect (plug-in 'y 5 '(+ y 42)) '(+ y 42)) (define (plug-in x n e) e) You will also need a function that retrieves a FunctionRepresentation from a DefinitionsWindow by name:; Symbol DefinitionsWindow -> FunctionRepresentation ; retrieve f's representation from dw (define (find f dw) (error "not found")) If people are interested, I can also find a lecture room next week and wrap up the interpreter from here. – Matthias
Wed Oct 16 10:51:15 EDT 2013
Location of Exam
Students in Felleisen’s and Ahmed’s sections will take the exam in 168SN .
Students in Razzaq’s and Van Horn’s sections will take the exam in 108SN .
The code from today’s lecture is available on-line.
Tue Oct 15 22:10:19 EDT 2013
The leader of the review sessions sent in two files for you perusal: session 1 and session 2.
Tue Oct 15 19:19:26 EDT 2013
Your task in problem set6, exercise 4 is to write the function append-from-fold. Your function consumes two lists, behaves exactly like append, and is defined using foldr and/or foldl.
[f ’composed with’ g](x) = f( g(x) )
Tue Oct 15 16:25:26 EDT 2013
Over the past few days, we have uncovered cases of cheating and inappropriate collaboration.
We will refer these cases to OSCCR the NU office for academic integrity, and the concerned parties have been informed of this step. As you should recall, you signed a course contract, which specifies clearly that you must collaborate with your partner and nobody else on problem sets. In the margin, the contract also refers to two articles on programmers going to prison because they gave code way/took code from others (company outsiders).
to compute the new x coordinate, add |
|
current-x-position-of-wp |
|
to |
|
'x-distance between wp and p' |
---------------------------------------------- * ('distance between wp and p' - S) |
'distance between wp and p' |
|
where S is the number of pixels HH travels per clock tick |
If you read the articles linked to your contract or even their headlines, it is obviously completely unacceptable that the two pairs work on one computer and then send each other the resulting code in email.
On help When you discover that working with tutors and TAs does not help or that you are routinely working on problem sets for 40 hours per week, seek out one of the instructors of this course. Most have years of experience teaching this course, and they can often diagnose your problem(s) more precisely than TAs or tutors. And they are committed to teaching; otherwise they wouldn’t volunteer to teach a huge freshman course.
Sun Oct 13 20:27:52 EDT 2013
I have revised the ISL programs that generates quizzes about templates so that it also displays solutions. Please copy and paste into DrRacket, click Run, and evaluate (main 2) or (main n) for any natural number n. – Matthias
Sat Oct 12 13:37:05 EDT 2013
The preliminary grades for problem set 4 are posted. Remember that as part of problem set 6 you need to revise your code according to the marks you got from your graders.
Note The grades are preliminary because we pair-grade. Not all grading sets have been double checked yet but you have enough information for now to get going.
We are also reviewing a particular set of grades from the past two problem sets and some of you may see a change of grade (up) in the near future.
Fri Oct 11 16:30:29 EDT 2013
15 October 2013, 7–9pm, 168SN
15 October 2013, 7–9pm, 108SN
15 October 2013, 8–10pm, 320Shillman
Thu Oct 10 12:59:29 EDT 2013
I have constructed an ISL programs that generates the quizzes about templates that I have been giving in class.
Wed Oct 9 15:49:54 EDT 2013
The word "with at least one example from ISL" in problem 213 in HtDP/2e means "find a function in ISL that lives in the named collection or define such a function."
Kathleen Mullins has to cancel her office hours scheduled for tonight (7–9pm). She will instead hold office hours tomorrow afternoon (3–5pm).
Grades for problem sets 1-3 and for quizes 1-2, honors and regular, are posted. If you do not see a grade, you probably submitted incorrectly and currently have a 0. Contact the head TA of your lab if you have questions/concerns about grading.
Tue Oct 8 10:23:20 EDT 2013
Here are two sample exams for you to practice with: 2011 exam1, 2012 exam1
For students in the Honors section, here are the two accompanying honors supplements: 2011 honors-supplement1, 2012 honors-supplement1.
Mon Oct 7 11:05:46 EDT 2013
How do you get a list sorted in descending order?
Can you create a function that sort a list of strings according to string<=?
What do you have to do to get a function that sorts Posns according to their x coordinate?
; LON is one of: ; – empty ; – (cons Number LON) ; interpretation: a list of numbers ; LON -> LON ; created a sorted version of one-lon (check-expect (sort '(13 0 1 2 3 4 5 6 7 8 9 10 11 12 14 15)) '(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15)) (define (sort one-lon) (cond [(empty? one-lon) '()] [(cons? one-lon) (ryan (first one-lon) (sort (rest one-lon)))])) ; Number LON -> LON ; puts n into one-lon according to ascending order ; WHAT DO WE KNOW: one-lon is sorted in ascending order ; because ryan is called inside of sort with (sort (rest ...)) (check-expect (ryan 13 (list 11 12 14 15)) (list 11 12 13 14 15)) (check-expect (ryan 13 empty) (list 13)) (define (ryan n one-lon) (cond [(empty? one-lon) (list n)] [(cons? one-lon) (if (<= (first one-lon) n) (cons (first one-lon) (ryan n (rest one-lon))) (cons n one-lon))]))
Sat Oct 5 10:15:59 EDT 2013
The Exam
The first two-hour exam will take place on Thursday 17 October 2013 from 6–8pm. To prevent you from experiencing any time pressure, we provide one extra hour, meaning you may stay until 9pm to wrap up.
The exam will cover parts I, II, and III in HtDP/2e, which correspond to parts I, II, and IV in HtDP/1e. As far as the exam is concerned, it does not matter which book you use for preparation.
During the exam you may use any printed or hand-written material such as the books (first or second edition), your notes, or your membership card. Any use of electronics (desktop computer, laptop, tablet, phone, pda, etc.) will result in your immediate expulsion from the exam and a score of 0.
15 October 2013 in 168SN and 108SN from 7–9pm.
If you are registered with the Disabilities Office and you wish to make special arrangements for the exam, please see Dr. Leena Razzaq during her office hours or by appointment by 11 October 2013.
Grades
Some, but not all, homework 1 grades have been updated.
Homework 2 grades have been posted. You can check them via the handin server’s web interface. Along with grades, annotated versions of your assignment are posted as "graded.html".
If you do not have a grade, you submitted your assignment incorrectly. This counts as a 0.
Fri Oct 4 09:52:38 EDT 2013
Here is the partial Snake game developed in yesterday’s honors lecture. Try to finish the game over the weekend.
Thu Oct 3 12:29:29 EDT 2013
Problem set 4’s deadline is now 11pm today.
We are making the code available from today’s lectures on a camera roll program: code from the Felleisen lecture code from the Van Horn lecture
Wed Oct 2 18:34:15 EDT 2013
- How to test functions with random results?
(check-expect (length (make-cup-cakes n)) n)
for any n that is a natural number. Work with your new partner on "Hungry Henry" and start by settling on one of the two designs. In principle, you should have at least one blessed design by now and either one should work but stick to one.
There is no need to turn in your blessed design this time. We asked you to show us the result of the design recipe for world programs early so you don’t go off the deep end with ill-conceived designs.
Working through the remaining wish list will make sure that you practice working on lists and structures and function composition (when a function has to perform more than one task).
- Most of you have incorrect signatures for the main function. The problem statement calls for the main function to consume the number of cupcakes that the player wishes to "eat" and to produce the number of clock ticks that the player needed to eat all the cakes:To get this function right, you need to understand that big-bang is really just a complicated way of composing the functions. So
(define (some-image n) (circle (+ (* 3 n) 10) "solid" "red")) (+ 22 (big-bang 100 [to-draw some-image] [on-tick sub1] [stop-when zero?])) works just fine and you know that the expression returns 22 or a number larger than 22 if you "kill" the big-bang window. Try it out, see what happens.If big-bang produces an instance of a struct, you can also extract fields.
If you have partner problems, contact the head TA in charge of your lab and follow their instructions. Do not email arbitrary staff members.
Tue Oct 1 18:33:29 EDT 2013
get signature with new partner; copy/add; MF time
They must make a copy of their extension sheet and share it with their old partner.
These students do not have a blessed design.
They can no longer get a blessed design with their first partners.
They must get blessed designs with their new partners.
If their new partner has a blessed design sheet, they are set.
If their new partner does not, they may get their designed blessed by a TA tomorrow.
If they get their design blessed on Wednesday, their TA will mark the blessing with a date.
A blessed design must be accompanied by an extension sheet that I signed.
Note that each pair receives only one blessed design sheet. You may not make copies of these sheets and turn those in. You must have an original for Thursday.
– Matthias Felleisen
Mon Sep 30 11:16:50 EDT 2013
Here is the program designed in yesterday’s lecture for regular Fundamentals I, plus the suggested "homework" problem.
Homework 1 grades are posted. Grades are posted as BSL exact number.
Sun Sep 29 07:51:33 EDT 2013
Problem set 4 has two due dates. For the first one, you will work with your current partner. You will receive a single sheet of paper signed off by a teaching assistant (TA). On Tuesday, you will pick a new partner in lab. You must complete the problem set with your new partner. As you switch partners, make sure that each pair retains exactly one signed design sheet.
This situation is common in industry. There you not only exchange designs but code. We just wish to give you a small taste of such situations.
Thu Sep 26 19:02:10 EDT 2013
Deadline has been extended by an hour due to server problems during the last hour.
Wed Sep 25 10:43:40 EDT 2013
Here is the program designed in today’s lectures for regular Fundamentals I. Comment out the functional examples aka tests and step through some inputs to figure how the program works (not just what it does, which is explained in the purpose statement).
Mon Sep 23 08:41:42 EDT 2013
If you do not have a partner, please email William Bowman (wilbowma at ccs neu edu) with your name and MyNEU username. You are required to work with a partner for the problem sets. As of problem set 3, you will get a grade only if you turn in your problem set with a partner.
Fri Sep 20 14:40:10 EDT 2013
We have decided to grant a one-time 48 hour extension for turning in a problem set. Regardless of whether you had trouble turning in problem set 2 or not, you may upload another solution until Saturday 7pm. If you are experiencing trouble with the hand-in process, you must see a tutor or a TA (yes, we do have office hours on fridays and saturdays) and not leave until the hand-in problem is resolved. Emailing your homework to a random member of staff is not acceptable.
Thu Sep 19 11:13:02 EDT 2013
Here is the program used in today’s lectures for regular Fundamentals I. The program is not properly designed. What’s missing?
Wed Sep 18 18:06:45 EDT 2013
The handin server has been updated to allow image literals in your code. Please reread the handin page for more details.
Wed Sep 18 17:17:47 EDT 2013
(Third RacketCon) will take place on Sunday September 29, 2013. One of the
keynote speakers is Naughty Dog’s Dan
Liebgold who will explain how the gaming company uses Racket—
Tue Sep 17 17:11:29 EDT 2013
From today’s Northeastern prime news story:
According to the Northeastern University survey, nearly two-thirds of Americans (65%) and almost three-quarters of hiring decision-makers (73%) believe that being well-rounded with a range of knowledge is more important than possessing industry-specific skills.
Thu Sep 12 11:56:02 EDT 2013
1. I have equipped problem 2 on problem set 1 with an additional hint.
2. Chintan Suthar from the Disability Resource Center writes that one of the students in Fundamentals 1 needs a note-taking assistant. If you are interested, the center sent along an official letter describing the position.
Wed Sep 11 08:44:32 EDT 2013
Problem set 1 should be turned in to Prof. Van Horn’s office, 350 WVH, by 7PM Thursday. Slip it under his door if it is closed.
Thu Sep 5 13:45:43 EDT 2013
Prof. Felleisen will be away from Sep 5 through Sep 11. Prof. Van Horn will replace him.