text
stringlengths
1
7.76k
source
stringlengths
17
81
454 CHAPTER 11. MARKOV CHAINS If we compute the fundamental matrix N, we obtain N = 1 8             14 9 4 3 9 4 3 2 6 14 6 4 4 2 2 2 4 9 14 9 3 2 3 4 2 4 6 14 2 2 4 6 6 4 2 2 14 6 4 2 4 3 2 3 9 14 9 4 2 2 2 4 4 6 14 6 2 3 4 9 3 4 9 14             . The expected time to absorption for different s...
prob_Page_462_Chunk5301
11.5. MEAN FIRST PASSAGE TIME 455 other state sk, the expected number of steps required is mkj plus 1 for the step already taken. Thus, mij = pij + X k̸=j pik(mkj + 1) , or, since P k pik = 1, mij = 1 + X k̸=j pikmkj . (11.2) Similarly, starting in si, it must take at least one step to return. Considering all possible ...
prob_Page_463_Chunk5302
456 CHAPTER 11. MARKOV CHAINS Corollary 11.1 For an ergodic Markov chain, the components of the fixed proba- bility vector w are strictly positive. Proof. We know that the values of ri are finite and so wi = 1/ri cannot be 0. 2 Example 11.25 In Example 11.22 we found the fixed probability vector for the maze example to be...
prob_Page_464_Chunk5303
11.5. MEAN FIRST PASSAGE TIME 457 We now use special properties of P and W to rewrite this series. The special properties are: 1) PW = W, and 2) Wk = W for all positive integers k. These facts are easy to verify, and are left as an exercise (see Exercise 22). Using these facts, we see that (P −W)n = n X i=0 (−1)i n i ...
prob_Page_465_Chunk5304
458 CHAPTER 11. MARKOV CHAINS Therefore, (I −P)x = 0 . But this means that x = Px is a fixed column vector for P. By Theorem 11.10, this can only happen if x is a constant vector. Since wx = 0, and w has strictly positive entries, we see that x = 0. This completes the proof. 2 As in the regular case, we will call the in...
prob_Page_466_Chunk5305
11.5. MEAN FIRST PASSAGE TIME 459 Similarly, since wP = w and wW = w, w = w(I −P + W) . If we multiply both sides of this equation on the right by Z, we obtain wZ = w . Finally, we have (I −P + W)(I −W) = I −W −P + W + W −W = I −P . Multiplying on the left by Z, we obtain I −W = Z(I −P) . This completes the proof. 2 Th...
prob_Page_467_Chunk5306
460 CHAPTER 11. MARKOV CHAINS or (wM)j = zjjrj −1 . (11.9) From Equations 11.8 and 11.9, we have mij = (zjj −zij) · rj . Since rj = 1/wj, mij = zjj −zij wj . 2 Example 11.27 (Example 11.26 continued) In the Land of Oz example, we find that Z = (I −P + W)−1 =   86/75 1/25 −14/75 2/25 21/25 2/25 −14/75 1/25 86/75  . W...
prob_Page_468_Chunk5307
11.5. MEAN FIRST PASSAGE TIME 461 r =
prob_Page_469_Chunk5308
462 CHAPTER 11. MARKOV CHAINS 0 200 400 600 800 1000 40 45 50 55 60 65 0 200 400 600 800 1000 40 45 50 55 60 65 Time forward Time reversed Figure 11.6: Ehrenfest simulation. Consider in particular the central term i = n. We have seen that this term is approximately 1/√πn. Thus we may approximate rn by √πn. This model w...
prob_Page_470_Chunk5309
11.5. MEAN FIRST PASSAGE TIME 463 We note that if we had not started in equilibrium, the two graphs would typically look quite different. 2 Reversibility If the Ehrenfest model is started in equilibrium, then the process has no apparent time direction. The reason for this is that this process has a property called re- v...
prob_Page_471_Chunk5310
464 CHAPTER 11. MARKOV CHAINS the number of times that the chain is in state sj in the first n steps. The jth component wj of the fixed probability row vector w is the proportion of times that the chain is in state sj in the long run. Hence, it is reasonable to conjecture that the expected value of the random variable S(...
prob_Page_472_Chunk5311
11.5. MEAN FIRST PASSAGE TIME 465 science. For him the only real examples of the chains were literary texts, where the two states denoted the vowels and consonants.19 In a paper written in 1913,20 Markov chose a sequence of 20,000 letters from Pushkin’s Eugene Onegin to see if this sequence can be approximately conside...
prob_Page_473_Chunk5312
466 CHAPTER 11. MARKOV CHAINS by P. and T. Ehrenfest in 1907 for diffusion. Poincar´e in 1912 dicussed card shuffling in terms of an ergodic Markov chain defined on a permutation group. Brownian motion, a continuous time version of random walk, was introducted in 1900–1901 by L. Bachelier in his study of the stock market, ...
prob_Page_474_Chunk5313
11.5. MEAN FIRST PASSAGE TIME 467 2 4 3 6 5 1 Figure 11.7: Maze for Exercise 7. 6 For the Land of Oz example (Example 11.1), make rain into an absorbing state and find the fundamental matrix N. Interpret the results obtained from this chain in terms of the original chain. 7 A rat runs through the maze shown in Figure 11...
prob_Page_475_Chunk5314
468 CHAPTER 11. MARKOV CHAINS 11 Calculate the reverse transition matrix for the Land of Oz example (Exam- ple 11.1). Is this chain reversible? 12 Give an example of a three-state ergodic Markov chain that is not reversible. 13 Let P be the transition matrix of an ergodic Markov chain and P∗the reverse transition matri...
prob_Page_476_Chunk5315
11.5. MEAN FIRST PASSAGE TIME 469 - 5 B 20 C - 30 A 15 GO Figure 11.8: Simplified Monopoly. The second expression above shows that the number K is independent of i. The number K is called Kemeny’s constant. A prize was offered to the first person to give an intuitively plausible reason for the above sum to be independent ...
prob_Page_477_Chunk5316
470 CHAPTER 11. MARKOV CHAINS 24 In the course of a walk with Snell along Minnehaha Avenue in Minneapolis in the fall of 1983, Peter Doyle25 suggested the following explanation for the constancy of Kemeny’s constant (see Exercise 19). Choose a target state according to the fixed vector w. Start from state i and wait unt...
prob_Page_478_Chunk5317
Chapter 12 Random Walks 12.1 Random Walks in Euclidean Space In the last several chapters, we have studied sums of random variables with the goal being to describe the distribution and density functions of the sum. In this chapter, we shall look at sums of discrete random variables from a different perspective. We shall...
prob_Page_479_Chunk5318
472 CHAPTER 12. RANDOM WALKS by the distribution of the Xk’s. If m = 2, one can visualize the process as taking place in a city in which the streets form square city blocks. A person starts at one corner (i.e., at an intersection of two streets) and goes in one of the four possible directions according to the distribut...
prob_Page_480_Chunk5319
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 473 5 10 15 20 25 30 35 40 -10 -8 -6 -4 -2 2 4 6 8 10 Figure 12.1: A random walk of length 40. Theorem 12.1 The probability of a return to the origin at time 2m is given by u2m = 2m m  2−2m . The probability of a return to the origin at an odd time is 0. 2 A random walk is said t...
prob_Page_481_Chunk5320
474 CHAPTER 12. RANDOM WALKS The expression in the right-hand side of the above theorem should remind the reader of a sum that appeared in Definition 7.1 of the convolution of two distributions. The convolution of two sequences is defined in a similar manner. The above theorem says that the sequence {u2n} is the convolut...
prob_Page_482_Chunk5321
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 475 Therefore, we have F(x) = U(x) −1 U(x) = (1 −x)−1/2 −1 (1 −x)−1/2 = 1 −(1 −x)1/2 . Although it is possible to compute the value of f2m using the Binomial Theorem, it is easier to note that F ′(x) = U(x)/2, so that the coefficients f2m can be found by integrating the series for U(...
prob_Page_483_Chunk5322
476 CHAPTER 12. RANDOM WALKS In terms of the fn probabilities, we see that w2n = n X i=1 f2i . Thus, w∗= ∞ X i=1 f2i . In the proof of Theorem 12.3, the generating function F(x) = ∞ X m=0 f2mxm was introduced. There it was noted that this series converges for x ∈(−1, 1). In fact, it is possible to show that this series...
prob_Page_484_Chunk5323
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 477 Then, by using Equation 12.2, we see that U (m)(x) = 1 + U (m)(x)F (m)(x) , as before. These functions will always converge in the interval (−1, 1), since all of their coefficients are at most one in magnitude. In fact, since w(m) ∗ = ∞ X n=0 f (m) 2n ≤1 for all m, the series for...
prob_Page_485_Chunk5324
478 CHAPTER 12. RANDOM WALKS In Exercise 12, the reader is asked to show that u(2) 2n = 1 42n 2n n 2 . Using Stirling’s Formula, it is easy to show that (see Exercise 13) 2n n  ∼22n √πn , so u(2) 2n ∼1 πn . From this it follows easily that ∞ X n=0 u(2) 2n diverges, so w(2) ∗ = 1, i.e., in R2, the probability of an ...
prob_Page_486_Chunk5325
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 479 Expected Number of Equalizations We now give another example of the use of generating functions to find a general formula for terms in a sequence, where the sequence is related by recursion relations to other sequences. Exercise 9 gives still another example. Example 12.3 (Expec...
prob_Page_487_Chunk5326
480 CHAPTER 12. RANDOM WALKS definition. This gives the second summand in Equation 12.4. Since k can range from 1 to m, we obtain the recursion g2m = m X k=1  |E2k| + 22kf2kg2m−2k  . (12.5) The second summand in the typical term above should remind the reader of a convolution. In fact, if we multiply the generating fu...
prob_Page_488_Chunk5327
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 481 g2m = u2m+222m+1(m + 1) −22m = 1 2 2m + 2 m + 1  (m + 1) −22m . We recall that the quotient g2m/22m is the expected number of equalizations among all paths of length 2m. Using Exercise 4, it is easy to show that g2m 22m ∼ r 2 π √ 2m . In particular, this means that the averag...
prob_Page_489_Chunk5328
482 CHAPTER 12. RANDOM WALKS (d) Using parts (a) and (b), show that the probability of no equalization in the first 2m outcomes equals the probability of an equalization at time 2m. 3 Using the notation of Example 12.3, show that |E2k| = f2k22m . 4 Using Stirling’s Formula, show that u2m ∼ 1 √πm . 5 A lead change in a r...
prob_Page_490_Chunk5329
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 483 *8 Show that P(S1 ≥0, S2 ≥0, . . . , S2m ≥0) = u2m . Hint: First explain why P(S1 > 0, S2 > 0, . . . , S2m > 0) = 1 2P(S1 ̸= 0, S2 ̸= 0, . . . , S2m ̸= 0) . Then use Exercise 7, together with the observation that if no equalization occurs in the first 2m outcomes, then the path ...
prob_Page_491_Chunk5330
484 CHAPTER 12. RANDOM WALKS and rm = 2sm−1 + 1 222m−1 , if m ≥2. (c) Define the generating functions R(x) = ∞ X k=1 rkxk and S(x) = ∞ X k=1 skxk . Show that S(x) = 2R(x) −1 2  1 1 −4x  + 1 2 √ 1 −4x  and R(x) = 2xS(x) + x  1 1 −4x  . (d) Show that R(x) = x (1 −4x)3/2 , and S(x) = 1 2  1 (1 −4x)3/2  −1 2  1 1 −...
prob_Page_492_Chunk5331
12.1. RANDOM WALKS IN EUCLIDEAN SPACE 485 *10 (from K. Levasseur4) A parent and his child play the following game. A deck of 2n cards, n red and n black, is shuffled. The cards are turned up one at a time. Before each card is turned up, the parent and the child guess whether it will be red or black. Whoever makes more co...
prob_Page_493_Chunk5332
486 CHAPTER 12. RANDOM WALKS where the last sum extends over all non-negative j and k with j +k ≤n. Also show that this last expression may be rewritten as 1 22n 2n n  X j,k  1 3n n! j!k!(n −j −k)! 2 . *12 Prove that if n ≥0, then n X k=0 n k 2 = 2n n  . Hint: Write the sum as n X k=0 n k  n n −k  and expla...
prob_Page_494_Chunk5333
12.2. GAMBLER’S RUIN 487 One can imagine the random walk as representing a sequence of tosses of a weighted coin, with a head appearing with probability p and a tail appearing with probability q. An alternative formulation of this situation is that of a gambler playing a sequence of games against an adversary (sometime...
prob_Page_495_Chunk5334
488 CHAPTER 12. RANDOM WALKS so −1 = M−1 X k=0 q p k (q1 −q0) = (q1 −q0) M−1 X k=0 q p k . If p ̸= q, then the above expression equals (q1 −q0)(q/p)M −1 (q/p) −1 , while if p = q = 1/2, then we obtain the equation −1 = (q1 −q0)M . For the moment we shall assume that p ̸= q. Then we have q1 −q0 = −(q/p) −1 (q/p)M −1...
prob_Page_496_Chunk5335
12.2. GAMBLER’S RUIN 489 continue indefinitely, it is not obvious that pz + qz = 1 for all z. However, one can use the same method as above to show that if p ̸= q, then qz = (q/p)z −1 (q/p)M −1 , and if p = q = 1/2, then qz = z M . Thus, for all z, it is the case that pz + qz = 1, so the game ends with probability 1. In...
prob_Page_497_Chunk5336
490 CHAPTER 12. RANDOM WALKS Using this equation, together with the fact that Pa + Pb = 1 , it can easily be shown that Pa = (q/p)a −1 (q/p)a+b −1 , if p ̸= q, and Pa = a a + b , if p = q = 1/2. In terms of modern probability theory, de Moivre is changing the values of the counters to make an unfair game into a fair ga...
prob_Page_498_Chunk5337
12.2. GAMBLER’S RUIN 491 Using this and the result of Exercise 1, show that the probability that the gambler is ruined on the nth step is pT (n) = ( (−1)k−1 2p
prob_Page_499_Chunk5338
492 CHAPTER 12. RANDOM WALKS 7 In the game in Exercise 6, let p = q = 1/2 and M = 10. What is the probability that the gambler’s stake equals M at least 20 times before it returns to 0? 8 Write a computer program which simulates the game in Exercise 6 for the case p = q = 1/2, and M = 10. 9 In de Moivre’s description o...
prob_Page_500_Chunk5339
12.3. ARC SINE LAWS 493 12.3 Arc Sine Laws In Exercise 12.1.6, the distribution of the time of the last equalization in the sym- metric random walk was determined. If we let α2k,2m denote the probability that a random walk of length 2m has its last equalization at time 2k, then we have α2k,2m = u2ku2m−2k . We shall now...
prob_Page_501_Chunk5340
494 CHAPTER 12. RANDOM WALKS random walk could be viewed as a polygonal line connecting (0, 0) with (m, Sm). Under this interpretation, we define b2k,2m to be the probability that a random walk of length 2m has exactly 2k of its 2m polygonal line segments above the t-axis. The probability b2k,2m is frequently interprete...
prob_Page_502_Chunk5341
12.3. ARC SINE LAWS 495 0 10 20 30 40 0 0.02 0.04 0.06 0.08 0.1 0.12 Figure 12.2: Times in the lead. b2k,2n = 1 2 k X j=1 f2jα2k−2j,2m−2j + 1 2 m−k X j=1 f2jα2k,2m−2j = 1 2 k X j=1 f2ju2k−2ju2m−2k + 1 2 m−k X j=1 f2ju2ku2m−2j−2k = 1 2u2m−2k k X j=1 f2ju2k−2j + 1 2u2k m−k X j=1 f2ju2m−2j−2k = 1 2u2m−2ku2k + 1 2u2ku2m−2k...
prob_Page_503_Chunk5342
496 CHAPTER 12. RANDOM WALKS The next theorem says that the arc sine density is applicable to a wide range of situations. A continuous distribution function F(x) is said to be symmetric if F(x) = 1 −F(−x). (If X is a continuous random variable with a symmetric distribution function, then for any real x, we have P(X ≤x)...
prob_Page_504_Chunk5343
12.3. ARC SINE LAWS 497 (b) Explain the geometric relationship between the graphs of a random walk and its reversal. (It is not in general true that one graph is obtained from the other by reflecting in a vertical line.) (c) Use parts (a) and (b) to prove Theorem 12.5.
prob_Page_505_Chunk5344
498 CHAPTER 12. RANDOM WALKS
prob_Page_506_Chunk5345
Appendices 499
prob_Page_507_Chunk5346
500 APPENDICES NA (0,d) = area of shaded region 0 d .00 .01 .02 .03 .04 .05 .06 .07 .08 .09 0.0 .0000 .0040 .0080 .0120 .0160 .0199 .0239 .0279 .0319 .0359 0.1 .0398 .0438 .0478 .0517 .0557 .0596 .0636 .0675 .0714 .0753 0.2 .0793 .0832 .0871 .0910 .0948 .0987 .1026 .1064 .1103 .1141 0.3 .1179 .1217 .1255 .1293 .1331 .1...
prob_Page_508_Chunk5347
APPENDICES 501 Above . . . . . . . . . . . . . . . . . . . . . . . . 1 3 . . 4 5 . . 72.5 . . . . . . . . . . . . . . 1 2 1 2 7 2 4 19 6 72.2 71.5 . . . . . . . . 1 3 4 3 5 10 4 9 2 2 43 11 69.9 70.5 1 . . 1 . . 1 1 3 12 18 14 7 4 3 3 68 22 69.5 69.5 . . . . 1 16 4 17 27 20 33 25 20 11 4 5 183 41 68.9 68.5 1 . . 7 11 1...
prob_Page_509_Chunk5348
502 APPENDICES Appendix C Life Table Number of survivors at single years of Age, out of 100,000 Born Alive, by Race and Sex: United States, 1990. 0 100000 100000 100000 43 94707 92840 96626 1 99073 98969 99183 44 94453 92505 96455 2 99008 98894 99128 45 94179 92147 96266 3 98959 98840 99085 46 93882 91764 96057 4 98921...
prob_Page_510_Chunk5349
Index π, estimation of, 43–46 n!, 80 absorbing Markov chain, 416 absorbing state, 416 AbsorbingChain (program), 421 absorption probabilities, 420 Ace, Mr., 241 Ali, 178 alleles, 348 AllPermutations (program), 84 ANDERSON, C. L., 157 annuity, 246 life, 247 terminal, 247 arc sine laws, 493 area, estimation of, 42 Areabar...
prob_Page_511_Chunk5350
504 INDEX canonical form of an absorbing Markov chain, 416 car, 137 CARDANO, G., 30–31, 110, 249 cars on a highway, 66 CASANOVA, G., 11 Cauchy density, 218, 400 cells, 347 Central Limit Theorem, 325 for Bernoulli Trials, 330 for Binomial Distributions, 328 for continuous independent trials process, 357 for discrete ind...
prob_Page_512_Chunk5351
INDEX 505 normal, 212 Rayleigh, 215, 295 t-, 360 uniform, 60, 205 derangement, 85 DIACONIS, P., 120, 251 Die (program), 225 DieTest (program), 297 distribution function, 1, 19 properties of, 22 Benford, 195 binomial, 99, 184 geometric, 184 hypergeometric, 193 joint, 142 marginal, 143 negative binomial, 186 Poisson, 187...
prob_Page_513_Chunk5352
506 INDEX for a regular Markov chain, 457 for an ergodic Markov chain, 458 GALAMBOS, J., 303 GALILEO, G., 13 Gallup Poll, 14, 335 Galton board, 99, 351 GALTON, F., 282, 345, 350, 376 GaltonBoard (program), 99 Gambler’s Ruin, 426, 486, 487 gambling systems, 241 gamma density, 207 GARDNER, M., 181 gas diffusion Ehrenfest ...
prob_Page_514_Chunk5353
INDEX 507 KENDALL, D. G., 377 KEYFITZ, N., 382 KILGOUR, D. M., 179, 182 KINGSTON, J. G., 157 KONOLD, C., 161 KOZELKA, R. M., 344 Labouchere betting system, 12, 13 LABOUCHERE, H. du P., 12 LAMPERTI, J., 267, 324 LAPLACE, P. S., 51, 53, 350 last return to the origin, 482 Law (program), 310 Law of Averages, 70 Law of Larg...
prob_Page_515_Chunk5354
508 INDEX New-Age Solitaire, 130 NEWCOMB, S., 196 NFoldConvolution (program), 287 NIGRINI, M., 196 normal density, 47, 212 NormalArea (program), 322 nursery rhyme, 84 odds, 27 ordering, random, 127 ordinary generating function, 369 ORE, O., 30, 31 outcome, 18 Oz, Land of, 406, 439 P´OLYA, G., 15, 17, 475 Pascal’s trian...
prob_Page_516_Chunk5355
INDEX 509 Rayleigh density, 215, 295 records, 83, 234 Records (program), 84 regression on the mean, 282 regression to the mean, 345, 352 regular Markov chain, 433 reliability of a system, 154 restricted choice, principle of, 182 return to the origin, 472 first, 473 last, 482 probability of eventual, 475 reversibility, 4...
prob_Page_517_Chunk5356
510 INDEX time to absorption, 419 TIPPETT, L. H. C., 10 traits, independence of, 216 transient state, 416 transition matrix, 406 transition probability, 406 tree diagram, 24, 76 infinite binary, 69 Treize, 85 triangle acute, 73 triangular numbers, 108 trout, 198 true-false exam, 267 Tunbridge, 154 TVERSKY, A., 14, 38 Tw...
prob_Page_518_Chunk5357
1.7 Real Stuff: Manufacturing and Benchmarking the AMD Opteron X4 44 1.8 Fallacies and Pitfalls 51 1.9 Concluding Remarks 54 1.10 Historical Perspective and Further Reading 55 1.11 Exercises 56 1.1 Introduction Welcome to this book! We’re delighted to have this opportunity to convey the excitement of the world of comp...
clipped_hennesy_Page_1_Chunk5358
4 Chapter 1 Computer Abstractions and Technology Computers have led to a third revolution for civilization, with the information revolution taking its place alongside the agricultural and the industrial revolu­ tions. The resulting multiplication of humankind’s intellectual strength and reach naturally has affected our...
clipped_hennesy_Page_2_Chunk5359
1.1 Introduction 5 Classes of Computing Applications and Their Characteristics Although a common set of hardware technologies (see Sections 1.3 and 1.7) is used in computers ranging from smart home appliances to cell phones to the larg­est supercomputers, these different applications have different design require­ments...
clipped_hennesy_Page_3_Chunk5360
6 Chapter 1 Computer Abstractions and Technology ­microprocessors found in your car, the computers in a cell phone, the computers in a video game or television, and the networks of processors that control a mod­ ern airplane or cargo ship. Embedded computing systems are designed to run one application or one set of rel...
clipped_hennesy_Page_4_Chunk5361
1.1 Introduction 7 Embedded applications often have unique application requirements that ­combine a minimum performance with stringent limitations on cost or power. For example, consider a music player: the processor need only be as fast as necessary to handle its limited function, and beyond that, minimizing cost and ...
clipped_hennesy_Page_5_Chunk5362
8 Chapter 1 Computer Abstractions and Technology ■ ■How are programs written in a high-level language, such as C or Java, trans­ lated into the language of the hardware, and how does the hardware execute the resulting program? Comprehending these concepts forms the basis of understanding the aspects of both the hardwar...
clipped_hennesy_Page_6_Chunk5363
1.1 Introduction 9 To reinforce how the software and hardware systems used to run a program will affect performance, we use a special section, Understanding Program Perfor­mance, throughout the book to summarize important insights into program performance. The first one appears below. The performance of a program depen...
clipped_hennesy_Page_7_Chunk5364
10 Chapter 1 Computer Abstractions and Technology 1.2 Below Your Program A typical application, such as a word processor or a large database system, may consist of millions of lines of code and rely on sophisticated software libraries that implement complex functions in support of the application. As we will see, the h...
clipped_hennesy_Page_8_Chunk5365
Compilers perform another vital function: the translation of a program written in a high-level language, such as C, C++, Java, or Visual Basic into instructions that the hardware can execute. Given the sophistication of modern programming lan­guages and the simplicity of the instructions executed by the hardware, the t...
clipped_hennesy_Page_9_Chunk5366
12 Chapter 1 Computer Abstractions and Technology to write one line for every instruction that the computer will follow, forcing the programmer to think like the computer. The recognition that a program could be written to translate a more powerful language into computer instructions was one of the great breakthroughs ...
clipped_hennesy_Page_10_Chunk5367
A compiler enables a programmer to write this high-level language expression: A + B The compiler would compile it into this assembly language statement: add A,B As shown above, the assembler would translate this statement into the binary instructions that tell the computer to add the two numbers A and B. High-level pro...
clipped_hennesy_Page_11_Chunk5368
14 Chapter 1 Computer Abstractions and Technology the five components of a computer that perform the tasks of inputting, out­putting, processing, and storing data. The five classic components of a computer are input, output, memory, datapath, and control, with the last two sometimes combined and called the processor. F...
clipped_hennesy_Page_12_Chunk5369
Figure 1.5 shows a computer with keyboard, wireless mouse, and screen. This photograph reveals two of the key components of computers: input devices, such as the keyboard and mouse, and output devices, such as the screen. As the names suggest, input feeds the computer, and output is the result of computation sent to th...
clipped_hennesy_Page_13_Chunk5370
16 Chapter 1 Computer Abstractions and Technology Anatomy of a Mouse Although many users now take mice for granted, the idea of a pointing device such as a mouse was first shown by Doug Engelbart using a research prototype in 1967. The Alto, which was the inspiration for all workstations as well as for the Macintosh an...
clipped_hennesy_Page_14_Chunk5371
The computer hardware support for graphics consists mainly of a raster refresh buffer, or frame buffer, to store the bit map. The im­age to be represented onscreen is stored in the frame buffer, and the bit pattern per pixel is read out to the graph­ics display at the refresh rate. Figure 1.6 shows a frame buffer with ...
clipped_hennesy_Page_15_Chunk5372
18 Chapter 1 Computer Abstractions and Technology FIGURE 1.7 Inside the laptop computer of Figure 1.5. The shiny box with the white label on the lower left is a 100 GB SATA hard disk drive, and the shiny metal box on the lower right side is the DVD drive. The hole between them is where the laptop battery would be locat...
clipped_hennesy_Page_16_Chunk5373
stands for dynamic random access memory. Several DRAMs are used together to contain the instructions and data of a program. In contrast to sequential access memories, such as magnetic tapes, the RAM portion of the term DRAM means that memory accesses take basically the same amount of time no matter what portion of the ...
clipped_hennesy_Page_17_Chunk5374
20 Chapter 1 Computer Abstractions and Technology Descending into the depths of any component of the hardware reveals insights into the computer. Inside the processor is another type of memory—cache mem­ ory. Cache memory consists of a small, fast memory that acts as a buffer for the DRAM memory. (The nontechnical defi...
clipped_hennesy_Page_18_Chunk5375
name: the instruction set architecture, or simply architecture, of a ­computer. The instruction set architecture includes anything programmers need to know to make a binary machine language program work correctly, including ­ins­tructions, I/O devices, and so on. Typically, the operating system will encapsulate the det...
clipped_hennesy_Page_19_Chunk5376
22 Chapter 1 Computer Abstractions and Technology former, and secondary memory for the latter. DRAMs have dominated main memory since 1975, but magnetic disks have dominated secondary memory since 1965. The primary nonvolatile storage used in all server computers and workstations is the magnetic hard disk. Flash memory...
clipped_hennesy_Page_20_Chunk5377
Diameters of hard disks vary by more than a factor of 3 today, from 1 inch to 3.5 inches, and have been shrunk over the years to fit into new products; ­work­station servers, personal computers, laptops, palmtops, and digital cameras have all inspired new disk form factors. Traditionally, the widest disks have the high...
clipped_hennesy_Page_21_Chunk5378
24 Chapter 1 Computer Abstractions and Technology Optical disk technology works differently than magnetic disk technology. In a CD, data is recorded in a spiral fashion, with individual bits being recorded by burning small pits—approximately 1 micron (10−6 meters) in diameter—into the disk surface. The disk is read by ...
clipped_hennesy_Page_22_Chunk5379
speed make Ethernet useful to connect computers on the same floor of a building; hence, it is an example of what is generically called a local area network. Local area networks are interconnected with switches that can also provide routing ser­vices and security. Wide area networks cross continents and are the backbone...
clipped_hennesy_Page_23_Chunk5380
26 Chapter 1 Computer Abstractions and Technology used over time, with an estimate of the relative ­performance per unit cost for each technology. Section 1.7 explores the technology that has fueled the com­puter industry since 1975 and will continue to do so for the foreseeable future. Since this technology shapes wha...
clipped_hennesy_Page_24_Chunk5381
purchasers and therefore to designers. The people selling computers know this as well. Often, salespeople would like you to see their computer in the best possible light, whether or not this light accurately reflects the needs of the purchaser’s application. Hence, understanding how best to measure performance and the ...
clipped_hennesy_Page_25_Chunk5382
28 Chapter 1 Computer Abstractions and Technology were interested in transporting 450 passengers from one point to another, ­however, the 747 would clearly be the fastest, as the last column of the figure shows. Similarly, we can define computer performance in several different ways. If you were running a program on tw...
clipped_hennesy_Page_26_Chunk5383
In discussing the performance of computers, we will be primarily concerned with response time for the first few chapters. To maximize performance, we want to minimize response time or execution time for some task. Thus, we can relate performance and execution time for a computer X: PerformanceX = ​ 1 ______________ Exe...
clipped_hennesy_Page_27_Chunk5384
30 Chapter 1 Computer Abstractions and Technology Thus the performance ratio is ​ 15 ___ 10 ​ = 1.5 and A is therefore 1.5 times faster than B. In the above example, we could also say that computer B is 1.5 times slower than computer A, since ​ PerformanceA  PerformanceB ​ = 1.5 means that ​ PerformanceA  1.5 ​ = P...
clipped_hennesy_Page_28_Chunk5385
do accurately, because it is often hard to assign responsibility for operating sys­tem activities to one user program rather than another and because of the func­tionality differences among operating systems. For consistency, we maintain a distinction between perfor­mance based on elapsed time and that based on CPU exe...
clipped_hennesy_Page_29_Chunk5386
32 Chapter 1 Computer Abstractions and Technology b. The networking software is improved, thereby reducing the network communication delay, but not increasing throughput. c. More memory is added to the computer. 2. Computer C’s performance is 4 times faster than the performance of com­ puter B, which runs a given appli...
clipped_hennesy_Page_30_Chunk5387
Let’s first find the number of clock cycles required for the program on A: CPU timeA = ​ CPU clock cyclesA _________________ Clock rateA ​ 10 seconds = ​ CPU clock cyclesA  2 × 109 ​ cycles  second ​ ​ CPU clock cyclesA = 10 seconds × 2 × 109 ​ cycles _______ second ​ = 20 × 109 cycles CPU time for B can be found us...
clipped_hennesy_Page_31_Chunk5388
34 Chapter 1 Computer Abstractions and Technology instructions may take different amounts of time depending on what they do, CPI is an average of all the instructions executed in the program. CPI provides one way of comparing two different implementations of the same instruction set architecture, since the number of in...
clipped_hennesy_Page_32_Chunk5389
The Classic CPU Performance Equation We can now write this basic performance equation in terms of instruction count (the number of instructions executed by the program), CPI, and clock ­cycle time: CPU time = Instruction count × CPI × Clock cycle time or, since the clock rate is the inverse of clock cycle time: CPU tim...
clipped_hennesy_Page_33_Chunk5390
36 Chapter 1 Computer Abstractions and Technology Sequence 1 executes 2 + 1 + 2 = 5 instructions. Sequence 2 executes 4 + 1 + 1 = 6 instructions. Therefore, sequence 1 executes fewer instructions. We can use the equation for CPU clock cycles based on instruction count and CPI to find the total number of clock cycles fo...
clipped_hennesy_Page_34_Chunk5391
How can we determine the value of these factors in the performance equation? We can measure the CPU execution time by running the program, and the clock cycle time is usually published as part of the documentation for a computer. The instruction count and CPI can be more difficult to obtain. Of course, if we know the c...
clipped_hennesy_Page_35_Chunk5392
38 Chapter 1 Computer Abstractions and Technology The performance of a program depends on the algorithm, the language, the compiler, the architecture, and the actual hardware. The following table summarizes how these components affect the factors in the CPU performance equation. Understanding Program Performance Hardwa...
clipped_hennesy_Page_36_Chunk5393
1.5 The Power Wall Figure 1.15 shows the increase in clock rate and power of eight generations of Intel microprocessors over 25 years. Both clock rate and power increased rapidly for decades, and then flattened off recently. The reason they grew together is that they are correlated, and the reason for their recent slow...
clipped_hennesy_Page_37_Chunk5394
40 Chapter 1 Computer Abstractions and Technology Frequency switched is a function of the clock rate. The capacitive load per tran­sistor is a function of both the number of transistors connected to an output (called the fanout) and the technology, which determines the capacitance of both wires and transistors. How cou...
clipped_hennesy_Page_38_Chunk5395
1.6 The Sea Change: The Switch from Uniprocessors to Multiprocessors The power limit has forced a dramatic change in the design of microprocessors. Figure 1.16 shows the improvement in response time of programs for desktop microprocessors over time. Since 2002, the rate has slowed from a factor of 1.5 per year to less...
clipped_hennesy_Page_39_Chunk5396
42 Chapter 1 Computer Abstractions and Technology Why has it been so hard for programmers to write explicitly parallel programs? The first reason is that parallel programming is by definition performance pro­ gramming, which increases the difficulty of programming. Not only does the pro­gram need to be correct, solve a...
clipped_hennesy_Page_40_Chunk5397
do at the same time, and that the overhead of scheduling and coordi­nation doesn’t fritter away the potential performance benefits of parallelism. As an analogy, suppose the task was to write a newspaper story. Eight reporters working on the same story could potentially write a story eight times faster. To achieve this...
clipped_hennesy_Page_41_Chunk5398
44 Chapter 1 Computer Abstractions and Technology ■ ■Chapter 5, Section 5.8: Parallelism and Memory Hierarchies: Cache Coherence. One way to lower the cost of communication is to have all processors use the same address space, so that any processor can read or write any data. Given that all processors today use caches ...
clipped_hennesy_Page_42_Chunk5399
Let’s start at the beginning. The manufacture of a chip begins with silicon, a substance found in sand. Because silicon does not conduct electricity well, it is called a semiconductor. With a special chemical process, it is possible to add ­materials to silicon that allow tiny areas to transform into one of three devic...
clipped_hennesy_Page_43_Chunk5400