CS074-The Digital World

 An Introduction to Information and Computing


Instructor

Howard Straubing
Room 571, 21 Campanella
Office Hours: Wednesday, Thursday 11-1,
and by appointment
Telephone: 552-3977
e-mail: straubin@bc.edu

Teaching Assistant

Bo Wen
e-mail: bo.wen.1@bc.edu

Contents of this Syllabus


What this Course is About
Prerequisites and Level
Course Software
Computer Use
Textbook
Lecture Notes, Readings, etc.
Required Work
Attendance
Academic Integrity
Grading
Detailed Schedule


What this Course is About


Until quite recently  recordings of music were made by  etching sound waves on a plastic disk with a vibrating needle.  Photographs were made by projecting a scene onto a  film coated  with light-sensitive silver salts, and then recovering the image by washing the film in a chemical bath.  If you wanted to find  an article in a magazine or a scientific journal you went to the library, and usually began by searching through a large collection of  index cards.

Today all these functions have been replaced by processes that represent the music, pictures, text, library catalogue entries and just about every other kind of information you can think of  as numbers.  These numbers are manipulated by computers that  compress, encrypt, slice, chop and mix the information they represent, and exchange  this information with other computers, often located at great distances. 

What do computers, which run on electricity and manipulate numbers, have to do with  photography, or music?  How does a song on a iPod manage to take up a smaller number of megabytes than the same song on a CD? (And while we're on the subject, what's a megabyte? ) How does the global Internet, which has become such a dominant presence in our lives, move information around?  How is this information kept secure, so that when you type your credit-card number to buy something from a Web retailer, it cannot be read by people who want to steal your money? How is the information indexed so that you can find it quickly on a search engine like Google?

This course has been designed to teach you how this stuff works . Although you will be using a computer all the time in your work in CS074, it is not a how-to course on useful computer applications, but more a look under the hood at the technical underpinnings of the subject, as well as its historical roots and social impact.

Another way to say it is that this course is an introductory survey of  Computer Science, whose subject matter is the representation and manipulation of information.

There are three distinct parts to this course.

