... a short talk on how we can do camouflage using computer programs. (Here are the slides, without my witty story-telling.)
Welcome to CS 1510, formally titled "Introduction to Computing". I will usually just call it "intro" or "1510". It aims to be just what its title says. For CS majors, it is the beginning of your journey. For non-majors, it is a glimpse into some of the cool ideas or computer science, and how it might help you in your own endeavors.
I hope that this course is a lot of fun for you, helps you to see just why CS is such a cool discipline, and prepares you well for the rest of your computer science studies. You should find the course challenging -- but I also hope that you find it fascinating.
I am Eugene Wallingford, and I'll be your instructor for 1510. (Everyone say, "Eugene"!) I've been at UNI for more than twenty years and am have been head of the department for a while.
I have passed out a short "vital statistics" page. It is Page 1 of the syllabus and contains basic contact information for me and the course. In particular, it lists the URL of the course web page, which includes pointers to a full syllabus and links to all our class activities, including notes on session notes, lab exercises, programming assignments, and code. Use this sheet to set a bookmark to the course web page in your favorite web browser. You never know when a strong urge to compute will strike you!
Study the syllabus carefully. It lists the policies by which we will run this course. You will need to know these policies and when they apply.
The last section of the syllabus gives a tentative schedule of our activities for the semester, including tentative exam dates. Some points that you should pay special attention to include:
Now, back to the good stuff...
What did my talk about camouflage have to do with computer science?
With the right representation, the instructions for manipulating data can be surprisingly straightforward. Here is the program to find the hidden image in a simpler steganography program:
def decode(encoded_image): for pixel in getPixels(encoded_image): setBlue(pixel, 0) setGreen(pixel, 0) red = getRed(pixel) setRed(pixel, red * 10) return(encoded_image)
If we pass it this encoded_image:
It will return to us this decoded_image:
The decoding program above is written in the Python programming language. You will learn to read and write Python as a part of this course. Even if you have never seen Python before, you may be able to understand the basic idea of the code. It uses a mixture of notation you may remember from math courses, notation that is peculiar to programming, and names for the things it manipulates. Notice: good names matter!
Computer science is about processes, and models of those processes. But our models aren't pencil-and-paper exercises. They are alive, because we can execute them on a digital computer.
We do three different kinds of thinking in CS:
Design is about trade-offs. Above, I said "With the right representation..." Different representations have different strengths and weaknesses, and make it easier or harder to describe certain processes.
One simple example is different representations for colors. The representation I described in the camouflage story is called RGB, because it represents the red, green, and blue components of each color in the image. An alternative is HSV, which represents in each pixel a hue, a saturation, and a value for its perceived intensity. What are the effects of different choices? What does each make easier or harder to represent and do? These are some of the questions we would have to answer in choosing one or the other to solve a particular problem in the world.
Of course, not every problem involves images. Consider the Case of the Imprecise Distance. My exercise bike at home. Times on the clock, speed during the intervals.
67.5 71.5 78.5 88.0 108.0 112.5 <-- times 13.1 13.7 14.3 15.1 15.9 <-- speeds
How far did I travel? The odometer reads 10 miles.
How can we find the answer?
But I am a computer programmer! I don't have to do this by hand every time I ride. First I represent the data using a Python list:
times = [67.5, 71.5, 78.5, 88.0, 108.0, 112.5] speed = [13.1, 13.7, 14.3, 15.1, 15.9]
Then I write an expression that computes length of each interval and looks up the speed I traveled during it:
range_speed = speed[i] range_length = times[i+1] - times[i]
I use these values to compute how far I traveled during the interval:
mileage += (range_speed * range_length/60)
Then I wrap these lines of code in a "loop" that does this computation for every interval and prints the result at the end:
mileage = 0.0 for i in range(0, len(speed)): range_speed = speed[i] range_length = times[i+1] - times[i] mileage += (range_speed * range_length/60) print mileage
We don't expect that any of you can do this yet, least of all in Python. By the end of the semester, though, we will have learned how to take a problem, begin to think of it in computational terms, and write a program to implement your idea. You all can and will learn these skills!
These days, everyone uses computer-based tools. We in CS make tools to help us and others do our jobs better. To do this, we find ways to represent and manipulate data.
Why? The reasons vary from person to person and day to day.
When we are struggling with a tough idea or challenging program, it is good to remember the effect of what we do on the world. People's live can be made better by what we do.
That is why we are here. Let's get busy.
(Note. The bookstore may have run out of textbooks. If you don't have a copy of the book yet, substitute in a different second item: at least one question you have about what we did in class today.)
Send me this message by 10 AM on Thursday.