An odyssey through computer science

Textbook: Chapters 1 and 2.

Our goal

What's this all about?

To understand the

of COMPUTER SCIENCE

People

Dr. Bob Frederking (and the ghost of CBurch)
Email: ref@cs.cmu.edu

Giancarlo Dozzi
Raksha Kumar
Anthony Velázquez

GOVIES

Assignments

Lecture

Textbook

``The textbook is excellent! It is very easy to understand and I used constantly as a reference while programming.''

``You could also assign pages to read in the textbook so that the students are somewhat prepared and not as clueless.''

(These quotes are from the PGSS '99 final course evaluations.)

You asked for it...

Webpage

Self-Study

For those with programming experience:

Definition

Enough preliminaries! What is computer science?

Computer science seeks to answer:

How can we solve
problems effectively?

Computers

But computer science should be about computers!

Computing science would be a better name. (Or maybe ``Informatics''?)

But computers are essentially tools for problem-solving:

CS circles

Let's look at the ``circles'' of CS.

First circle: Theory

What are the fastest ways to solve particular problems?

Second circle: Systems

How can we build better problem-solving tools?

Third circle: Practice

How can we build better programs?

Fourth circle: Artificial intelligence

How can we behave `intelligently' automatically?

Fifth circle: Programming languages

How can we best represent procedure?

The plan

We're covering all that?

Table 1: Tentative schedule of topic coverage

Session Material
1 Prologue
2 Programming
3 :
4 :
5 :
6 :
7 :
8 Recursion
9 Playing Games
10 Internet
11 :
12 Cryptography
13 Computer Hardware
14 Models of Computation
15 Comparative Programming Languages
16 Human Language Translation

This is very tentative!

Questions

If you ever feel yourself getting lost:

Ask questions!

Don't make me do all the work!

What is your problem?

If computer science is about solving problems...
What is a problem?

Problems

A problem is a set of questions with well-defined answers.

Examples

Examples of problems:

Non-examples:

Input and output

For a set of questions, a problem's input identifies the question to be answered.

The output is the answer to the question.

Example:

Problem ADDITION:
Input: two numbers x and y.
Output: the sum x+y.

A problem instance is a particular question from the set: ``What is 6 + 9?''

More example problems

You mean we're going to study arithmetic?

Our problems won't always be obviously mathematical.

Example:

Problem CHESS:
Input: a configuration of the board.
Output: a move for white guaranteeing a win.

Example input:

     Q - - - - - - -
     - - - - K - - R  boldface = black
     - - - P - - - -  roman = white
     - - - P - - - -  P = pawn
     - - - - P - P -  R = rook
     - - - - - P - -  K = king
     - - - - - - - -  Q = queen
     - R - K - - - -

Algorithms

An algorithm is a method for solving a problem that

Example: an algorithm for ADDITION

    111
    1999
  +  125
  ------
    2124

Another example

Think of algorithms for PRIMALITY.

Problem PRIMALITY:
Input: a number n that is greater than 1.
Output: true if n is prime, false if not.

Here are two algorithms. Each is written in pseudocode, a recipe-like mixture of blank space, English, and math.

There is no one ``system'' to pseudocode. I use my way, you use yours! Just make it pretty!

First algorithm:

Algorithm Prime-Test-Exhaustive(n):
for each i from 2 to n-1, do:
  if i divides n, then:
    output false.
    stop.
  end of if
end of loop
output true.
stop.

Second algorithm:

Algorithm Prime-Test-All(n):
for each integer i from 2 to sqrt(n), do:
  if i divides n, then:
    output false.
    stop.
  end of if
end of loop
output true.
stop.

Another example

Problem MISSING-CARD:
Input: 51 cards, each labeled uniquely between 1 and 52.
Output: the number missing from the deck.

One algorithm:

Algorithm Find-Missing-Card(deck):
while deck is not in increasing order, do:
    Shuffle deck.
end of loop
Find skipped number in deck.
Say this number.

Conclusion

We look forward to working
with you this month!