+ All Categories
Home > Documents > CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science...

CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science...

Date post: 17-Jun-2020
Category:
Upload: others
View: 3 times
Download: 0 times
Share this document with a friend
19
CS187 - Science Gateway Seminar for CS and Math Fall 2013 – Class 3 Sep. 10, 2013
Transcript
Page 1: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

CS187 - Science Gateway Seminar for CS andMath

Fall 2013 – Class 3

Sep. 10, 2013

Page 2: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

What is (not) Computer Science?

Network and system administration?

Playing video games?

Learning to use software packages?

Using and fixing computers?

Computer programming and code writing? (well, yes and no).

”Computer science is no more about computers than astronomy isabout telescopes” (attributed to Edsger Dijkstra, 1970)

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 3: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

What is it Really, Then?

The science of computation – theory and applications.

Theory – Algorithms, data structures, complexity,computability.

Programming languages.

Software engineering and design.

Hardware design, compilers, operating systems (this is actuallyabout computers!).

Application: Bioinformatics, robotics, computer vision,graphics, databases...

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 4: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

A Brief History

What we know as modern computer science was created inthe mid-20th century.

Often computer science did not exist as an independentdepartment/school until fairly recently (at UMB – only since2001).

The term ”Computer” was used to describe people until the1920’s!

Humans used mechanical devices for calculations forthousands of years.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 5: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Early History to 17th Century – First Mechanical Devicesand Theoretical Developments

Abacus, 2700–2300 BC – predating writtennumbers, Middle East and Asia

John Napier (1550–1617), discovery oflogarithms, decimal points, ”Napier bones”– a calculating instrument

Blaise Pascal (1623–1662), firstmechanical adding and subtracting device.

Gottfried Wilhelm Leibniz (1646–1716),binary system, formal binary logic,”stepped reckoner” – first mechanicaldevice capable of performing all 4arithmetic operations.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 6: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

19th Century – First Attempt at a ”Real” Computer

The ”difference engine” – amechanical computer fortabulating polynomialfunctions.

The ”analytical engine” – ageneral-purpose mechanicalcomputer containing a logicunit, conditional branching,loops, and integratedmemory.

Punched cards provided theinput.

Designed, never fully built.

Charles Babbage (1791–1871), inventedthe first computer.Ada Lovelace (1815–1852), first computerprogrammer.

Difference engine and analytical engine

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 7: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Turing and the Birth of Modern Computer Science

1930’s – the ”Church-Turingthesis” – formalization ofthe algorithm, the notion ofcomputability.

Lambda calculus (Church) –a framework for definingfunctions.

The Turing machine(Turing) – a theoreticalframework for a computer.

Alonzo Church (1903–1995)

Alan Turing (1912–1954)

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 8: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

The Turing Machine

A (hypothetical) devicerepresenting a computingmachine.

Contains an infinite tapewith a (finite) set of symbolsfrom a finite alphabet – theinput.

A read/write head that canmove to the left or right.

A (finite) set of state,including an initial state anda set of final states.

A (finite) list of instructionsthat tells us how to movefrom one state to another:Given a state qi and asymbol si , move to state qj ,write symbol sj and movethe head to the left or right.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 9: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Computability and the Universal Turing Machine

This is a very simple model... right?

Yet, it is as powerful as any computing device... even today.

As a matter of fact, any task can be computed (performed byany computational device following a list of instructions, justlike any of today’s computer programs) if and only if it can beperformed by a Turing machine.

The Universal Turing machine – A Turing machine that cansimulate any Turing machine on any input.

This is the foundation of modern day computers.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 10: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Stored-Program Computers, the Von-NeumannArchitecture

A design that does notrequire ”reprogramming” ofa computer for every newtask.

Instead, the programs andinstructions can be storedinside the computer.

Sort of like the UniversalTuring Machine...

Modern computers are stillbased on this architecture.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 11: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

What Are Algorithms, Anyway?

A set of instructions/procedures to solve a given problem.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 12: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

What Are Algorithms, Anyway?

A set of instructions/procedures to solve a given problem.

Input Algorithm Output

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 13: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

What’s in an Algorithm

Must be unambiguous, solve theproblem and terminate.

One starting point and (one ormore) end point(s).

Input and output (both optional).

Control flow – we follow theinstructions (not necessarily in theorder of their appearance) and atany stage we’re at some ”block”.

Conditional branching – if...then...(else...).

Loops – repeat some actions for acertain number of times or untilsome condition is filled.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 14: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

More (CS/Math Relevant) Examples

1 Print ”Hello, world!” on the screen.

2 Given a sequence of integers in no particular order, (-2, 17,36, 29, 100, 10), find the smallest.

3 Given a sequence of integers, sort them from the smallest tothe biggest.

4 Given a sequence of integers, calculate their sum.

How can you relate (2) and (3)?

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 15: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Use Smaller Building Blocks to Build a Larger Algorithm

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 16: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Use

1 Print ”Hello, world!” on the screen.

2 Given a sequence of integers in no particular order, (-2, 17,36, 29, 100, 10), find the smallest.

3 Given a sequence of integers, sort them from the smallest tothe biggest.

How can you relate (2) and (3)?

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 17: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Can Anything be Computed?

No. It can be mathematically shown that some problems areundecidable.

In other words – There are problems for which no algorithmcan be constructed that will always answer yes/no.

This concept is related to the Incompleteness theorems,stating that there cannot be a non-trivial, self-consistent setof mathematical axioms.

Any non-trivial axiomatic system will always containsunprovable theorems.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 18: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Computer Science is (also) About Computers

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math

Page 19: CS187 - Science Gateway Seminar for CS and Mathnurith/cs188/class01/class02.pdf · CS187 - Science Gateway Seminar for CS and Math Fall 2013 { Class 3 Sep. 10, 2013

Acknowledgements and Sources

Wikipedia

Ikea catalog

Kevin Amaral, CS department.

Nurit Haspel CS187 - Science Gateway Seminar for CS and Math


Recommended