1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science.

Slides:



Advertisements
Similar presentations
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
Advertisements

Computability & Complexity. Scenario I can’t write this program because I’m too dumb.
1 The Limits of Computation Intractable and Non-computable functions.
 The amount of time it takes a computer to solve a particular problem depends on:  The hardware capabilities of the computer  The efficiency of the.
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
The Theory of NP-Completeness
The max flow problem
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
Cmpt-225 Algorithm Efficiency.
Analysis of Algorithms CS 477/677
Chapter 11: Limitations of Algorithmic Power
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.
1 Algorithms and Analysis CS 2308 Foundations of CS II.
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.
Algorithms. Problems, Algorithms, Programs Problem - a well defined task. –Sort a list of numbers. –Find a particular item in a list. –Find a winning.
BIT Presentation 4.  An algorithm is a method for solving a class of problems.  While computer scientists think a lot about algorithms, the term.
1 Ethics of Computing MONT 113G, Spring 2012 Session 11 Graphics on the Web Limits of Computer Science.
Algorithms Friday 7th Week. Algorithms What is an Algorithm? –A series of precise steps, known to stop eventually, to solve a problem –NOT necessarily.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms Shortest-Path.
How difficult is it to solve a problem?. Computability and Feasibility  Can a specific problem be solved by computation?  If so, can a suitably efficient.
Chapter 18 Limitations of Computing. Chapter Goals – THE BIG SLICES Limitations of Hardware Limitations of Software Limitations of Problems 2.
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
Analysis of Algorithms
Unsolvability and Infeasibility. Computability (Solvable) A problem is computable if it is possible to write a computer program to solve it. Can all problems.
CSC 413/513: Intro to Algorithms NP Completeness.
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.
Cliff Shaffer Computer Science Computational Complexity.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Georgia Institute of Technology Speed part 6 Barb Ericson Georgia Institute of Technology May 2006.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
3.3 Complexity of Algorithms
Halting Problem and TSP Wednesday, Week 8. Background - Halting Problem Common error: Program goes into an infinite loop. Wouldn’t it be nice to have.
Beauty and Joy of Computing Limits of Computing Ivona Bezáková CS10: UC Berkeley, April 14, 2014 (Slides inspired by Dan Garcia’s slides.)
SNU OOPSLA Lab. 1 Great Ideas of CS with Java Part 1 WWW & Computer programming in the language Java Ch 1: The World Wide Web Ch 2: Watch out: Here comes.
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.
Module #7: Algorithmic Complexity Rosen 5 th ed., §2.3.
Complexity & Computability. Limitations of computer science  Major reasons useful calculations cannot be done:  execution time of program is too long.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
LIMITATIONS OF ALGORITHM POWER
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.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Math Review 1.
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.
Chapter VI What should I know about the sizes and speeds of computers?
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
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.
Copyright © 2014 Curt Hill Algorithm Analysis How Do We Determine the Complexity of Algorithms.
1 Computability Tractable, Intractable and Non-computable functions.
Algorithm Complexity By: Ashish Patel and Alex Golebiewski.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
Ch03-Algorithms 1. Algorithms What is an algorithm? An algorithm is a finite set of precise instructions for performing a computation or for solving a.
1 Algorithms Searching and Sorting Algorithm Efficiency.
CompSci Today’s Topics Computer Science Noncomputability Upcoming Special Topic: Enabled by Computer -- Decoding the Human Genome Reading Great.
Algorithmic Foundations COMP108 COMP108 Algorithmic Foundations Algorithm efficiency Prudence Wong
CMPT 438 Algorithms.
Chapter 12: Theory of Computation
1.5 Intractable problems.
Enough Mathematical Appetizers!
Introduction to Algorithms
CS 2210 Discrete Structures Algorithms and Complexity
Module #7: Algorithmic Complexity
Applied Discrete Mathematics Week 6: Computation
Discrete Mathematics CS 2610
4. Computational Problem Solving
Module #7: Algorithmic Complexity
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Algorithms CSCI 235, Spring 2019 Lecture 37 The Halting Problem
CS 2210 Discrete Structures Algorithms and Complexity
Presentation transcript:

1 Ethics of Computing MONT 113G, Spring 2012 Session 13 Limits of Computer Science

2 Limitations of Computer Science In practice, we cannot solve every problem with a program because... 1)The execution time of a program may be too long. 2)The problem may be non-computable. 3)We may not know how to solve the problem. E.g. Computer Vision Artificial Intelligence Modeling complex systems such as weather etc.

3 Execution Time The execution time of a program can be a limitation in what we can compute. Examples: Taxes: How long would it take to sort taxpayers by Social Security number? Electricity: What is the most efficient routing of power lines through a region or neighborhood? Tractable problems can be solved in a reasonable amount of time. Intractable problems require huge amounts of time to solve.

4 A Tractable Problem Suppose we have a list of patients and an associated list of patient weights. We want to write a program that prints out the names of patients with weight above a given value. The names are stored in a list of strings. The weights are stored in a parallel list of real numbers. AmyTedAnnTom name n weight n...

