Teaching / [FEB22012] Programmeren (2012)
This is the course page for Programmeren (Econometrics), academic year 2012-13, block 1.
Lecture notes and slidesThe lecture notes are available for download /here/. The econometrics study association (Econometrisch Dispuut) has agreed to print them for you for a small fee less than what you would pay for printing them yourself.
The lecture slides in pdf:
- #1 / 2012-09-03
- #2 / 2012-09-10
- #3 / 2012-09-17
- #4 / 2012-09-24
- #5 / 2012-10-01
- #6 / 2012-10-08
- #7 / 2012-10-15
Exercises will be posted here and in blackboard. The answers _must_ be submitted via blackboard. When submitting your answer, include all the matlab source files (the script- and function files with the .m extension) in a zip, and upload that through blackboard's exercise completion functionality. Note that although the Matlab environment is handy in testing individual lines of code by writing them directly in the command prompt, the solution you submit must consist solely of the source files (the ones of .m extension) that are executable independently.
I recommend getting used to the command prompt of matlab as it includes functionalities commonly available in text-based user environments (for example, browsing command history with up- and down arrows). Note that you can use the command prompt also for showing function documentation with command help (e.g. 'help fprintf'), and for finding function names with lookfor (e.g. 'lookfor print').
Exercises in pdf:
- #1: deadline 2012-09-07 23:59 CET
- #2: deadline 2012-09-14 23:59 CET
- #3: deadline 2012-09-21 23:59 CET
- #4: deadline 2012-09-28 23:59 CET
- #5: deadline 2012-10-05 23:59 CET
- #6: deadline 2012-10-12 23:59 CET
- #7: deadline 2012-10-18 23:59 CET
There are 7 exercises (one / week). The first exercise awards 5% of the final grade and the others 7.5% each, so the maximum possible to be achieved from the exercises is 50%. The other 50% comes from the written exam. The exercises are graded according to the following scheme:
- Up to 6% from completing the exercise succesfully. Code that does not run awards _always_ 0% from the whole exercise - do not submit crap. If you manage to complete only part of the exercise, submit it and state clearly in comments which part you did and which not
- 1.5% for code clarity (functions, indenting, comments, variable names)
ExamThe exam will be a standard one with three essay questions. Note that you are _not_ allowed to bring with you any extra material to the exam: only a pen(cil), a sharpener, and an eraser are allowed. An example exam including sample answers can be found /here/.
Data files used in the exercises:
Additional learning material:
- Book used in inleiding and voortgezet programmeren is C. Horstmann: Java Concepts, 6th ed., Wiley. Sections 1-6 and 12 compose the material required as pre-knowledge for this course.
- Internet is full of tutorials to programming in all possible languages. For example, see Wikiversity.
- Fun (at least IMHO) mathematical programming assignments can be found in the Project Euler. These are good learning material also for others than the pre-master students.
- The official Matlab learning resources page has a lot of learning material available.
- LN-TT-22012-2, p. 15: the "blocks" (P1-7, r, s, t, u) of Strassen's multiplication are incorrect, see the correct ones in wikipedia.
- LN-TT-22012-2, p. 24: in findKey, the curNode !=  should be ~isempty(curNode).
- Exercise 6, Algorithm 2, Line 1 should say: compute squared Euclidean distance between head and q.
- Exercise 7, Algorithm 1, Pr(i) computation: the sum upper bound should be n, not p.
- Exercise 7: nGen, PercComb and PercMut are not defined in the exercise. Possible good values are nGen >= 50, PercComb in [0.7, 0.9] and PercMut in [0.1, 0.3]. Note that other values might yield good results as well.
- LN-TT-22012-2, p.19: 'Let us now construct another program K that takes the output of H as its input and outputs "halt" if output of H is "loop", and "halt" otherwise.' Should be instead '... and loops infinitely otherwise'.
- LN-TT-22012-2, p.19: 'Given that K is a program, we can use it as the input to K.' should be 'Given that K is a program, we can use it as the input to H.'