ALGORITHMS TO MACHINES
Gordon College, Fall 2007


Irvin J. Levy
Professor of Chemistry and Computer Science
Office Hours:
MWF, 8:00-9:00am, 12:30-1:00pm
T, 8:00-9:30am
al go rithm /al-guh-rith-uhm/ -noun
a set of rules for solving a problem in a finite number of steps, as for finding the greatest common divisor
ma chine /muh-sheen/ -noun
an apparatus consisting of interrelated parts with separate functions, used in the performance of some kind of work

Purpose

In its most general form, computer science is the study of algorithms and machines that perform them. Interestingly, computer science is a discipline that is both well-known and broadly misunderstood. To many, computer science refers to the acquisition of certain skills for using a computer. In other words, some think of learning to use a spreadsheet program, a word processor, or a web browser as "computer science." The term causes others to imagine people sitting in somewhat darkened rooms typing endless lines of cryptic code into a keyboard to create a remarkable new computer program. Some imagine engineers developing massive robots or amazingly small microcomputers embedded into other devices. Still others hear the term and envision anarchistic hackers roller-blading with laptop computers equipped to bring the world to its knees. In truth, all of these notions have something to do with "computer science" but none of them is sufficient to represent the richness of the topic.

In this course, you will be challenged to develop a clearer understanding of the term "computer science". You will see that computer science has much to do with practical applications such as the development of a new robotic vacuum cleaner, but it is also a philosophically interesting pursuit with mathematically elegant underpinnings. You will learn how to get work done with a computer, as well as how a computer works. You will understand how to use a computer, but also ways in that computers are sometimes manipulated to "use" us. Through reading and discussion you will begin to examine the evolution of our "digital society" and how it affects our lives and how it might affect us differently in the future.


Prerequisites

While no formal prerequisite coursework is required before attending this course, it is important for all students to be aware that this class has components that require mathematical reasoning, logical reasoning and abstract reasoning. Consequently, students with weak ability in one or more of these areas are strongly encouraged to discuss this with the professor during the first week of classes to determine whether the course is suitable for their needs.


Course Texts and Materials

Required

Course expectations

A. Lecture and Reading

Reading from the course texts will be assigned on a regular basis. All assignments must be read prior to the class in which the material will be discussed since the lecture will assume this degree of familiarity with the topic. Class sessions will include a discussion and amplification of the material from the text and the presentation of further examples and supplementary material. You should not necessarily expect to grasp everything presented in the text when you first read it; however, you should note areas that are unclear to you and be prepared to raise questions about them in class. If you read the material only after its lecture, you will not be able to participate effectively during the lecture and you are likely to feel as though lecture is only for note-taking rather than the intended learning experience.

All students are expected to attend lecture regularly and are responsible for all material covered during class. In the event of an unavoidable absence, it is the student's responsibility to learn of any material or assignments from the missed class.

B. Homework

Numerous homework problems will be assigned to help you clarify important concepts; however, normally homework will not be collected and will not directly affect your final course grade. Homework does, of course, affect the grade in that it is unlikely that the course content can be mastered without significant practice. Self-evaluation of homework will be possible through the use of posted solutions. You are encouraged to contact the professor either during office hours, by email or during appropriate times in lecture if questions relating to homework problems arise. Students are encouraged to work in groups to solve homework problems unless otherwise directed by the professor.

C. Quizzes

Since this course is of a technical nature and since the complexity of the material builds from topic to topic, it is essential that you stay up to date with the reading and homework from the course. In order to motivate you to continually interact with the material, numerous quizzes will be given throughout the semester. These quizzes will normally cover material from the previous several classes and normally will require no more than 10 minutes for completion. All quizzes will be announced no later than the lecture prior to the quiz date. Quizzes are closed-book, closed-note unless previously announced to the contrary. Make-up quizzes will not be administered under any circumstances; however, the two lowest quiz scores will be discarded when determining the final quiz grade.

D. Opportunities

Two times during the course you will receive the opportunity to solve problems during an entire class session. The opportunities will be administered on the dates listed in the course schedule. The second opportunity will be cumulative; however, it will emphasize material from the latter portion of the course. Each opportunity will assume familiarity with material from the text, from lecture, from homework problems and from laboratory work. Opportunities will be open book (course texts only) and open notes. Use of a computer will not be allowed.

E. Laboratory