Part I will examine how computers represent information. Everything in the digital world--text, numbers, audio, photos, video--is represented as sequences of bits.  You will use a software tool that will let you experiment with digital processing of text, audio and images, and learn about methods of data compression. (Along the way, you'll also find out what a megabyte is, learn your way around the different  formats for audio files and image files, and learn how to create web pages.)

Part II, a brief look at computer hardware, and guide you through the world of processors, RAM,  disks, routers, modems, etc.  We will see what the binary machine code behind all software looks like, and you'll write a little of that code yourself for a simple simulated processor.


Part III is devoted to  applications of computers and computing, including such things as the Internet, cryptography and data security, machine 'intelligence', and robotics.  As you study these topics, you will learn the rudiments of programming, using a programming language called python.

The beginnings of a detailed course schedule appear at the bottom of this page. This schedule will grow as the course progresses.

A Note about the Two Sections

This semester, Sections 1 and 2 are quite different.  Section 1 (this one) is a broad survey, covering an assortment of different topics and using a number of different software tools. Section 2, taught this semester by Prof. Robert Signorile, is devoted entirely to an introduction to programming using robots. What the two courses have in common is programming in python, and we will probably use the robots ourselves for one assignment.

Prerequisites and Course Level


There are no prerequisites for this course, and it is not, as far as I know, a prerequisite for anything else, certainly not in this department.  CS074 satisfies the University Core requirement for Mathematics, and while there is some math in the course, it is all of a fairly elementary sort. You don't have to know anything about computer programming or computer science.  Because we try to cover a lot of material without assuming any special technical background on the students' part, the level is fairly basic.  Still, to be perfectly honest, I will at times ask you to think hard in this course (you should be asked to think hard in every course)  Since the hard thinking here is mostly of the quantitative and logical reasoning variety,  if that's not your cup of tea---and I suspect that for many of you it isn't---you may encounter a few rough spots along the way.  But I intend to help you over those spots--- the class is small, and both the TA and I hold regular office hours---and I'm prepared to adjust things if it looks like even a few people are getting lost.

Course Software


You will need to download software that allows you to write and run programs written in the programming language Java.  (If you have a Mac, then your computer already has such software, but you may need to get the latest version.)  This will be available, along with instructions, on the first day of class.  Development of some of the materials for this course was funded by a grant from Boston College, and some of the grant funding was used to develop the special software packages we use. Most of the code for these was written by a student programmer, John Houston, working under my supervision.  The version of python that you will use in the second half of the course was developed at Georgia Tech in conjunction with a course that is similar to this one.  It's all free, and it runs both on Mac and Windows.

Computer Use


Strictly speaking, you don't need your own computer for this course, but it certainly helps.  If there are any students who do not own their own computers then we will make provisions for them in the department's workstation lab.  I'm assuming that if you own a computer, then you know at least a little bit about how to use it. Just the basics--How to copy, move, rename and delete files; how to open and save files in applications with the standard "File" and "Edit" menus; how to send e-mail,  and how to download files from a web site.  If you don't know how to do any of these things, I will be glad to show you outside of class.

Textbook


There isn't one.  While there are a number of courses more or less like this one taught at other colleges and universites, they are all usually too idiosyncratic to fit well with a textbook.  I have used textbooks in earlier versions of this course, liked none of them and hated most of them, and then felt guilty about having asked my students to drop a hundred bucks on a crummy book that we didn't even use all that much.  For what there is, see the next section.

Lecture Notes, Readings, etc.


There is, on the other hand, a great deal of written material for you to use, all of which will be posted on this web page.  These consist of 


Required Work

Lab assignments will be submitted by e-mail.  Detailed instructions on exactly how to do this can be found at the end of Lab 1 (posted below). No late lab assignments will be accepted.  In rare instances I will make exceptions for extenuating circumstances (illness, anticipated absence) but you must alert me about these beforehand. In these instances you will get a couple of extra days to complete the work.


How to do the Lab Assignments


Class Attendance

 
 Because of the many in-class lab exercises, and the small number of students, attendance at all classes is required. As mentioned above in the late homework policy, you need to alert me in advance about any anticipated absences for which there is a reasonable justification.

Academic Integrity

Dean Quigley of the College of Arts and Sciences has asked all instructors to post a link in their course syllabi to the University's policy on Academic Integrity. "Academic Integrity" is the opposite of "cheating", and the message is: Don't cheat.  It's unfair to your fellow students and you risk some serious trouble that is far worse than a bad grade in the course.

What constitutes cheating in this course depends upon the nature of the task you're working on.  If it's a quiz or an exam, it means any communication with any person about the test questions (not including questions you ask me in order to clarify something).  On the lab assignments, there really is a grey area, since I don't object to students discussing these problems with one another and sharing ideas. But the expectation is that after you have finished discussing, you go off to complete  the lab excercises and prepare your solutions by yourself.  Unauthorized collaboration often results in identical, or nearly-identical , files being submitted by two different students. The first time this occurs the students will receive both a warning and a grade of 0 on the assignment; the second violation will be referred to the Deans' office.

In standard programming courses, there is a big issue of students downloading code from the Web and submitting it as their own.  Because of the unusual nature of both the software and the assignments in CS074, this is unlikely to be much of a problem.  Still, there may be instances where you get the idea about how to complete an assigned exercise from a Web site.  Usually that's ok, but I ask that you clear it with me first.

Grading


To be eligible for a passing grade in the course, you need to satisfactorily complete at least 60% of the lab assignments. (This means that if you do only half of them, you fail the course, no matter how well you do on the quizzes and exams.)  If this minimum requirement is met, your grade will be computed based on (a) the lab assignments; (b) the quizzes and midterms; and (c) the final exam.  Each of these three components will account for approximately one-third of the course grade.

Detailed Schedule


Date and
Topic

Readings  and  References
Lecture  Notes    
Downloads   
Assigned Work   

1/14 : Welcome to the  course
 If you're interested in learning more about HTML and Web page design, there are many tutorials and references on the Web--this one looks like a pretty decent collection.

Scientifc American article on the Music ID program Shazam.  If you're working from a computer on campus, you can go to this site and type 'Name That Tune' in the form.  (I can't post the article here because of copyright restrictions.)

The 20Q game.
 Introduction to the course
Text Editor
Lab 0
do ASAP

Lab 1
due January 26

Lab 1 Solutions
 1/21:  Representing Information, bits and bytes.  How text is encoded as bits.

Representing Information

Bits and Bytes from the HowStuffWorks Website.




1/26 How numbers are encoded as bits.

Representing Numbers with Bits. Binary Editor

1/28 Using the Binary Editor
How sound is encoded as bits



In-class exercise with Binary Editor

Sample Text File

Sample Audio File

Lab 2, due February 4.

Lab2 Solutions
2/2 More on sound.  Images

The Digital World (long version).

The Digital World (slides).

Homework problems 1.

