Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter VI What should I know about the sizes and speeds of computers?

Similar presentations


Presentation on theme: "Chapter VI What should I know about the sizes and speeds of computers?"— Presentation transcript:

1 Chapter VI What should I know about the sizes and speeds of computers?

2 How important is the material in this chapter to understanding how a computer works Maybe 5 on a scale of 1-10

3 How Important is this material to understanding how to use a computer? On a scale of 1 – 10, maybe 4

4 True/False Quiz The size of Computer Chips has doubled about every 18 months since 1965 The size of disk memory has grown at a rate of about 50% every year or so since 1982. The capacities of CPUs within a computer have a long record of doubling about every 18 months. All of these statements are TRUE

5 True/False Quiz With the capabilities of computers increasing as indicated by the previous questions, and prices continuing to decrease, it should soon be true that computers can solve almost any reasonable problem. This statement is FALSE. Examining this seeming contradiction is the subject of this chapter

6 How Fast Does Technology Really Evolve? Moore’s Law: A new generation of processors is developed about every three years. Typically the number of transistors in such a processor quadruples. Moore’s Law is an observation made by Gordon Moore, co-founder of Intel in 1965, but it has held true for the past 40 years.

7 Paul’s fable Discuss

8 How long does it take to search through a list of items to find a particular one? It depends on how fast the computer is. It depends on how many items are on the list. It depends on what method is used to search the list.

9 Searching (continued) Let’s ignore the speed of the computer because if you get a computer that’s twice as fast as your old computer then it should be able to solve the problem twice as fast. Clearly the more items that are on the list, the longer it will take to search it. But … how much longer?

10 Searching (continued) One way to find an item in a list is to start at the beginning and look through the list until you find what you’re looking for OR you run out of items to look through and you conclude that what you wanted is not there. This method is called a linear search. If you double the number of items to search then you double the time (on average) that it takes to search.

11 Searching (continued) But if the list of items is in order, you can improve the search using a method called the binary search. Look at the middle of the list. If the item is after this item, then you can throw away the first half and only search the second half. If the item is before this item, then you can throw away the last half.

12 Searching (Continued) If the item is the one you’re looking for, then you have found it. BUT, to summarize, each time you look at an item, you throw away half the list, so doubling the size of the list to be searched only adds one more item. This type of search is called logarithmic.

13 How Does Paul’s Fable Relate To Computers? An algorithm is a finite set of unambiguous steps that solves a problem. Some algorithms are very complex. Both of the searching algorithms were simple, one of complexity n (linear) and one of complexity log n (logarithmic)

14 Traveling salesman problem A salesman has to call on some clients in different cities and would like to arrange the order that he calls on his clients in order to optimize his travel (for example, he might want to make the mileage as small as possible or the air fare as cheap as possible or the time as small as possible).

15 Traveling Salesman (cont) One algorithm that can be used to solve the problem is exhaustive search. That is list all the possible solutions and then compute which one is best. If there are 3 clients then there are only 6 possible choices: HABCH, HACBH, HBACH, HBCAH, HCABH, HCBAH, where H represents home and A, B, and C represent each of the clients.

16 Traveling Salesman (cont) For 3 clients, the number is 3! (3*2*1) For 5 clients, the number is 5! (5*4*3*2*1) For 10 clients, the number is 10! So one way to solve the problem is to get the computer to list all the possibilities and compute the distance for each possibility and then pick the smallest one

17 Traveling Salesman (cont) 3! = 6 5!= 120 10! = 3,628,800 15! = 1,307,674,368,000 20! = 2,432,902,008,176,640,000

18 Traveling Salesman (cont) If the computer could compute one billion routes per second (which is faster thanany current computer by a substantial amount) then – 3 clients = much less than 1 second – 5 clients = much less than 1 second – 10 clients = much less than 1 second – 15 clients = 21 minutes 48 seconds – 20 clients = approximately 77 years

19 Traveling Salesman (cont) The exhaustive search method for solving this problem doesn’t scale. It’s easy for a small amount of data but intractable for larger numbers. The complexity of this algorithm is n! (n factorial)

20 Chess Playing Computers typically play chess in the following way: – They use an opening book (a list of moves that have been used successfully in the past). These books typically have thousands of games listed. – When the opponent makes a move that is not in the book then the computer analyzes the game, basically evaluating every possible response to the opponent’s move. It then analyzes every response to it’s move that the opponent might make, and analyzes every response to that move that it may make. – When a player moves a piece that is referred to as a ply

21 Chess Playing (continued) So if a chess playing program is set to evaluate to a depth of 4 plies then it will evaluate – it’s move, – the opponent’s response, – it’s response to the response, – the opponents response to the response to the opponents move to its move. Then which ever move is seen as best is the move the machine will take.

22 Chess Playing (continued) At each moment there are about 20 or so moves that could come into consideration. Thus for a depth of 4 plies the number of possible move sequences is 20 4. This is an example of exponential growth in an algorithm.

23 When Do Solutions Scale Up? Problems scale up when their level of complexity is polynomially related (such as linear (n), quadratic (n 2 ) or higher power. Problems don’t scale up when their complexity is exponential (2 n ), factorial (n!) or “worse”

24 Class P The set of all algorithms whose complexity is a polynomial Neither the Traveling Salesman problem nor the Chess playing problem are in this class.

25 Class NP Suppose we tried to solve the problem using several computers simultaneously (and having them communicate with each other to report the progress of their work). If an algorithm could be solved in polynomial time under this consideration, it is said to be in class NP. The Traveling Salesman Problem is in this class.

26 What Are Some Difficulties Logical Complexity Causes in Computers? Single user computers will not need as much security since only one person will be using them. If the user will only be performing one task at a time (single-tasking) the O/S can be much simpler since scheduling will not be a part of the problem.

27 When Does the Cost of More Outweigh the Benefits? More features in software Higher speed in hardware Higher graphics capabilities Greater Accuracy

28 More Features in Software Extra features add complexity to the software. – Consider the case of a Web address, http://www.cs.scranton.edu http://www.cs.scranton.edu Sometimes fixing errors may lead to other errors in the software.

29 Higher Speed in Hardware Speed must be co-ordinated – a faster processor may not help unless other components are also faster. Often speeding up the machine does not speed up the work being done, for example Web browsing or word processing.

30 Higher Graphics Capabilities Higher Graphics capabilities in general increases the quality of images BUT It also increase the space needed to store the images, and the time needed to move the images, and the time needed to manipulate the images.

31 Greater Accuracy Increasing accuracy necessitates storing numbers in more complex forms This requires, in general, more space, and therefore more time for the computations. Some computations need high accuracy, others do not. Some computations require numbers that are measured and they may be limited in precision.

32 Summary Computers are increasing in speed. Due to the laws of physics there is a limit to how much more the increase can be. Some solutions to problems are so complex that increase in computer speeds will not be enough to realistically solve these problems. Increasing the capabilities of computers, in general requires them to become more complex and thus more prone to errors.

33 Terminology Class P Class NP Combinatorial Explosion Computational Complexity Exhaustive Listing Exhaustive Search Linear Search Logical Complexity Moore’s Law Ply


Download ppt "Chapter VI What should I know about the sizes and speeds of computers?"

Similar presentations


Ads by Google