Additional significant practice will come from a series of laboratory assignments. Laboratory work will typically be completed by partners. It is important that both partners in a team are fully aware of all material presented in the laboratory since all students will be responsible for any information presented in the laboratory. Often a pre-laboratory reading assignment will be given. It is essential that all pre-laboratory assignments be completed before arriving in lab. The time in lab is very limited; thus, sufficient preparation is important. Each laboratory will be evaluated on a Credit/No Credit basis. The final laboratory grade will be determined by summing the number of laboratory credits and dividing by the number of available credits. The material covered in the laboratory may be further evaluated either via Quiz or Opportunity.

In the event that a student is absent during a laboratory period, the student is responsible to complete the assignment, with a one-half credit penalty, no later than the beginning of the next laboratory period. After this final due date the assignment will not be accepted for credit; however, it may be completed without credit in order for the student to master the material.

A significant long-term laboratory project will be assigned during the course. In this project, a team of students will program a simple robot to perform various tasks. At the end of the course a competition will be as the culmination of the robot programming assignment. You should plan to spend significant amounts of time working on this project outside the scheduled laboratory hours.

IMPORTANT NOTE: Students who fail to receive credit for three or more laboratories will have final course grades reduced by one letter grade for each missing laboratory after the second. This penalty is in addition to the lowered laboratory grade.

Evaluation

The final score will be computed from a weighted average, as follows:

25%    Quizzes/Homework (drop two low scores)
25%    Opportunity #1
25%    Opportunity #2
25%    Laboratory

Miscellaneous Information

Make-up examinations will be allowed only if the absence is previously cleared with the instructor or in the event of an emergency. In the case of illness, a written excuse from the health center is required. In the case of a personal emergency, a note from the Center for Student Development is required.

Make-up quizzes are not administered under any circumstances.

Optional field experience: Students may mish to visit the MIT Museum, Cambridge, MA, ($5 admission plus transportation to Cambridge, MA required); see professor for instructions before visit if extra credit is desired. More details will be presented during class.

WARNING: Laboratory meets on the Tuesday before Thanksgiving.

Gordon College is committed to assisting students with documented disabilities (see Academic Catalog Appendix C, for documentation guidelines). A student with a disability who may need academic accommodations should follow this procedure:

1. Meet with a staff person from the Academic Support Center (Jenks 412 X4746) to:

a. make sure documentation of your disability is on file in the ASC,
b. discuss the accommodations for which you are eligible,
c. discuss the procedures for obtaining the accommodations, and
d. obtain a Faculty Notification Form.
2. Deliver a Faculty Notification Form to each course professor within the first full week of the semester; at that time make an appointment to discuss your needs with each professor.

Failure to register in time with your professor and the ASC may compromise our ability to provide the accommodations. Questions or disputes about accommodations should be immediately referred to the Academic Support Center. (See also Grievance Procedures in Student Handbook.)



Supplementary materials

NOTE: This list will expand during the semester. Check back frequently.

Tentative Lecture Outline


-------------------------------------------------------------------------------
Note on abbreviations in schedule assignments:

    "Text" refers to Invitation to Computer Science
    "CIS" refers to Computers in Society
    "Supplemental" refers to a resource from the list above
-------------------------------------------------------------------------------

WEEK #1

Aug 29 - What is Computer Science?               

         Homework for next class:
             Reading (see above): 
                 For a While, The Luddites Had a Smashing Success

Aug 31 - What is a computer?

        Homework for next class:
            Read text, Chapter 1.1 - 1.3
            Homework problems: p.34, #1.1, 1.13 and either 1.3 or 1.7
           
           CIS, Essay 1, Five Things We Need To Know About Technological Change

-------------------------------------------------------------------------------

WEEK #2

Sep 3 - LABOR DAY - NO CLASSES

Sep 5 - Algorithm Discovery and Design - Attributes of an Algorithm

        Homework for next class:
            Text, Chapter 1.4, 2.1 - 2.2
            CIS, Essay 2, Whom To Protect and How?
            Explore homework problem 1.8
            
Sep 7 - Describing Algorithms via Pseudocode
        Traveling Salesman

        QUIZ #1 on reading and homework
        
        Homework for next class:
            CIS, Essay 3, On The Nature of Computing
            Handout: Technology Inventory
 
-------------------------------------------------------------------------------

WEEK #3

Sep 10 - Pseudocoding, continued
         Searching, Sorting and Karel the Robot
         
         Reading for next class:  Karel handout

