CPSC 171 Introduction to Computer Science

43
CPSC 171 Introduction to Computer Science Lecture: MWF 1:15pm-2:35pm, Colton 103 Lab 1: TH 9:40am-11:40am, Colton 106 Lab2: TH 2pm-4pm, Colton 106

description

CPSC 171 Introduction to Computer Science. Lecture: MWF 1:15pm-2:35pm, Colton 103 Lab 1: TH 9:40am-11:40am, Colton 106 Lab2: TH 2pm-4pm, Colton 106. Course Description. - PowerPoint PPT Presentation

Transcript of CPSC 171 Introduction to Computer Science

Page 1: CPSC 171 Introduction to Computer Science

CPSC 171 Introduction to Computer Science

Lecture: MWF 1:15pm-2:35pm, Colton 103Lab 1: TH 9:40am-11:40am, Colton 106Lab2: TH 2pm-4pm, Colton 106

Page 2: CPSC 171 Introduction to Computer Science

Course Description

The introduction to the computer science discipline which establishes a scientific foundation for a variety of topics, including computer programming, computer design, information processing, the algorithmic solution of problems, and the study of the algorithmic process itself. Prerequisites: Computer Science 172 or 170 (co-requisite) or permission.

Page 3: CPSC 171 Introduction to Computer Science

Instructor & TAs

Louis OliphantOffice: 111 Colton

Office Hours:MWF 2:35pm-4:35pmTH 4pm-5pmOpen Door Policy

Email:[email protected]

Stefan [email protected]

Christian [email protected]

Matt [email protected]

Dan [email protected]

Cody [email protected]

Page 4: CPSC 171 Introduction to Computer Science

TextbookInvitation to Computer Science: Java Version (Paperback)Third EditionG. Michael Schneider & Judith L. Gersting

Page 5: CPSC 171 Introduction to Computer Science

Reading Assignment

Chapter 1 in Textbook

Homework Assignmentpage 34 of TextbookProblems 5,7,8,9,13Due Sept 4 at beginning of class

Page 6: CPSC 171 Introduction to Computer Science

Lab Book

Invitation to Computer Science Lab Manual: C++ and Java(Paperback)Kenneth Lambert & Thomas Whaley Be sure you do NOT buy a manual with any handwriting in it. In the first lab session, your manual will be checked for writing. You must have the original copy of the disk in the manual for the labs as this will meet licensing agreements.

Page 7: CPSC 171 Introduction to Computer Science

Grading

Lab Portion 30%One lab report each

weekLab reports due one

week after assigned

late labs lose 10% per day.

Late lab reports may only be handed in up to 3 days late.

Lecture Portion 70%1st Midterm 20%2nd Midterm 20%Final Exam 20%Assignments 10%

To pass the course you must pass each part independently

Page 8: CPSC 171 Introduction to Computer Science

Academic Integrity

All examinations and labs must be done individually. Cheating or plagiarizing will result in a zero. You are encouraged to work together on homework assignments. Please discuss problems in a general manner to understand concepts and ideas. Do not copy or allow others to copy your work.

Page 9: CPSC 171 Introduction to Computer Science

Class Web Site

www.cs.hiram.edu/~oliphantLT/cpsc171

Page 10: CPSC 171 Introduction to Computer Science

Who Are You?

Name (and how to pronounce it)What you would like to be calledYear in CollegeMajor (declared or considering)Reason for taking course Fullfils some requirement (which

one?) Considering computer science

Page 11: CPSC 171 Introduction to Computer Science

What is Computer Science?

The science that studies living organisms

What is Biology?What is Astronomy?

The branch of physics that studies celestial bodies and the universe as a whole

www.wordnetweb.princeton.edu

Page 12: CPSC 171 Introduction to Computer Science

Computer Science is NOT

Computer science is NOT the study of computers.

Computer science is NOT the study of how to write computer programs.

Computer science is NOT the study of the uses and applications of computers and software

Page 13: CPSC 171 Introduction to Computer Science

Computer Science is

Computer science: The study of algorithms, including Their formal and mathematical

properties Their hardware realizations Their linguistic realizations Their applications

Textbook definition

Page 14: CPSC 171 Introduction to Computer Science

An Algorithm is

A well-ordered collection ofUnambiguous andEffectively computable operations

that, when executedProduces a result andHalts in a finite amount of time

