An odyssey through computer science

Readings: `Syllabus', `Resources', and Sections 1.1, 2.1, and 2.2..

Our goal

What's this all about?

To understand the

of COMPUTER SCIENCE

Helpful resources

CS staff:
Carl Burch, core instructor
Kirk Yenerall, lab/CTW instructor

Web page:

www.cburch.com

Textbook

Lectures:
Web notes and questions
Your questions!

Classwork:
Due Mondays
Collaborate!
Cluster help
Start early!

Classmates:

AliceBobCarrieKrunchEveSpot

Programming experience

But I know everything already!

Carrie's in the minority.

For those with programming experience: a self-study track!

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.

But computers are essential tools to problem-solving.

CS circles

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

Limbo!

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: Industry

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?

Curiouser and curiouser!

The plan

We're covering all that?

Table 1: Tentative schedule of topic coverage

Session Material
1 Prologue
2 :
3 Programming
4 :
5 :
6 :
7 Recursion
8 :
9 Internet
10 :
11 :
12 Algorithms
13 :
14 :
15 Cryptography
16 TBA / Quiz
17 Evaluation / Epilogue

This is very tentative!

Questions

If you ever feel yourself getting lost...

Ask questions!

Don't make me do all the work!

Problems: June 30

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 = red
     - - - 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.
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 ``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: a number n.
Output: true if n is prime, false if not.

We choose to represent the following algorithm as a flowchart, a pictoral representation of how we move through the algorithm.

Conclusion

We look forward to working
with you this month!

Tomorrow:
self-paced (``experienced'') students to Baker 140
beginner students: Scaife 125 (here)