Sep 12 - The Efficiency of Algorithms
         Constant, Logarithmic, Linear, Polynomial, and Exponential

         "QUIZ #2" - Technology Inventory

         Homework for next class:
             Text, skim Chapter 3
             CIS, Essay 7 - The Software Wars
             Bubble sort explorations:
                  Sort the following lists showing new list after each pass
                  Count number of comparisons made for the complete sort of each list
                  Plot list size vs. # of comparisons
                  Lists:
                        4 7 12 14 2
                        4 7 12 14 2 5 8 19 11 1
                        4 7 12 14 2 5 8 19 11 1 3 16 42 32 99

Sep 14 - Sorted List Management
         Insertion into sorted list
         Linear search, binary search and algorithmic efficiency
         Towards a Θ(1) search
         
         QUIZ #3 on reading and homework
         
         Homework for next class:
             Text, Chapter 4, pages 130-137
             Karel the Robot handout

                        
-------------------------------------------------------------------------------

WEEK #4

Sep 17  - Stepwise Refinement of Complex Problems
          Introduction to Karel the Robot
          
          Homework for next class:
             Text, Chapter 4, pages 137-151
             CIS, Essay 8 - Brain Circulation
             
Sep 19  - Stepwise Refinement:
             Solving Roomba the Robot


Sep 21  - The Building Blocks, Binary Numbers, Boolean Logic and Gates
          Binary representation of integers, signed integers and real numbers

          Homework for next class:
             Text, Chapter 4, continued
             CIS, Essay 9 - Software
    
-------------------------------------------------------------------------------

WEEK #5

Sep 24  - Numeric codes, continued.

          Homework for next class:
             CIS, Essay 12 - The Computer Evolution
                       
Sep 26  - Binary representation of characters, images and sound
          Compression Algorithms
             Lossless Variable Length Encoding:
             The Huffman Code
          
          Homework on Binary assigned.  Due on Monday. Counts as a quiz.
          
          Reading for next class:
             CIS, Essay 13 - Making Yourself Understood
             CIS, Essay 14 - Back-to-School Blogging 
      
Sep 28  - No class today

         Reminders for bonus opportunity
         (see Prof Levy for details)
         
         MIT Museum
         
-------------------------------------------------------------------------------

WEEK #6

Oct 1  -  Boolean logic and switches
          AND/OR/NOT and all that stuff
          Symbolic logic
          Logic expressions in truth tables;


         
Oct 3  - Boolean Logic Expressions
         Logic Expressions ---> Truth Tables
         Equality of logic expressions
         Simplfying expressions
         Truth Tables ---> Logic expressions
             Parity
             Majority
             Not-equal
    
Oct 5  - Logic, Switches, Gates, then Circuits
         "Building" logic from switches
         Circuits to Expressions
         Simplifying circuits
             Parity
             Half Adder
             Full Adder
         
-------------------------------------------------------------------------------

WEEK #7

Oct 8 - Circuits that remember, Circuits for choosing
             Flip-flops
             Multiplexers
             Decoders

         Opportunity #1 Essay Questions distributed
         Quiz #5 on reading and homework
         von Neumann architecture - Building the box
         
         Homework for next class:
             CIS, Essay 17, Virtual Communities to Smart Mobs

Oct 10 - Computer Systems Organization
          Catch-up and review

Oct 12 - OPPORTUNITY #1 
         Open notes (and book, if you must)
         Bring completed essay
    
-------------------------------------------------------------------------------

WEEK #8

Oct 15 - Introduction to Assembly Language
         Machine codes, Multiplexers
           
Oct 17 - Introduction to High-level Language Programming

         Reading: 
             Text, Chapter 8
             CIS, Essay 28, Why Spyware Poses Multiple Threats to Security             
 
Oct 19 - QUAD BREAK, NO CLASSES

-------------------------------------------------------------------------------

WEEK #9

Oct 22 - Introduction to Lego Mindstorms Programming

         Reading:
             CIS, Essay 29, Terror's Server

Oct 24 - Reading:
             CIS, Essay 30, Homeland Insecurity
             
Oct 26 - Reading:
             CIS, Essay 32, The Fading Memory of State
             
-------------------------------------------------------------------------------

WEEK #10

Oct 29 - Compilers and Language Translation

         Reading: 
             Chapter 10

Oct 31 - Reading:
             CIS, Essay 35, China's Computer Wasteland

Nov 2 - Reading:
             CIS, Essay 36, The New Face of the Silicon Age
             CIS, Essay 37, Restoring the Popularity of Computer Science
    
