Date post: | 31-Dec-2015 |
Category: |
Documents |
Upload: | noble-kidd |
View: | 28 times |
Download: | 2 times |
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
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.
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]
Cody [email protected]
TextbookInvitation to Computer Science: Java Version (Paperback)Third EditionG. Michael Schneider & Judith L. Gersting
Reading Assignment
Chapter 1 in Textbook
Homework Assignmentpage 34 of TextbookProblems 5,7,8,9,13Due Sept 4 at beginning of class
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.
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
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.
Class Web Site
www.cs.hiram.edu/~oliphantLT/cpsc171
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
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
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
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
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
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.
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.
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
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.
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
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
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.
…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?
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.
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.
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
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.
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.
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.
ApplicationsWhat are some applications of
computers in current use: Modeling and Simulation Information Retrieval Numerical Problem Solving Telecommunications Artificial Intelligence Networking Graphics
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
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
ENIAC
Programming required rewiring of the machine
Source: http://ftp.arl.army.mil/ftp/historic-computers/
Eniac’s Vacuum Tubes
Photo taken at Computer Science History Museum, San Jose, CA, by Dr. Robert Walker on VLSI Trip to Silicon Valley.
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
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
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
Smaller and Smaller
Faster and Faster
My Laptop
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!
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
Summary
Course Overview
Definitions of Computer Science and Algorithms
Brief History of Computers
Great Job Prospects
Reading Assignment
Chapter 1 in Textbook
Homework Assignmentpage 34 of TextbookProblems 5,7,8,9,13Due Sept 4 at beginning of class