Textbook definition

Page 15: CPSC 171 Introduction to Computer Science

A VERY SIMPLE ALGORITHM1. Wet your hair.2. Lather your hair.3. Rinse your hair.4. Stop.

We assume that

The algorithm begins executing at the top of the list of operations.

The "Stop" can be omitted if we assume the last line is an implied "Stop" operation.

Observe:

Operations need not be executed by a computer only by an entity capable of carrying out the operations listed.

Page 16: CPSC 171 Introduction to Computer Science

Well-Ordered Collection of Operations

The question that must be answered is:

At any point in the execution of the algorithm, do you know what operation is to be performed next?

Well-ordered operations:

1. Wet your hair.

2. Lather your hair.

3. Rinse your hair.

Not well-ordered operations:

1. Either wet your hair or lather your hair.

2. Rinse your hair.

Page 17: CPSC 171 Introduction to Computer Science

Well-ordered operations:1. If your hair is dirty, then a. Wet your hair. b. Lather your hair. c. Rinse your hair.2. Else

a. Go to bed.

Note: We will often omit the numbers and the letters and assume a "top-down" reading of the operations.

Don't assume that you can't make choices:

Well-ordered operations:If your hair is dirty, then Wet your hair. Lather your hair. Rinse your hair.Else

Go to bed.

Well-Ordered Collection of Operations

Page 18: CPSC 171 Introduction to Computer Science

Unambiguous Operations

The question that must be answered is:

Does the computing entity understand what the operation is to do?

This implies that the knowledge of the computing entity must be considered.

For example, is the following ambiguous?

Make the pie crusts.

Page 19: CPSC 171 Introduction to Computer Science

To an experienced cook,Make the pie crusts.

is not ambiguous.

But, a less experienced cook may need:Take 1 1/3 cups of flour.Sift the flour.Mix the sifted flour with 1/2 cup of butter

and 1/4 cup of water to make dough.Roll the dough into two 9-inch pie crusts.

or even more detail!

Unambiguous Operations

Page 20: CPSC 171 Introduction to Computer Science

Definition: An operation that is unambiguous is called a primitive operation (or just a primitive)

One question we will be exploring in the course is what are the primitives of a computer.

Note that a given collection of operations may be an algorithm with respect to one computing agent, but not with respect to another computing agent!!

Unambiguous Operations

Page 21: CPSC 171 Introduction to Computer Science

Effectively Computable Operations

The question that must be answered is:Is the computing entity capable of doing the operation?

This assumes that the operationmust first be unambiguous, i.e. the computing agent understands what is to be done.

Not effectively computable operations:

Write all the fractions between 0 and 1.

Set A to (S/N).

Add 1 to the current value of X.

Page 22: CPSC 171 Introduction to Computer Science

…Produces a Result

The result need not be a number or piece of text viewed as "an answer".

It could be an alarm, signaling something is wrong.

It could be an approximation to an answer.

It could be an error message.

The question that must be answered is:Can the user of the algorithm observe a result produced by the algorithm?

Page 23: CPSC 171 Introduction to Computer Science

Halts in a Finite Amount of Time

The question that must be answered is:Will the computing entity complete the operations in a finite number of steps and stop?

Do not confuse "not finite" with "very, very large". A failure to halt usually implies there is an infinite loop in the collection of operations:

1. Write the number 1 on a piece of paper.2. Add 1 to the number and write

it on a piece of paper.3. Repeat 2.4. Stop.

Page 24: CPSC 171 Introduction to Computer Science

An Algorithm isA well-ordered collection ofUnambiguous andEffectively computable operations

that, when executedProduces a result andHalts in a finite amount of time

Textbook definition

Note: Although I have tried to give clean cut examples toillustrate what these new words mean, in some cases, a collection of operations can fail for more than one reason.

Page 25: CPSC 171 Introduction to Computer Science

Computer Science is

Computer science: The study of algorithms, including Their formal and mathematical

properties Their hardware realizations Their linguistic realizations Their applications

Textbook definition

Page 26: CPSC 171 Introduction to Computer Science

Formal and Mathematical Properties

It is not enough to develop any old algorithm to solve a problem.We must worry about some additional properties of an algorithm: How efficient is it? What kinds of resources must be used to

execute it? How does it compare to other algorithms that

solve the same problem.

Page 27: CPSC 171 Introduction to Computer Science