-------------------------------------------------------------------------------

WEEK #11

Nov 5 - Models of Computation

        Reading: 
            Text, Chapter 11

Nov 7 - Reading:
             CIS, Essay 38, Weaving the Authoritarian Web

Nov 9 - Reading:
             CIS, Essay 40, Kabul's Cyber Cafe Culture

-------------------------------------------------------------------------------

WEEK #12

Nov 12 - Artificial Intelligence

         Reading: 
             Text, Chapter 14

Nov 14 - Supplementary reading (see above):
             Choose one of the following two essays:
                 Why People Think Computers Can't
                 Robots, After All

Nov 16 - Supplementary audiovisual (see above):
             Choose one of the following:
                 Interview with Dr. Anne Foerst
                  Dr. Rosalind Picard Convocation Lecture
                  
-------------------------------------------------------------------------------

WEEK #13

Nov 19 -  Reading:
             CIS, Essay 46, Mind Control
                     
-------------------------------------------------------------------------------

WEEK #14

Nov 26 - Social Impact of Computing
         Reading: 
             Text, Chapter 15

         Supplementary reading (see above):
             Human and Machine Dignity

Nov 28 - continued

         Video: Unauthorized Access
         
         Reading:
             CIS, Essay 31, The Virus Underground
             
             
Nov 30 -  Unauthorized Access (video) 

         Reading:
             CIS, Essay 23, Small Vote Manipulations Can Swing Elections
      
-------------------------------------------------------------------------------

WEEK #15

Dec 3 -  Reading:
             CIS, Essay 25, Facing Down the E-Maelstrom
     
Dec 5  - Selected Topics, TBA

         Reading:
             CIS, Essay 20, The Copyright Paradox

Dec 7  - Selected Topics, TBA

-------------------------------------------------------------------------------

WEEK #16

Dec 10 - Selected Topics, TBA

Dec 12 - Discussion of topics for Opportunity #2

-------------------------------------------------------------------------------

FINAL EXAMINATION PERIOD

Dec 19 - 12:30pm - 2:30pm - OPPORTUNITY #2

=============================================================

Tentative Laboratory Outline


Sep 4 : History of Computing
        The Machine That Changed The World
       
-------------------------------------------------------------------------------

Sep 11 : NO LAB TODAY
         TECHNOLOGY INVENTORY DAY
         FOLLOW INSTRUCTIONS PROVIDED IN CLASS
         
-------------------------------------------------------------------------------

Sep 18 :  Simulated robotics algorithm problem
          Roomba-the-Robot via Karel-the-Robot

-------------------------------------------------------------------------------

Sep 25 : Experimental measurement of time order of algorithms
         Sorting, Factoring (with related crpytography example)

         Sorting lab tools
         Factoring lab tools


-------------------------------------------------------------------------------

Oct 2 : Experiments in sorting continue
        Develop a question amenable to confirmation/denial
        Perform tests, analyze results, report findings

-------------------------------------------------------------------------------

Oct 9  : Logic in the Sandbox: Introduction to Circuit Sandbox digital simulator    
         Lab Report from previous week is due

-------------------------------------------------------------------------------

Oct 16 : Design of Circuits: From Function to Logic
         Given desired behavior, design and test circuits with Circuit Sandbox
                  

-------------------------------------------------------------------------------

Oct 23  :  Machine and Assembly Language Control of von Neumann Architecture

-------------------------------------------------------------------------------

Oct 30 : Introduction to LMR Programming
         Random Walk to goal; measurement of time performance

-------------------------------------------------------------------------------

Nov 6 : NO LAB TODAY, DAY OF PRAYER

-------------------------------------------------------------------------------

Nov 13 : Control Structures and Sensors in LMR programming
         "Walk The Line", "Keep on the Sunny Side", "Hello Walls"
         LMR project assigned

-------------------------------------------------------------------------------

Nov 20 : 2001: A Space Odyssey
         Optional supplements: 
            HAL's Legacy online
            2001, A Space Odyssey, Internet Resource Archive
            Review from DecentFilms.com
            2001: A Space God-esy, Mark Midbon
            See professor for: 
                "Creation Machines, Stanley Kubrick's View of Computers in 2001"

-------------------------------------------------------------------------------

Nov 27 : LMR project continues

-------------------------------------------------------------------------------

Dec 4  : LMR project continues

-------------------------------------------------------------------------------

Dec 11 : LMR project exhibition & competition