5 The solution and its running time The program examines each patient in turn. The running time is proportional to the number of patients in the list (n). n (# patients)time (seconds) time n Python solution: for i in range(n): if weight[i] > targetWeight: print name[i]

6 Linear Running time The graph of the running time of the previous problem is a line. t = 5.1 x n We say the the running time is linear. Problems that have linear running times can be solved in a reasonable amount of time. These problems are tractable.

7 Another example Suppose we want to sort the patients by their weight. I.e. we would like to rearrange the list so that the weights go from lowest to highest. Many sorting algorithms run as a function of n 2. For example: t = 3.2 x n 2 Others run as a function of n log 2 n. For example: t = 2.1 x n log 2 n Logarithms: If 2 x = n, then log 2 n = x 2 3 = 8, log 2 8 = 3

8 Graphing the running time for a sorting function # people (n)t (seconds) time n n n2n2 n log n Sorting a list takes more time than searching a list, but it still can be done in a reasonable amount of time.

9 Polynomial and Polylogarithmic running times In general, tractable problems are problems that have running times that are a polynomial function of n (the size of the input) or a polylogarithmic function of n. Examples: t = 4n 3 + 5n 2 -3 t = n 2 (log 2 (n)) 3 t = 17 n 6 - log 2 n + 6n

10 Intractable Computations A computation is intractable if the running time increases faster than a polynomial of the input size (n). For example: Running times that increase exponentially: t = 3 n t = 2 n + n 3 Running times that increase like the factorial of n: t = n!t = 4n 3 + 3n! (Recall that n! = 1x2x3x4...x(n-1)xn )

11 Example of an intractable problem: Find all possible orderings (permutations) of n objects. n = 3; A, B, C (we will work this out in class) ABCBACCABTotal of 6 possibilities. ACBBCACBA In general, for n objects, their are n! possible orderings. ntimentime 5< 1 sec20Can you guess? sec21?? sec22?? min min hours

12 The Traveling Salesman problem Suppose a salesperson wants to visit a series of n cities, beginning and ending with the home city. He wants to visit each city only once (except the home city where he begins and ends). What order of cities will give him the shortest possible trip? A B CD E F

13 Solving Traveling Salesman problem To solve the traveling salesman problem, we must compute the distance for every possible path: ABCDEFA ACBDEFA ADBDEFA... How many possibilities are there? (n - 1)! Therefore, this is an intractable problem.

14 Alternative solutions for intractable problems Many intractable problems involve solving for the best solution. We can often speed up the solution if we are willing to accept a good solution. For example, in the traveling salesman problem: 1)Find the shortest path from the current city to a city that has not yet been visited. 2)If no cities are still unvisited, go home. Otherwise, repeat step 1. This will lead to a good solution (e.g. a reasonably short path), but not necessarily the best solution (i.e. the shortest path).

15 Limitations of Computer Science In practice, we cannot solve every problem with a program because... 1)The execution time of a program may be too long. 2)The problem may be non-computable. 3)We may not know how to solve the problem. E.g. Computer Vision Artificial Intelligence Modeling complex systems such as weather etc.

16 The Halting Problem One problem that frequently arises when programming is when the program contains a loop that never terminates. These are called infinite loops. It would be a nice compiler feature if the compiler could detect the presence of an infinite loop in a program and inform the programmer that one exists. The Halting Problem: Can we write a program that will read in other programs and output a message saying whether or not the program will halt on all inputs (i.e. it does not have any infinite loops)?

17 Proof by Contradiction The halting problem assertion is as follows: No finite program can be written that will check other programs and halt in a finite time giving a solution to the halting problem. We can prove the halting problem assertion using a technique known as proof by contradiction. The idea is as follows: 1)Assume that a program solving the halting problem exists. 2)Show that this assumption leads to impossible consequences. 3)This implies that the assumption must be false and therefore the program cannot exist.

18 Other non-computable problems Almost every problem related to the behavior of a program is non-computable. For example: 1)Showing that 2 programs are equivalent (for each input you always get the same output) 2) Determining whether a given output will occur 3) Determining the correctness of a program etc.

19 Limitations in integer representation The circuitry of computers leads to limitations in what they can compute. Integer storage limitations: Because we use a limited number of bits to store integers, there is a maximum integer that can be represented: 16 bits: Maximum = 32,767 (if storing both positive and negative integers) 32 bits: Maximum = 2 x 10 9 (approximately) Is this big enough?

20 Limits of Real number representation The format of real numbers leads to limitations because of: 1)Limited precision of the representation. 2)Rounding error 3)Limits in the smallest number that can be represented (underflow) 4)Limits in the largest number that can be represented (overflow).

21 Other hardware limitations 1.Components can fail (disk crash, computer crash, etc). 2.Components can have design flaws so they don't work as they should (Intel pentium chip, 1994) 3.Electronic noise can change 1's to 0's and vice versa when information is sent over wires or cables (or through the air for wireless). There are error checking and error correcting techniques, but these are not 100% accurate.