Hardware RealizationsAlgorithms need not execute on machines. All we really need are computing entities. Anything that can compute – e.g., a human.

But, ultimately, most of our interest will lie with algorithms that execute on computing entities called "computers".How are these entities constructed? The emphasis will be on the logical

construction of a computer, not the physical construction.

Page 28: CPSC 171 Introduction to Computer Science

Linguistic Realizations

How do we represent algorithms?

We will start with one linguistic realization, called pseudocode and later will look at many different realizations in various programming languages.

Page 29: CPSC 171 Introduction to Computer Science

ApplicationsWhat are some applications of

computers in current use: Modeling and Simulation Information Retrieval Numerical Problem Solving Telecommunications Artificial Intelligence Networking Graphics

Page 30: CPSC 171 Introduction to Computer Science

ENIAC – (Electrical Numerical Integrator And Calculator), built by Presper Eckert and John Mauchly at Moore School of Engineering, University of Pennsylvania, 1941-46

Often called the first computer (that was electronic, programmable, general purpose and digital).

History of Computers

Page 31: CPSC 171 Introduction to Computer Science

ENIAC18,000 vacuum tubes and weighed 30 tons Duration of an average run without some failure was only a few hours, although it was predicted to not run at all! When it ran, the lights in Philadelphia dimmed!ENIAC Stored a maximum of twenty 10-digit decimal numbers. Input: IBM card readerOutput: Punched cards, lights

Page 32: CPSC 171 Introduction to Computer Science

ENIAC

Programming required rewiring of the machine

Source: http://ftp.arl.army.mil/ftp/historic-computers/

Page 33: CPSC 171 Introduction to Computer Science

Eniac’s Vacuum Tubes

Photo taken at Computer Science History Museum, San Jose, CA, by Dr. Robert Walker on VLSI Trip to Silicon Valley.

Page 34: CPSC 171 Introduction to Computer Science

Source: http://www.cs.virginia.edu/brochure/images/mus_024.jpg

A vacuum tube similar to those used in the earliest computers.

Stored a single on/off value called a bit

Vacuum Tubes

Page 35: CPSC 171 Introduction to Computer Science

9

TransistorReplaced vacuum tube, fast, small, durable, cheap

Magnetic CoresReplaced magnetic drums, information available instantly

Magnetic DisksReplaced magnetic tape, data can be accessed directly

Second Generation Hardware (1959-1965) - Characteristics

Page 36: CPSC 171 Introduction to Computer Science

10

Integrated CircuitsReplaced circuit boards, smaller, cheaper,faster, more reliable.

TransistorsNow used for memory construction

Terminal An input/output device with a keyboard and screen

Third Generation Hardware (1965-1971)

By 1968 you could buy a 1.3 MHz CPU with half a megabyte of RAM and 100 megabyte hard drive for a mere US$1.6 million.

Charles Falco/Photo Researchers

Page 37: CPSC 171 Introduction to Computer Science

Smaller and Smaller

Page 38: CPSC 171 Introduction to Computer Science

Faster and Faster

My Laptop

Page 39: CPSC 171 Introduction to Computer Science

Great Job ProspectsWhat field has…• …the best-rated job, and 5 of the

top 10 highest paid, highest growth jobs?

• …shown strong job growth in the face of outsourcing?

• …a looming severe shortage in college graduates?

Computer Science!

Page 40: CPSC 171 Introduction to Computer Science

5 computing jobs are in the top 10 salary jobs from the Bureau of Labor Statistics’ list of the 30 fastest growing jobs through 2014. (Morsch, Laura. CareerBuilders.com, Jan. 27, 2006.)

1. Computer systems software engineer: $81,1402. Computer applications software engineer: $76,3106. Computer systems analyst: $67,5207. Database administrator: $61,9509. Network systems and data communication analyst:

$61,250

Salaries are given as mean annual salaries over all regions.

Great Job Prospects

Page 41: CPSC 171 Introduction to Computer Science
Page 42: CPSC 171 Introduction to Computer Science

Summary

Course Overview

Definitions of Computer Science and Algorithms

Brief History of Computers

Great Job Prospects

Page 43: CPSC 171 Introduction to Computer Science

Reading Assignment

Chapter 1 in Textbook

Homework Assignmentpage 34 of TextbookProblems 5,7,8,9,13Due Sept 4 at beginning of class