CPS 100 13.1 What is Computer Science? What is it that distinguishes it from the separate subjects with which it is related? What is the linking thread.

Slides:



Advertisements
Similar presentations
Algorithm Analysis.
Advertisements

Lecture 19. Reduction: More Undecidable problems
Computability & Complexity. Scenario I can’t write this program because I’m too dumb.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Easy, Hard, and Impossible. Easy Tic Tac Toe Hard.
Complexity 15-1 Complexity Andrei Bulatov Hierarchy Theorem.
CSE332: Data Abstractions Lecture 27: A Few Words on NP Dan Grossman Spring 2010.
Complexity Theory CSE 331 Section 2 James Daly. Reminders Project 4 is out Due Friday Dynamic programming project Homework 6 is out Due next week (on.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
A Computer Science Tapestry 1.1 A Computer Science Tapestry Exploring Programming and Computer Science with C++ Second Edition Owen Astrachan Duke University.
The Theory of NP-Completeness
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Public Key Cryptography Topical Lecture Week 10. PUBLIC AB Public Key Cryptography A: Hey B, send me an encoded message. This is how you encode a message.
CS10 The Beauty and Joy of Computing Lecture #23 : Limits of Computing Thanks to the success of the Kinect, researchers all over the world believe.
Halting Problem. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have a tool that would warn us.
A Computer Science Tapestry 1.1 Wake up with CPS 006 Program Design and Methodology I Jeff Forbes
CPS Today’s topics l Computability ä Great Ideas Ch. 14 l Artificial Intelligence ä Great Ideas Ch. 15 l Reading up to this point ä Course Pack.
Introduction to Programming (in C++) Conclusions Jordi Cortadella, Ricard Gavaldà, Fernando Orejas Dept. of Computer Science, UPC.
CPS What is Computer Science? What is it that distinguishes it from the separate subjects with which it is related? What is the linking thread.
Duke University Computer Science 1 Why Computer Science is Uglier and Prettier than Mathematics Owen Astrachan Duke University
Cs3102: Theory of Computation Class 18: Proving Undecidability Spring 2010 University of Virginia David Evans.
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science.
Lecture 30. P, NP and NP Complete Problems 1. Recap Data compression is a technique to compress the data represented either in text, audio or image form.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
A Computer Science Tapestry 11.1 From practice to theory and back again In theory there is no difference between theory and practice, but not in practice.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Genome Revolution: COMPSCI 006G 1.1 FOCUS COMPSCI 006G Genome Revolution Owen Astrachan
CompSci CompSci 6 Programming Design and Analysis I Dietolf (Dee) Ramm
Computer Science and Everything 1 Big Ideas in Computer Science l “Mathematics is the Queen of the Sciences” Carl Friedrich Gauss l What is Computer Science?
Cliff Shaffer Computer Science Computational Complexity.
Halting Problem Introduction to Computing Science and Programming I.
Compsci 100, Fall What is Computing? Informatics? l What is computer science, what is its potential?  What can we do with computers in our lives?
CompSci What can be computed l What class of problems can be solved? ä Google Datacenter, Desktop computer, Cell phone, pencil? ä Alan Turing proved.
Compsci 06/101, Spring What is Computing? Informatics? l What is computer science, what is its potential?  What can we do with computers in.
CPS Topics since last test l Recursion l Sound l Graphics l Software design  Object-oriented  Copyright issues l Computer systems  Hardware 
Software Design 14.1 CPS 108 l Object oriented design and programming of medium-sized projects in groups using modern tools and practices in meaningful.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
CPS 100, Fall What is Computing? Informatics? l What is computer science, what is its potential?  What can we do with computers in our lives?
CS10: The Beauty and Joy of Computing Lecture #22 Limits of Computing Warning sign posted at Stern Hall. Also, Apple releases new operating.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
Computability Heap exercise. The class P. The class NP. Verifiers. Homework: Review RELPRIME proof. Find examples of problems in NP.
David Evans Class 16: NP-Completeness / The Story so Far CS150: Computer Science University of Virginia Computer Science.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
2101INT – Principles of Intelligence Systems Lecture 3.
Easy, Hard, and Impossible Elaine Rich. Easy Tic Tac Toe.
The Beauty and Joy of Computing Lecture #23 Limits of Computing Researchers at Facebook and the University of Milan found that the avg # of “friends” separating.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 7 Time Complexity Some slides are in courtesy.
CSE 311 Foundations of Computing I Lecture 28 Computability: Other Undecidable Problems Autumn 2011 CSE 3111.
CompSci On the Limits of Computing  Reasons for Failure 1. Runs too long o Real time requirements o Predicting yesterday's weather 2. Non-computable.
Compsci 101, Fall LWoC l Review Recommender, dictionaries, files  How to create recommendations in order? food.txt  Toward a Duke eatery-recommender.
NPC.
Fundamentals of Informatics Lecture 12 The Halting Problem Bas Luttik.
Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.
Compsci 06/101, Fall What is Computing? Informatics? l What is computer science, what is its potential?  What can we do with computers in our.
Genome Revolution: COMPSCI 006G 15.1 Recursion and Recursive Structures l Definition in the dictionary: in mathematics an expression in which a value is.
Duke University Computer Science 1 Topics since last test l More invariants l Pixmap l Sorting & Templates  Selection sort  Insertion sort  Quicksort.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
CPS What is Computer Science? What is it that distinguishes it from the separate subjects with which it is related? What is the linking thread.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
A few m3 tips. Street Segment Length / Travel Time Need to compute in double precision –Otherwise too much round off See piazza.
CSC 172 P, NP, Etc.
Introduction to Computing Science and Programming I
CompSci 6 Introduction to Computer Science
What is Computing? Informatics?
Unsolvable Problems December 4, 2017.
What is Computer Science at Duke?
Presentation transcript:

CPS What is Computer Science? What is it that distinguishes it from the separate subjects with which it is related? What is the linking thread which gathers these disparate branches into a single discipline? My answer to these questions is simple --- it is the art of programming a computer. It is the art of designing efficient and elegant methods of getting a computer to solve problems, theoretical or practical, small or large, simple or complex. C.A.R (Tony) Hoare

CPS What can be programmed? l What class of problems can be solved ?  G4, 1000Mhz Pentium III, Cray, pencil?  Alan Turing proved some things, hypothesized others Halting problem, Church-Turing thesis l What class of problems can be solved efficiently ?  Problems with no practical solution What does practical mean?  Problems for which we can’t find a practical solution Solving one solves them all Would you rather be rich or famous?

CPS Schedule students, minimize conflicts l Given student requests, available teachers  write a program that schedules classes  Minimize conflicts l Add a GUI too  Web interface  … I can’t write this program because I’m too dumb

CPS One better scenario I can’t write this program because it’s provably impossible

CPS Another possible scenario I can’t write this program but neither can all these famous people

CPS The halting problem: writing DoesHalt bool DoesHalt(const string& progname, const string& s) // post: returns true if progname halts given s // as input, false otherwise int main() { string f = PrompString("enter filename "); string s = PromptString("input for "+filename); if (DoesHalt(f,s)) cout << "does halt" << endl; else cout << "does not halt" << endl; } l A compiler is a program that reads other programs as input  Can a word counting program count its own words? The DoesHalt function might simulate, analyze, …  One program/function that works for any program/input

CPS Consider the program confuse.cpp #include "halt.h" int main() { string f = PrompString("enter filename "); if (DoesHalt(f,f)) { while (true) { // do nothing forever } return 0; } We want to show writing DoesHalt is impossible  Proof by contradiction:  Assume possible, show impossible situation results

CPS Not impossible, but impractical l Towers of Hanoi  How long to move n disks? l What combination of switches turns the light on?  Try all combinations, how many are there?  Is there a better way?

CPS Travelling Salesperson l Visit every city exactly once l Minimize cost of travel or distance l Is there a tour for under $2,000 ? less than 6,000 miles? l Is close good enough?  Within 10% of optimal  Within 50% of optimal  … Try all paths, from every starting point -- how long does this take? a, b, c, d, e, f, g b, a, c, d, e, f, g...

CPS Complexity Classifications l This route hits all cities for less than $2, verify properties of route efficiently. l Hard to find optimal solution Pack trucks with barrels, use minimal # trucks Ideas? Problems are the “same hardness”: solve one efficiently, solve them all

CPS Are hard problems easy? l P = easy problems, NP = “hard” problems  P means solvable in polynomial time Difference between N, N 2, N 10 ?  NP means non-deterministic, polynomial time guess a solution and verify it efficiently l Question: P = NP ?  if yes, a whole class of difficult problems can be solved efficiently---one problem is reducible to another  if no, none of the hard problems can be solved efficiently  showing the first problem was NP complete was an exercise in intellectual bootstrapping, satisfiability/Cook/(1971)  An NP complete problem is in NP (guessable/verify) and is the same “difficulty” as every other problem in NP

CPS Theory and Practice l Number theory: pure mathematics  How many prime numbers are there?  How do we factor?  How do we determine primeness? l Computer Science  Primality is “easy”  Factoring is “hard”  Encryption is possible top secret public-key cryptography randomized primality testing

CPS Why is programming fun? What delights may its practitioner expect as a reward? First is the sheer joy of making things Second is the pleasure of making things that are useful Third is the fascination of fashioning complex puzzle-like objects of interlocking moving parts Fourth is the joy of always learning Finally, there is the delight of working in such a tractable medium. The programmer, like the poet, works only slightly removed from pure thought-stuff. Fred Brooks

CPS What is computer science? l What is a computation?  Can formulate this precisely using mathematics  Can say “anything a computer can compute”  Study both theoretical and empirical formulations, build machines as well as theoretical models l How do we build machines and the software that runs them?  Hardware: gates, circuits, chips, cache, memory, disk, …  Software: operating systems, applications, programs l Art, Science, Engineering  How do we get better at programming and dealing with abstractions  What is hard about programming?

CPS Fred Brooks l … on computing pioneer Howard Aiken "the problem was not to keep people from stealing your ideas, but to make them steal them." l Duke valedictorian 1953, started UNC Computer Science Dept in 1964, won Turing Award in 1999 l Mythical-Man Month, "Adding man-power to a late project makes it later", … "There is no silver-bullet for Software Engineering… [because of essential complexity]" l Highest paid faculty in UNC Arts and Sciences