GEM 1501 - Problem Solving For Computing


Brief Description (Syllabus)

This course the opportunities and shortcomings of today's computer technology for solving practical problems. After a exploration of problems and computer-based problem solving, the student will be exposed to basic principles of algorithms, data structures and programming. An introduction to general problem solving techniques such as divide-and-conquer is complemented by a discussion of correctness and efficiency of algorithms. The course emphasizes the limitations of computers for problem solving, covering undecidability, intractibility and NP-completeness and the practical consequences of these shortcomings.

Topics

  1. What are problems?
  2. Algorithms and data
  3. Programming languages
  4. Introduction to algorithmic methods
  5. Correctness of algorithms
  6. Efficiency of algorithms
  7. Algorithmic methods
  8. Limitations of computers (I): Intractable and NP-complete problems
  9. Limitiations of computers (II): Undecidable problems
  10. Simulation and Universality
  11. Parallel Computing
  12. Probablistic Computing
  13. Is there artificial intelligence

Assessment

The students can make up to 100 marks in the course. They are obtainable as follows: Note that all examinations are closed book examinations. No material is permitted. The midterm tests will consist of 12 questions graded in a "0 or 1 schema", the final examination will consist of 10 questions consisting of 5 subquestions, each graded in a "0 or 1 schema". A grade 1 for a question requires a correct (or in some cases almost correct) answer.

Lectures and Labaratory Sessions

Accounts

Everyone receives a unix account at the computer sunfire.comp.nus.edu.sg. There is a new procedure which permits students to create the account by themselves. You can apply on this webpage to request a new account. This webpage also tells what to do in the case that the password is forgotten.