Homework 1 Solutions
2/4 More on images.  Lossless compression

How File Compression Works (from the HowStuffWorks website).

Lecture Notes on Data Compression

Sample Data

Text:

The Tell-tale Heart

Random ASCII characters

Images:



Hiroshige, Shoal of Fishes



Miro, Singing Fish



da Vinci, Mona Lisa



Blue


Sounds:

Flute

Square Wave
Lab 3, due February 11.

Lab  3 Solutions
2/11 More compression.  Introduction to Python and JES


Link to JES Downloads
Lab 4, due February 23.

Lab 4 Solutions.
2/16 Starting Python
The basic reference is the Help included with JES.   You can find a large number of python tutorials here.  This is a particularly good one.

If you use these tutorials, ignore the beginning steps concerning installation.  And note that ALL of our programs in JES will begin with the def keyword, so there may be some discrepancy with the sample programs in the tutorials, which allow saved scripts that are not function definitions



Sample python programs. (You can download these and run them in JES. Experiment with modifying these programs.)

Convert Temperatures (FtoC.py)

Open and Display a Picture (pickAndShow.py)

Modify a few pixels in a picture (setCenterWhite.py)


Lab 5, due February 26

Solutions:

CtoF.py

makeRedder.py
2/23 Looping through the pixels in a picture. Functions with parameters. Looping through a range of integers.


Modify all the pixels in a picture. (makeRed.py)

Brightening a picture. (brighten.py)


Creating a mirror image, and doing it wrong! (mirror.py)

Creating a mirror image, and doing it right by copying to a separate picture. (mirror2.py)


Scaling a picture to half size. (scale_half.py)

Illustration of functions with parameters and return values:  distance between two points. (dist_demo.py)

Functions with parameters for scaling pictures. (scale_demo.py)

Illustration of looping over a range. (looprange.py)

Creating a mirror image, and doing it right by interchanging pixel colors in place.  (mirror3.py)

Painting a big white square in the middle of a picture. (setCenterWhite2.py)


Lab 6, due March 16.

Solution to rotation problem.

Solution to yellow/red square problem.
3/9 Logical expressions and operators, if statement and its relatives.


Midterm Review
Illustration of conditional statements with programs for computing income tax:

tax1.py

tax2.py

tax3.py

If statement in image-processing:  The function we used to turn Cookie Monster red. (blue_to_red.py)

Increase the contrast of an image.  (increase_contrast.py)
Lab 7, due March 25.

Solution to Maximum-of-3 problem.

Solution to sepia tinting problem.

Solution to collage problem.
3/18 Midterm Exam

Midterm with Solutions


3/25 Functions for Drawing in JES. The function random().


Drawing of a partially filled-in tictactoe board. (tictactoe.py)

Smiley Face (HaveANiceDay.py)

A simulated coin-tossing experiment. (cointoss.py)

Uniformly distributed random dots in the plane. (random_dots.py)

A randomly colored checkerboard. (random_check.py)








Lab 8, due April 6

4/1 Strings.  The while statement.


An illustration of many of the ways of manipulating strings in python. (stringstuff.py)

Conversion of a binary string to an integer. (convert_from_binary.py)

Conversion of an integer to a binary string. (convert_to_binary.py)

4/6 Python Lists


An illustration of many of the ways of manipulating lists in python. (liststuff.py)

A program for creating and displaying a slide show. (classpix.py)

A program for generating random sentences. (word_soup.py)

4/13 The Internet
How Internet Infrastructure Works, from the "How Stuff Works" website.

How the Internet Works--a good explanation of Internet infrastructure, packets, IP addresses, and domain name resolution, and application protocols.

A program that illustrates reading from and writing to files.(read_write_files.py)

A program that generates a (very minimal) web page.
(generateWebPage.py)

A program that generates a more substantial web page.
(generateWebPage2.py)

A bio file used in preparing a web page with the preceding example.

The image file used to prepare the page.

The resulting web page.
(This doesn't display properly because the link to the picture refers to the directory system on the computer where the program was run.)
Lab 9, due April 24
4/20 Using Python to Extract Information from Websites


A very crude program that contacts a website for stock price information. (getStockPrice.py)

A refinement of this same program, that uses specific information about the format of the web page. (getStockPrice2.py)

A program to compute the Dow Jones Industrial. Average, using the stock price function above. (DowJones.py)

A program for computing the distance between two points on the earth, given their latitude and longitude. (greatCircleDistance.py)
Lab 10, due May 1
Final Exam Review
Review Problems