Please note that the password-input of the School of Computing can process only passwords of up to 8 characters. If your password is longer and you cannot log in, please change the password to a shorter one and try again. In the case that you still have problems, you can either contact Frank Stephan (fstephan@comp.nus.edu.sg) or the Helpdesk of the School of Computing (helpdesk@comp.nus.edu.sg, COM1#01-06).

The main purpose of the accounts is to do the assignments. If you want to use your own laptop computer and find a way to display and print webpages, this is also ok. But then you have to rely on yourself for technical questions concerning your operating system.

Course Material

The textbook for this course is Algorithmics - The Spirit of Computing, Third Edition by David Harel with Yishai Feldman, Addison Wesley, 2004.

The programming language used for this year's exercises is Java Script and the corresponding textbook is Java Script - A Beginner's Guide, Second Edition by John Pollock, McGraw-Hill/Osborne, 2004.

The course material is augmented with selected material from Computers Ltd. by David Harel as well as notes on particular problem solving techniques.

Links for further information. Editor PICO, EDITOR VI, Hyper Text Meta Language (HTML) and Java Script. If you use Editor PICO, please make the window in which it runs large enough; otherwise the editor makes linebreaks into the text which cause Java Script syntax errors.

A short introduction to Java Script for GEM1501 is available. This introduction is of course not as perfect as a text book but it should contain the most important information. Suggestions for improvement are welcome: Send them to fstephan@comp.nus.edu.sg. Please read this introduction prior to the first laboratory session.

Slides and Sample Programs

Warning: Slides are detailed but not self-explanatory. The lecture is only based on Harel's book, it is not identical with it. These two facts mean the following:
  1. A lot of information is put onto the slides. For this reason, you do not have to keep so much notes as you would have to do without slides. Furthermore, as a lot of the material from the lecture is written down onto slides, there are approximately 50 slides per lecture.
  2. Although the slides are comprehensive, not all information is there. It is recommended to attend the lectures in order to understand those things which are only explained orally and not written down. Slides are not lecture notes, but an auxiliary medium used during teaching a class.
  3. The lectures are based on the book of Harel, but not identical with it. So some material might be added and many other things are omitted.
  4. Java Script is added to Harel's book as it is good not only to learn the content on a theoretical level but also to apply the knowledge by writing easy programs; better said, by completing such programs. There is an Intorduction to Java Script and you should make yourself familiar with the content of this page prior to the start of the laboratory sessions. The first assignments are just to learn some minimum knowledge of Java Script.
The below material will be updated. Note that the dates in the year 2009 differ by one or two days from those in year 2008. The slides will be mainly based on the old ones, but some information and material might be modified. The new slides will always carry the date 2009, so all slides referring to 2008 are old. The sample programs will be modified only if really needed.

These slides are viewable only under some but not all versions of Adobe Acrobat Viewer. If you have problems, try to use GSView of the company Ghostgum in place of Adobe (this viewer can read both, ps-files and pdf-files); for Apple computers, try to convert the ps-file with the Previewer into an Apple-pdf-file.

Lecture 1 (14.01.2009): ps-file; pdf-file; Travelling Salesman Tour through all Swedish towns; Euclidian Algorithm.
Lecture 1 is related to Chapter 1 of the textbook "Algorithmics".
Lecture 2 (21.01.2009): ps-file; pdf-file.
Lecture 3 (28.01.2009): ps-file; pdf-file; Salary Addition with Datatypes Array and Record; List of programming languages on Wikipedia.
Lectures 2 and 3 are both based on Chapters 2 and 3 of the textbook "Algorithmics". Since the laboratory sessions require knowledge of the programming language Java Script, algorithms and programming languages are introduced in parallel.
Lecture 4 (04.02.2009): ps-file; pdf-file; Finding Maximum; Mergesort; Pivotsort; Dynamic Programming.
Lecture 4 is based on Chapter 4 of the textbook "Algorithmics".
Lecture 5 (11.02.2009): ps-file; pdf-file.
Lecture 5 is based on Chapters 5 and 6 of the textbook "Algorithmics".
Lecture 6 (18.02.2009): ps-file; pdf-file; Buttons and Windows; Code Optimization.
First half first midterm, second half selected topics on Java Script.
Lecture 7 (04.03.2009): ps-file; pdf-file; Computing Powers and Factorials; Monkey Puzzle; Satisfiability Problem.
Lecture 7 is based on Chapter 7 of the textbook "Algorithmics".
Lecture 8 (11.03.2009): ps-file; pdf-file; an example of a compressible text is the one of the Factorial of 5000 generated by this program.
Lecture 8 is based on Chapter 8 of the textbook "Algorithmics".
Lecture 9 (18.03.2009): ps-file; pdf-file; Turing machine examples (interactive and offline) from the lecture.
Lecture 9 is based on Chapter 9 of the textbook "Algorithmics".
Lecture 10 (25.03.2009): ps-file; pdf-file.
Lecture 10 is based on Chapter 10 of the textbook "Algorithmics".
Lecture 11 (01.04.2009): ps-file; pdf-file.
Lecture 11 is based on Chapters 11 and 12 of the textbook "Algorithmics".
Lecture 12 (08.04.2009): ps-file; pdf-file. Towers of Hanoi as object.
Lecture 12 is based on Chapter 13 of the textbook "Algorithmics".
First half first midterm, second half lecture.
Lecture 13 (15.04.2009): ps-file; pdf-file.
Lecture 13 is based on Chapter 15 of the textbook "Algorithmics".

Assignments

Note that deadline for the first 10 assignments is the laboratory of Week 6 and the last 18 assignments is the laboratory of week 13 (Friday 17.04.2009).

You can work on the assignments in the laboratory sessions. The goal is to aquire basic programming skills. For this the programming language Java Script is used so that you do not need a compiler and can control your results with a browser. It is recommended that you devote two hours a week for learning how to program in Java Script. In the case that you need assitance in the laboratory sessions, do not hesitate to ask for it.

Basic exercises to train programming in Java Script.
  1. Analyzing numbers (Exercise to correct syntax errors).
  2. Java Script Keywords.
  3. Easy Functions.
  4. For-Loops and While-Loops.
  5. Outputting Numbers as Words.
  6. Computing Function Values Iteratively.
Exercises related to the topics of the course.
  1. Euclid's Algorithm.
  2. Bubble Sort.
  3. Towers of Hanoi.
  4. Digit Hunting.
  5. Arrays and Records.
  6. Multiplication Table.
  7. Mergesort.
  8. Big O Calculus.
  9. Binary Search in Mathematics.
  10. Traveling Salesman on SMRT.
  11. Finite State Automaton.
  12. Post's Correspondence Problem.
  13. Turing Machine and Palindromes.
  14. Fast Parallel Sorting of 10 Inputs.
Advanced Exercises.
  1. Computing the determinant of a matrix.
  2. Playing strategies for Tic Tac Toe.
  3. Improving the Monkey Puzzle Page.
  4. Satisfiability and Resolution.
  5. ATM Money Withdrawl Game.
  6. Polynomial Time with Counter Automata.
  7. Multiplying polynomials with as few multiplications as possible.
  8. Code breaking - test codes and select the right one after statistical analysis.

Course Information

The course mainly follows the one given by Martin Henz in 2004 and the slides will be based on his material; his old slides are available on the information page for GEM 1501 from 2004 for those who want to have a further source of information on the material covered in the course. Nevertheless, the examinations are based on the current material only.
Frank Stephan