Tue Jan 2 18:59:27 2024 digital_dice_test(): Python version: 3.8.10 Test digital_dice(). aandb(): In game A, you flip a biased coin, which shows heads with probabiity] 1/2 - epsilon you win a dollar on heads. In game B, you have two biased coins. If, at the time just before you decide to flip, your capital M is a multiple of 3 dollars, you chose coin 1, which shows heads with probability 1/10 - epsilon, otherwise you choose coin 2, which shows heads with probability 3/4 - epsilon. Both games A and B are losing games for you. But, paradoxically, if you randomly switch back and forth between one game and the other, you end up winning over the long term. Use graphics to display the winnings. Graphics saved as "aandb.png" average(): Use a Monte Carlo sample to estimate pi. Estimate for pi = 3.0485952185575957 Error = 0.09299743503219737 Antithetic estimate for pi = 3.123841584466019 Error = 0.017751069123774332 average(): Use a Monte Carlo sample to estimate pi. Estimate for pi = 3.134906464007741 Error = 0.006686189582052027 Antithetic estimate for pi = 3.1376185500186518 Error = 0.003974103571141363 average(): Use a Monte Carlo sample to estimate pi. Estimate for pi = 3.1408661213914844 Error = 0.0007265321983087603 Antithetic estimate for pi = 3.1413038725763682 Error = 0.00028878101342488804 baby_boom(): There are given probabilities of a man having 0, 1, 2, 3, 4, 5, 6 or 7 sons. What are the chances of having: 2 sons in the second generation? 4 sons in the second generation? 6 sons in the third generation? Estimated probabilities: 2 males in generation 2 = 0.0693 4 males in generation 2 = 0.0372 6 males in generation 3 = 0.0229 baby_boom(): There are given probabilities of a man having 0, 1, 2, 3, 4, 5, 6 or 7 sons. What are the chances of having: 2 sons in the second generation? 4 sons in the second generation? 6 sons in the third generation? Estimated probabilities: 2 males in generation 2 = 0.06813 4 males in generation 2 = 0.03994 6 males in generation 3 = 0.02123 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.5 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 1.33573 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.5 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 2.0046 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.5 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 4.57919 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.5 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 5.14959 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.5 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 18.66493 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.4 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 1.3851 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.4 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 2.0869 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.4 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 4.76878 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.4 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 5.37595 broke(): Three players begin with L, M and N dollars. On each turn, each player flips a coin. All coins have the same bias P = 0.4 If one player is "odd man out", he pays a dollar to each other player. When a player is bankrupt, the game is over. What is the average number of turns required? Average number of turns = 19.50803 bus(): A bus stop is serviced by 1 bus linesp. In any hour, each bus line will come to the stop at a random time. A passenger arrives at the bus stop at a random time. What is the average wait for a bus? Estimated waiting time = 0.4994313299687374 Theoretical time = 0.5 bus(): A bus stop is serviced by 2 bus linesp. In any hour, each bus line will come to the stop at a random time. A passenger arrives at the bus stop at a random time. What is the average wait for a bus? Estimated waiting time = 0.33328128353115377 Theoretical time = 0.3333333333333333 bus(): A bus stop is serviced by 3 bus linesp. In any hour, each bus line will come to the stop at a random time. A passenger arrives at the bus stop at a random time. What is the average wait for a bus? Estimated waiting time = 0.25034536880406383 Theoretical time = 0.25 bus(): A bus stop is serviced by 4 bus linesp. In any hour, each bus line will come to the stop at a random time. A passenger arrives at the bus stop at a random time. What is the average wait for a bus? Estimated waiting time = 0.20018058867062993 Theoretical time = 0.2 bus(): A bus stop is serviced by 5 bus linesp. In any hour, each bus line will come to the stop at a random time. A passenger arrives at the bus stop at a random time. What is the average wait for a bus? Estimated waiting time = 0.16662432019547682 Theoretical time = 0.16666666666666666 car(): Park 3 cars in a line, and compute each car's nearest neighbor Estimate the probability that a given car is the nearest neighbor of its nearest neighbor. Estimated probability = 0.6666666666666666 Theoretical probability = 0.6666666666666666 car(): Park 10 cars in a line, and compute each car's nearest neighbor Estimate the probability that a given car is the nearest neighbor of its nearest neighbor. Estimated probability = 0.6666536 Theoretical probability = 0.6666666666666666 car(): Park 20 cars in a line, and compute each car's nearest neighbor Estimate the probability that a given car is the nearest neighbor of its nearest neighbor. Estimated probability = 0.6666167 Theoretical probability = 0.6666666666666666 car(): Park 30 cars in a line, and compute each car's nearest neighbor Estimate the probability that a given car is the nearest neighbor of its nearest neighbor. Estimated probability = 0.6666212666666668 Theoretical probability = 0.6666666666666666 chess(): A has to play three games of chess against B and C. A beats B with probability P, C with probability Q A has a choice of schedules: BCB or CBC. To win the tournament, A must win two successive games. Which schedule is better? Estimated win probability for BCB is = 0.792134 Estimated win probability for CBC is = 0.8639 chess(): A has to play three games of chess against B and C. A beats B with probability P, C with probability Q A has a choice of schedules: BCB or CBC. To win the tournament, A must win two successive games. Which schedule is better? Estimated win probability for BCB is = 0.396144 Estimated win probability for CBC is = 0.576339 chess(): A has to play three games of chess against B and C. A beats B with probability P, C with probability Q A has a choice of schedules: BCB or CBC. To win the tournament, A must win two successive games. Which schedule is better? Estimated win probability for BCB is = 0.191699 Estimated win probability for CBC is = 0.203885 chess(): A has to play three games of chess against B and C. A beats B with probability P, C with probability Q A has a choice of schedules: BCB or CBC. To win the tournament, A must win two successive games. Which schedule is better? Estimated win probability for BCB is = 0.063869 Estimated win probability for CBC is = 0.075976 committee(): From a faculty of 6 professors, 6 associate professors, 10 assistant professors, and 12 instructors, a committee of size 6 is formed randomly. What is the probablity that there is at least one person of each rank in the committee? Estimated probability = 0.37818 Theoretical probablity = 0.3790307709695264 deli(): A deli is open for 36,000 seconds. There are 1 or 2 clerks. Customers arrive at random. The amount of time it takes to service a customer is random. Customers are served in order. A clerk serves one customer at a time. Newly arrived customers wait in a queue if no clerk is available. What is the average and maximal times spent per customer? What is the average and maximal queue length? What percentage of time are the clerks idle? clock = 107 queue_length = 1 clock = 121 queue_length = 2 clock = 299 queue_length = 2 clock = 666 queue_length = 1 clock = 1107 queue_length = 1 clock = 1159 queue_length = 1 clock = 1189 queue_length = 2 clock = 2255 queue_length = 1 clock = 2595 queue_length = 2 clock = 2654 queue_length = 2 clock = 3326 queue_length = 1 clock = 3331 queue_length = 2 clock = 3375 queue_length = 3 clock = 3382 queue_length = 4 clock = 3493 queue_length = 5 clock = 3684 queue_length = 5 clock = 3734 queue_length = 4 clock = 3932 queue_length = 4 clock = 4001 queue_length = 2 clock = 4026 queue_length = 3 clock = 4100 queue_length = 4 clock = 4316 queue_length = 1 clock = 4397 queue_length = 2 clock = 4489 queue_length = 1 clock = 4564 queue_length = 2 clock = 4587 queue_length = 3 clock = 4631 queue_length = 4 clock = 4765 queue_length = 4 clock = 4782 queue_length = 5 clock = 4846 queue_length = 6 clock = 4920 queue_length = 6 clock = 4989 queue_length = 7 clock = 5150 queue_length = 6 clock = 5358 queue_length = 2 clock = 6072 queue_length = 1 clock = 6392 queue_length = 1 clock = 7490 queue_length = 1 clock = 7518 queue_length = 1 clock = 7648 queue_length = 1 clock = 7894 queue_length = 1 clock = 7953 queue_length = 1 clock = 8513 queue_length = 1 clock = 9121 queue_length = 1 clock = 9196 queue_length = 2 clock = 9331 queue_length = 2 clock = 9497 queue_length = 1 clock = 10357 queue_length = 1 clock = 10412 queue_length = 1 clock = 10479 queue_length = 2 clock = 10514 queue_length = 3 clock = 10606 queue_length = 2 clock = 11021 queue_length = 1 clock = 11057 queue_length = 2 clock = 11128 queue_length = 3 clock = 11153 queue_length = 4 clock = 11279 queue_length = 5 clock = 11390 queue_length = 6 clock = 11717 queue_length = 3 clock = 11760 queue_length = 4 clock = 11790 queue_length = 5 clock = 11818 queue_length = 6 clock = 11842 queue_length = 6 clock = 11853 queue_length = 7 clock = 12013 queue_length = 8 clock = 12017 queue_length = 9 clock = 12192 queue_length = 9 clock = 12343 queue_length = 10 clock = 12477 queue_length = 10 clock = 12517 queue_length = 11 clock = 12580 queue_length = 9 clock = 12674 queue_length = 10 clock = 12706 queue_length = 11 clock = 12714 queue_length = 12 clock = 12846 queue_length = 11 clock = 13072 queue_length = 12 clock = 13137 queue_length = 12 clock = 13146 queue_length = 13 clock = 13520 queue_length = 9 clock = 13798 queue_length = 8 clock = 13986 queue_length = 4 clock = 15044 queue_length = 1 clock = 15567 queue_length = 1 clock = 16054 queue_length = 1 clock = 16074 queue_length = 2 clock = 16247 queue_length = 1 clock = 16291 queue_length = 2 clock = 16353 queue_length = 2 clock = 16365 queue_length = 3 clock = 16387 queue_length = 4 clock = 16569 queue_length = 2 clock = 16589 queue_length = 3 clock = 16812 queue_length = 1 clock = 16895 queue_length = 1 clock = 16906 queue_length = 2 clock = 17523 queue_length = 1 clock = 17558 queue_length = 1 clock = 17614 queue_length = 2 clock = 17635 queue_length = 3 clock = 17694 queue_length = 4 clock = 17706 queue_length = 5 clock = 17736 queue_length = 6 clock = 17817 queue_length = 5 clock = 17838 queue_length = 6 clock = 17946 queue_length = 5 clock = 17982 queue_length = 5 clock = 18074 queue_length = 6 clock = 18191 queue_length = 6 clock = 18760 queue_length = 2 clock = 19371 queue_length = 1 clock = 19391 queue_length = 2 clock = 19483 queue_length = 1 clock = 20051 queue_length = 1 clock = 20448 queue_length = 1 clock = 20476 queue_length = 2 clock = 20659 queue_length = 3 clock = 21138 queue_length = 1 clock = 22329 queue_length = 1 clock = 22361 queue_length = 1 clock = 22505 queue_length = 1 clock = 22527 queue_length = 2 clock = 22909 queue_length = 1 clock = 23202 queue_length = 1 clock = 23260 queue_length = 1 clock = 23382 queue_length = 1 clock = 23442 queue_length = 1 clock = 23543 queue_length = 1 clock = 23672 queue_length = 1 clock = 23783 queue_length = 2 clock = 23789 queue_length = 2 clock = 24267 queue_length = 1 clock = 24321 queue_length = 2 clock = 24917 queue_length = 1 clock = 25127 queue_length = 1 clock = 25320 queue_length = 2 clock = 25365 queue_length = 3 clock = 25492 queue_length = 2 clock = 25919 queue_length = 1 clock = 26202 queue_length = 1 clock = 26221 queue_length = 2 clock = 26281 queue_length = 2 clock = 26292 queue_length = 3 clock = 26324 queue_length = 4 clock = 26702 queue_length = 2 clock = 26776 queue_length = 3 clock = 26793 queue_length = 4 clock = 26989 queue_length = 4 clock = 27227 queue_length = 3 clock = 27309 queue_length = 4 clock = 27439 queue_length = 5 clock = 27448 queue_length = 6 clock = 27646 queue_length = 3 clock = 27804 queue_length = 3 clock = 28324 queue_length = 1 clock = 28371 queue_length = 2 clock = 28429 queue_length = 3 clock = 28435 queue_length = 4 clock = 28544 queue_length = 5 clock = 28592 queue_length = 5 clock = 28624 queue_length = 6 clock = 28867 queue_length = 6 clock = 28970 queue_length = 4 clock = 28991 queue_length = 5 clock = 29210 queue_length = 5 clock = 29472 queue_length = 3 clock = 29687 queue_length = 2 clock = 29751 queue_length = 2 clock = 30133 queue_length = 1 clock = 30141 queue_length = 1 clock = 30186 queue_length = 1 clock = 30382 queue_length = 1 clock = 30430 queue_length = 1 clock = 31714 queue_length = 1 clock = 31748 queue_length = 2 clock = 31847 queue_length = 3 clock = 32087 queue_length = 1 clock = 32744 queue_length = 1 clock = 32802 queue_length = 1 clock = 32898 queue_length = 2 clock = 32943 queue_length = 3 clock = 33054 queue_length = 3 clock = 33180 queue_length = 2 clock = 33247 queue_length = 1 clock = 33294 queue_length = 1 clock = 33317 queue_length = 2 clock = 33425 queue_length = 3 clock = 33434 queue_length = 4 clock = 33683 queue_length = 2 clock = 34530 queue_length = 1 clock = 34634 queue_length = 1 clock = 34753 queue_length = 2 clock = 34924 queue_length = 1 clock = 35076 queue_length = 1 clock = 35081 queue_length = 2 clock = 35546 queue_length = 1 clock = 35634 queue_length = 1 clock = 35733 queue_length = 1 clock = 35846 queue_length = 2 clock = 35904 queue_length = 3 clock = 35905 queue_length = 4 Average total time at deli 296.10752688172045 Maximum time at deli 1281.0 Average queue length 1.6166666666666667 Maximum queue length 13 Percent idle time clerk1 30.427777777777777 Percent idle time clerk2 0.0 deli(): A deli is open for 36,000 seconds. There are 1 or 2 clerks. Customers arrive at random. The amount of time it takes to service a customer is random. Customers are served in order. A clerk serves one customer at a time. Newly arrived customers wait in a queue if no clerk is available. What is the average and maximal times spent per customer? What is the average and maximal queue length? What percentage of time are the clerks idle? clock = 72 queue_length = 1 clock = 3900 queue_length = 1 clock = 7130 queue_length = 1 clock = 7210 queue_length = 2 clock = 7219 queue_length = 3 clock = 7308 queue_length = 2 clock = 7311 queue_length = 3 clock = 7348 queue_length = 3 clock = 7453 queue_length = 2 clock = 7845 queue_length = 1 clock = 7869 queue_length = 1 clock = 8032 queue_length = 1 clock = 8126 queue_length = 1 clock = 8706 queue_length = 1 clock = 10385 queue_length = 1 clock = 10416 queue_length = 2 clock = 11747 queue_length = 1 clock = 13502 queue_length = 1 clock = 13828 queue_length = 1 clock = 13865 queue_length = 2 clock = 13998 queue_length = 2 clock = 14099 queue_length = 1 clock = 14888 queue_length = 1 clock = 15451 queue_length = 1 clock = 15469 queue_length = 1 clock = 16118 queue_length = 1 clock = 16589 queue_length = 1 clock = 16628 queue_length = 2 clock = 16679 queue_length = 3 clock = 16693 queue_length = 3 clock = 18794 queue_length = 1 clock = 18895 queue_length = 1 clock = 18942 queue_length = 1 clock = 19274 queue_length = 1 clock = 20958 queue_length = 1 clock = 20966 queue_length = 1 clock = 20984 queue_length = 1 clock = 22976 queue_length = 1 clock = 23047 queue_length = 1 clock = 23485 queue_length = 1 clock = 25633 queue_length = 1 clock = 25682 queue_length = 1 clock = 25713 queue_length = 1 clock = 25761 queue_length = 1 clock = 27690 queue_length = 1 clock = 28843 queue_length = 1 clock = 28844 queue_length = 2 clock = 28885 queue_length = 2 clock = 28945 queue_length = 1 clock = 28947 queue_length = 2 clock = 28960 queue_length = 3 clock = 29026 queue_length = 4 clock = 29033 queue_length = 4 clock = 29085 queue_length = 4 clock = 29107 queue_length = 5 clock = 30893 queue_length = 1 clock = 30972 queue_length = 1 clock = 31043 queue_length = 2 clock = 31065 queue_length = 3 clock = 31450 queue_length = 1 clock = 31508 queue_length = 1 clock = 31963 queue_length = 1 clock = 32009 queue_length = 2 clock = 32096 queue_length = 2 clock = 32348 queue_length = 1 clock = 35393 queue_length = 1 Average total time at deli 113.35666666666667 Maximum time at deli 672 Average queue length 0.12511111111111112 Maximum queue length 5 Percent idle time clerk1 47.955555555555556 Percent idle time clerk2 70.06944444444444 deli(): A deli is open for 36,000 seconds. There are 1 or 2 clerks. Customers arrive at random. The amount of time it takes to service a customer is random. Customers are served in order. A clerk serves one customer at a time. Newly arrived customers wait in a queue if no clerk is available. What is the average and maximal times spent per customer? What is the average and maximal queue length? What percentage of time are the clerks idle? clock = 29 queue_length = 1 clock = 126 queue_length = 1 clock = 193 queue_length = 2 clock = 241 queue_length = 2 clock = 260 queue_length = 3 clock = 420 queue_length = 3 clock = 530 queue_length = 4 clock = 626 queue_length = 3 clock = 705 queue_length = 3 clock = 802 queue_length = 4 clock = 885 queue_length = 4 clock = 954 queue_length = 5 clock = 1010 queue_length = 6 clock = 1057 queue_length = 7 clock = 1062 queue_length = 8 clock = 1146 queue_length = 7 clock = 1148 queue_length = 8 clock = 1196 queue_length = 9 clock = 1206 queue_length = 10 clock = 1274 queue_length = 11 clock = 1336 queue_length = 12 clock = 1447 queue_length = 13 clock = 1465 queue_length = 14 clock = 1713 queue_length = 13 clock = 1731 queue_length = 14 clock = 1760 queue_length = 15 clock = 1905 queue_length = 16 clock = 1935 queue_length = 17 clock = 1942 queue_length = 18 clock = 1983 queue_length = 19 clock = 1989 queue_length = 20 clock = 2114 queue_length = 20 clock = 2152 queue_length = 21 clock = 2347 queue_length = 22 clock = 2506 queue_length = 22 clock = 2936 queue_length = 20 clock = 2970 queue_length = 21 clock = 3042 queue_length = 22 clock = 3092 queue_length = 22 clock = 3094 queue_length = 23 clock = 3163 queue_length = 24 clock = 3167 queue_length = 24 clock = 3284 queue_length = 25 clock = 3345 queue_length = 26 clock = 3354 queue_length = 27 clock = 3470 queue_length = 27 clock = 3496 queue_length = 28 clock = 3515 queue_length = 29 clock = 3522 queue_length = 30 clock = 3575 queue_length = 31 clock = 3644 queue_length = 32 clock = 3647 queue_length = 33 clock = 3690 queue_length = 34 clock = 3717 queue_length = 35 clock = 3725 queue_length = 36 clock = 3761 queue_length = 37 clock = 3862 queue_length = 38 clock = 4062 queue_length = 38 clock = 4176 queue_length = 38 clock = 4209 queue_length = 38 clock = 4225 queue_length = 39 clock = 4242 queue_length = 40 clock = 4276 queue_length = 41 clock = 4463 queue_length = 42 clock = 4505 queue_length = 43 clock = 4701 queue_length = 44 clock = 4803 queue_length = 45 clock = 4896 queue_length = 46 clock = 4935 queue_length = 46 clock = 4942 queue_length = 47 clock = 4946 queue_length = 48 clock = 5091 queue_length = 48 clock = 5119 queue_length = 49 clock = 5150 queue_length = 50 clock = 5188 queue_length = 51 clock = 5202 queue_length = 52 clock = 5205 queue_length = 53 clock = 5259 queue_length = 54 clock = 5454 queue_length = 52 clock = 5504 queue_length = 52 clock = 5629 queue_length = 53 clock = 5674 queue_length = 54 clock = 5936 queue_length = 55 clock = 5986 queue_length = 56 clock = 6115 queue_length = 55 clock = 6121 queue_length = 56 clock = 6126 queue_length = 56 clock = 6319 queue_length = 55 clock = 6472 queue_length = 55 clock = 6530 queue_length = 56 clock = 6657 queue_length = 57 clock = 6702 queue_length = 58 clock = 6750 queue_length = 59 clock = 6765 queue_length = 59 clock = 6869 queue_length = 60 clock = 6876 queue_length = 61 clock = 6885 queue_length = 62 clock = 6919 queue_length = 62 clock = 6929 queue_length = 63 clock = 6969 queue_length = 64 clock = 7026 queue_length = 65 clock = 7068 queue_length = 66 clock = 7246 queue_length = 66 clock = 7313 queue_length = 64 clock = 7380 queue_length = 65 clock = 7496 queue_length = 66 clock = 7624 queue_length = 67 clock = 7647 queue_length = 68 clock = 7771 queue_length = 65 clock = 7807 queue_length = 66 clock = 7818 queue_length = 66 clock = 7834 queue_length = 67 clock = 7838 queue_length = 68 clock = 7900 queue_length = 68 clock = 7986 queue_length = 69 clock = 8060 queue_length = 70 clock = 8087 queue_length = 71 clock = 8096 queue_length = 72 clock = 8190 queue_length = 70 clock = 8318 queue_length = 70 clock = 8358 queue_length = 71 clock = 8403 queue_length = 72 clock = 8435 queue_length = 73 clock = 8459 queue_length = 74 clock = 8476 queue_length = 75 clock = 8521 queue_length = 76 clock = 8593 queue_length = 76 clock = 8731 queue_length = 76 clock = 8755 queue_length = 77 clock = 8827 queue_length = 78 clock = 8880 queue_length = 79 clock = 8882 queue_length = 80 clock = 8958 queue_length = 80 clock = 8973 queue_length = 81 clock = 9241 queue_length = 81 clock = 9276 queue_length = 82 clock = 9287 queue_length = 83 clock = 9288 queue_length = 84 clock = 9376 queue_length = 85 clock = 9405 queue_length = 86 clock = 9410 queue_length = 87 clock = 9588 queue_length = 88 clock = 9594 queue_length = 89 clock = 9694 queue_length = 87 clock = 9742 queue_length = 88 clock = 9800 queue_length = 88 clock = 9828 queue_length = 89 clock = 9906 queue_length = 90 clock = 10040 queue_length = 90 clock = 10075 queue_length = 91 clock = 10100 queue_length = 90 clock = 10134 queue_length = 91 clock = 10261 queue_length = 91 clock = 10466 queue_length = 86 clock = 10653 queue_length = 86 clock = 10730 queue_length = 84 clock = 10824 queue_length = 85 clock = 10875 queue_length = 85 clock = 10910 queue_length = 86 clock = 10977 queue_length = 87 clock = 11022 queue_length = 87 clock = 11097 queue_length = 88 clock = 11114 queue_length = 89 clock = 11153 queue_length = 90 clock = 11164 queue_length = 91 clock = 11236 queue_length = 92 clock = 11485 queue_length = 90 clock = 11488 queue_length = 91 clock = 11543 queue_length = 92 clock = 11561 queue_length = 93 clock = 11581 queue_length = 92 clock = 11588 queue_length = 93 clock = 11654 queue_length = 94 clock = 11692 queue_length = 95 clock = 11725 queue_length = 95 clock = 11766 queue_length = 96 clock = 11770 queue_length = 97 clock = 11856 queue_length = 98 clock = 11910 queue_length = 99 clock = 11980 queue_length = 99 clock = 12011 queue_length = 99 clock = 12047 queue_length = 100 clock = 12134 queue_length = 101 clock = 12182 queue_length = 101 clock = 12325 queue_length = 102 clock = 12348 queue_length = 103 clock = 12434 queue_length = 103 clock = 12463 queue_length = 104 clock = 12502 queue_length = 104 clock = 12577 queue_length = 105 clock = 12635 queue_length = 106 clock = 12641 queue_length = 107 clock = 12732 queue_length = 107 clock = 12872 queue_length = 106 clock = 12977 queue_length = 105 clock = 13002 queue_length = 106 clock = 13095 queue_length = 105 clock = 13106 queue_length = 106 clock = 13165 queue_length = 107 clock = 13202 queue_length = 108 clock = 13207 queue_length = 109 clock = 13252 queue_length = 110 clock = 13310 queue_length = 111 clock = 13323 queue_length = 112 clock = 13350 queue_length = 113 clock = 13453 queue_length = 112 clock = 13552 queue_length = 113 clock = 13574 queue_length = 114 clock = 13604 queue_length = 115 clock = 13619 queue_length = 116 clock = 13630 queue_length = 117 clock = 13640 queue_length = 118 clock = 13659 queue_length = 118 clock = 13700 queue_length = 118 clock = 13829 queue_length = 119 clock = 13845 queue_length = 120 clock = 13936 queue_length = 120 clock = 13961 queue_length = 121 clock = 13966 queue_length = 122 clock = 14058 queue_length = 118 clock = 14068 queue_length = 119 clock = 14073 queue_length = 120 clock = 14341 queue_length = 120 clock = 14343 queue_length = 121 clock = 14576 queue_length = 118 clock = 14669 queue_length = 119 clock = 14730 queue_length = 120 clock = 14732 queue_length = 121 clock = 14830 queue_length = 122 clock = 14905 queue_length = 122 clock = 14916 queue_length = 123 clock = 15072 queue_length = 124 clock = 15150 queue_length = 124 clock = 15306 queue_length = 123 clock = 15357 queue_length = 124 clock = 15410 queue_length = 125 clock = 15558 queue_length = 125 clock = 15560 queue_length = 126 clock = 15616 queue_length = 127 clock = 15662 queue_length = 128 clock = 15689 queue_length = 129 clock = 15721 queue_length = 129 clock = 15808 queue_length = 130 clock = 15902 queue_length = 131 clock = 15977 queue_length = 130 clock = 16048 queue_length = 131 clock = 16092 queue_length = 132 clock = 16231 queue_length = 133 clock = 16307 queue_length = 134 clock = 16381 queue_length = 135 clock = 16414 queue_length = 135 clock = 16434 queue_length = 136 clock = 16465 queue_length = 137 clock = 16580 queue_length = 138 clock = 16613 queue_length = 139 clock = 16632 queue_length = 140 clock = 16728 queue_length = 141 clock = 16752 queue_length = 142 clock = 16856 queue_length = 141 clock = 16863 queue_length = 142 clock = 16869 queue_length = 143 clock = 16932 queue_length = 144 clock = 16971 queue_length = 143 clock = 16973 queue_length = 144 clock = 17023 queue_length = 144 clock = 17075 queue_length = 144 clock = 17097 queue_length = 144 clock = 17140 queue_length = 145 clock = 17151 queue_length = 146 clock = 17201 queue_length = 147 clock = 17215 queue_length = 148 clock = 17294 queue_length = 149 clock = 17369 queue_length = 149 clock = 17431 queue_length = 149 clock = 17441 queue_length = 150 clock = 17580 queue_length = 149 clock = 17602 queue_length = 150 clock = 17695 queue_length = 151 clock = 17776 queue_length = 152 clock = 17839 queue_length = 152 clock = 17923 queue_length = 150 clock = 17972 queue_length = 151 clock = 18035 queue_length = 152 clock = 18080 queue_length = 153 clock = 18132 queue_length = 154 clock = 18202 queue_length = 155 clock = 18297 queue_length = 156 clock = 18393 queue_length = 156 clock = 18490 queue_length = 157 clock = 18527 queue_length = 158 clock = 18584 queue_length = 159 clock = 18602 queue_length = 160 clock = 18639 queue_length = 161 clock = 18646 queue_length = 162 clock = 18647 queue_length = 163 clock = 18746 queue_length = 164 clock = 18826 queue_length = 165 clock = 18882 queue_length = 166 clock = 18955 queue_length = 167 clock = 19017 queue_length = 168 clock = 19085 queue_length = 169 clock = 19152 queue_length = 168 clock = 19172 queue_length = 169 clock = 19191 queue_length = 170 clock = 19246 queue_length = 171 clock = 19348 queue_length = 171 clock = 19371 queue_length = 172 clock = 19425 queue_length = 173 clock = 19530 queue_length = 174 clock = 19584 queue_length = 173 clock = 19679 queue_length = 173 clock = 19776 queue_length = 172 clock = 19798 queue_length = 173 clock = 19818 queue_length = 174 clock = 19829 queue_length = 175 clock = 19943 queue_length = 176 clock = 20010 queue_length = 177 clock = 20083 queue_length = 178 clock = 20088 queue_length = 179 clock = 20107 queue_length = 180 clock = 20237 queue_length = 176 clock = 20246 queue_length = 177 clock = 20254 queue_length = 178 clock = 20283 queue_length = 179 clock = 20500 queue_length = 180 clock = 20585 queue_length = 179 clock = 20602 queue_length = 180 clock = 20616 queue_length = 181 clock = 20750 queue_length = 182 clock = 20776 queue_length = 183 clock = 20866 queue_length = 184 clock = 20909 queue_length = 185 clock = 21013 queue_length = 186 clock = 21043 queue_length = 186 clock = 21109 queue_length = 187 clock = 21111 queue_length = 188 clock = 21186 queue_length = 188 clock = 21213 queue_length = 189 clock = 21218 queue_length = 190 clock = 21250 queue_length = 191 clock = 21337 queue_length = 192 clock = 21365 queue_length = 192 clock = 21533 queue_length = 191 clock = 21536 queue_length = 192 clock = 21578 queue_length = 193 clock = 21711 queue_length = 192 clock = 21775 queue_length = 192 clock = 21995 queue_length = 191 clock = 22019 queue_length = 191 clock = 22064 queue_length = 192 clock = 22162 queue_length = 193 clock = 22163 queue_length = 194 clock = 22241 queue_length = 193 clock = 22350 queue_length = 194 clock = 22414 queue_length = 194 clock = 22523 queue_length = 195 clock = 22564 queue_length = 196 clock = 22631 queue_length = 197 clock = 22717 queue_length = 198 clock = 22956 queue_length = 196 clock = 23039 queue_length = 195 clock = 23092 queue_length = 196 clock = 23127 queue_length = 197 clock = 23141 queue_length = 198 clock = 23155 queue_length = 199 clock = 23252 queue_length = 200 clock = 23344 queue_length = 201 clock = 23367 queue_length = 202 clock = 23368 queue_length = 203 clock = 23395 queue_length = 204 clock = 23464 queue_length = 203 clock = 23663 queue_length = 204 clock = 23682 queue_length = 204 clock = 23683 queue_length = 205 clock = 23712 queue_length = 206 clock = 23794 queue_length = 207 clock = 23804 queue_length = 208 clock = 23842 queue_length = 209 clock = 23861 queue_length = 210 clock = 23922 queue_length = 211 clock = 24404 queue_length = 208 clock = 24426 queue_length = 209 clock = 24459 queue_length = 210 clock = 24555 queue_length = 211 clock = 24608 queue_length = 212 clock = 24712 queue_length = 212 clock = 24917 queue_length = 213 clock = 24942 queue_length = 214 clock = 25064 queue_length = 215 clock = 25165 queue_length = 215 clock = 25168 queue_length = 216 clock = 25177 queue_length = 217 clock = 25197 queue_length = 218 clock = 25206 queue_length = 219 clock = 25275 queue_length = 220 clock = 25405 queue_length = 217 clock = 25494 queue_length = 218 clock = 25580 queue_length = 218 clock = 25584 queue_length = 219 clock = 25744 queue_length = 220 clock = 25807 queue_length = 221 clock = 26069 queue_length = 221 clock = 26095 queue_length = 221 clock = 26120 queue_length = 222 clock = 26136 queue_length = 223 clock = 26483 queue_length = 223 clock = 26516 queue_length = 223 clock = 26528 queue_length = 224 clock = 26628 queue_length = 225 clock = 26773 queue_length = 225 clock = 26825 queue_length = 226 clock = 26843 queue_length = 227 clock = 26868 queue_length = 227 clock = 26886 queue_length = 228 clock = 26906 queue_length = 229 clock = 27003 queue_length = 230 clock = 27148 queue_length = 229 clock = 27391 queue_length = 230 clock = 27424 queue_length = 231 clock = 27479 queue_length = 231 clock = 27804 queue_length = 229 clock = 27833 queue_length = 230 clock = 27834 queue_length = 231 clock = 27861 queue_length = 232 clock = 27883 queue_length = 233 clock = 27909 queue_length = 234 clock = 27912 queue_length = 235 clock = 27915 queue_length = 236 clock = 28067 queue_length = 236 clock = 28098 queue_length = 237 clock = 28158 queue_length = 238 clock = 28186 queue_length = 238 clock = 28290 queue_length = 239 clock = 28330 queue_length = 240 clock = 28403 queue_length = 239 clock = 28418 queue_length = 239 clock = 28500 queue_length = 240 clock = 28517 queue_length = 241 clock = 28549 queue_length = 241 clock = 28559 queue_length = 242 clock = 28697 queue_length = 243 clock = 28803 queue_length = 243 clock = 28987 queue_length = 243 clock = 29078 queue_length = 243 clock = 29111 queue_length = 243 clock = 29197 queue_length = 244 clock = 29251 queue_length = 243 clock = 29409 queue_length = 242 clock = 29454 queue_length = 243 clock = 29525 queue_length = 244 clock = 29529 queue_length = 245 clock = 29587 queue_length = 245 clock = 29669 queue_length = 246 clock = 29671 queue_length = 247 clock = 29805 queue_length = 247 clock = 29883 queue_length = 247 clock = 29884 queue_length = 248 clock = 29888 queue_length = 249 clock = 29889 queue_length = 250 clock = 29915 queue_length = 251 clock = 29964 queue_length = 251 clock = 30037 queue_length = 251 clock = 30048 queue_length = 252 clock = 30152 queue_length = 253 clock = 30231 queue_length = 254 clock = 30471 queue_length = 253 clock = 30479 queue_length = 253 clock = 30591 queue_length = 254 clock = 30826 queue_length = 251 clock = 30839 queue_length = 252 clock = 30842 queue_length = 253 clock = 30857 queue_length = 254 clock = 30902 queue_length = 253 clock = 30951 queue_length = 254 clock = 31093 queue_length = 255 clock = 31099 queue_length = 256 clock = 31165 queue_length = 257 clock = 31174 queue_length = 258 clock = 31266 queue_length = 257 clock = 31287 queue_length = 258 clock = 31563 queue_length = 256 clock = 31595 queue_length = 257 clock = 31630 queue_length = 258 clock = 31668 queue_length = 259 clock = 31704 queue_length = 259 clock = 31820 queue_length = 260 clock = 31860 queue_length = 260 clock = 31917 queue_length = 261 clock = 31966 queue_length = 262 clock = 32005 queue_length = 263 clock = 32024 queue_length = 264 clock = 32071 queue_length = 265 clock = 32092 queue_length = 266 clock = 32126 queue_length = 267 clock = 32163 queue_length = 268 clock = 32251 queue_length = 268 clock = 32277 queue_length = 268 clock = 32473 queue_length = 269 clock = 32476 queue_length = 270 clock = 32488 queue_length = 271 clock = 32602 queue_length = 269 clock = 32623 queue_length = 270 clock = 32654 queue_length = 271 clock = 32682 queue_length = 272 clock = 32765 queue_length = 272 clock = 32808 queue_length = 273 clock = 32942 queue_length = 273 clock = 32967 queue_length = 274 clock = 32973 queue_length = 274 clock = 33043 queue_length = 275 clock = 33105 queue_length = 276 clock = 33125 queue_length = 276 clock = 33205 queue_length = 277 clock = 33287 queue_length = 277 clock = 33319 queue_length = 277 clock = 33322 queue_length = 278 clock = 33354 queue_length = 279 clock = 33367 queue_length = 280 clock = 33418 queue_length = 280 clock = 33439 queue_length = 281 clock = 33508 queue_length = 281 clock = 33621 queue_length = 282 clock = 33629 queue_length = 283 clock = 33655 queue_length = 284 clock = 33699 queue_length = 285 clock = 33846 queue_length = 285 clock = 33884 queue_length = 286 clock = 33936 queue_length = 287 clock = 33986 queue_length = 287 clock = 34100 queue_length = 286 clock = 34101 queue_length = 287 clock = 34210 queue_length = 287 clock = 34225 queue_length = 288 clock = 34242 queue_length = 288 clock = 34366 queue_length = 289 clock = 34367 queue_length = 290 clock = 34516 queue_length = 291 clock = 34583 queue_length = 292 clock = 34691 queue_length = 292 clock = 34735 queue_length = 291 clock = 34821 queue_length = 292 clock = 34892 queue_length = 291 clock = 34901 queue_length = 292 clock = 35117 queue_length = 292 clock = 35145 queue_length = 293 clock = 35183 queue_length = 294 clock = 35229 queue_length = 295 clock = 35246 queue_length = 296 clock = 35417 queue_length = 297 clock = 35476 queue_length = 298 clock = 35567 queue_length = 298 clock = 35641 queue_length = 298 clock = 35649 queue_length = 299 clock = 35691 queue_length = 299 clock = 35719 queue_length = 300 clock = 35910 queue_length = 296 Average total time at deli 10159.665384615384 Maximum time at deli 19191.0 Average queue length 152.12938888888888 Maximum queue length 300 Percent idle time clerk1 0.06944444444444445 Percent idle time clerk2 0.0 deli(): A deli is open for 36,000 seconds. There are 1 or 2 clerks. Customers arrive at random. The amount of time it takes to service a customer is random. Customers are served in order. A clerk serves one customer at a time. Newly arrived customers wait in a queue if no clerk is available. What is the average and maximal times spent per customer? What is the average and maximal queue length? What percentage of time are the clerks idle? clock = 183 queue_length = 1 clock = 425 queue_length = 1 clock = 470 queue_length = 1 clock = 555 queue_length = 1 clock = 793 queue_length = 1 clock = 809 queue_length = 2 clock = 882 queue_length = 2 clock = 974 queue_length = 1 clock = 980 queue_length = 2 clock = 983 queue_length = 3 clock = 1024 queue_length = 3 clock = 1067 queue_length = 3 clock = 1213 queue_length = 3 clock = 1281 queue_length = 3 clock = 1306 queue_length = 2 clock = 1893 queue_length = 1 clock = 2914 queue_length = 1 clock = 3291 queue_length = 1 clock = 3298 queue_length = 2 clock = 3394 queue_length = 2 clock = 3466 queue_length = 2 clock = 3535 queue_length = 3 clock = 3545 queue_length = 3 clock = 3554 queue_length = 4 clock = 3579 queue_length = 5 clock = 3583 queue_length = 6 clock = 3622 queue_length = 6 clock = 3630 queue_length = 7 clock = 3810 queue_length = 4 clock = 3826 queue_length = 4 clock = 3884 queue_length = 4 clock = 3934 queue_length = 2 clock = 3951 queue_length = 3 clock = 3968 queue_length = 4 clock = 4016 queue_length = 3 clock = 4083 queue_length = 2 clock = 4109 queue_length = 1 clock = 4165 queue_length = 1 clock = 4439 queue_length = 1 clock = 4453 queue_length = 2 clock = 4782 queue_length = 1 clock = 4819 queue_length = 2 clock = 4823 queue_length = 3 clock = 4913 queue_length = 3 clock = 4961 queue_length = 3 clock = 4979 queue_length = 3 clock = 5003 queue_length = 4 clock = 5071 queue_length = 2 clock = 5096 queue_length = 2 clock = 5698 queue_length = 1 clock = 5773 queue_length = 1 clock = 6328 queue_length = 1 clock = 6374 queue_length = 1 clock = 6444 queue_length = 1 clock = 6472 queue_length = 1 clock = 6491 queue_length = 2 clock = 6652 queue_length = 1 clock = 6702 queue_length = 1 clock = 6809 queue_length = 1 clock = 6839 queue_length = 2 clock = 6870 queue_length = 3 clock = 6896 queue_length = 3 clock = 7017 queue_length = 4 clock = 7071 queue_length = 5 clock = 7146 queue_length = 5 clock = 7299 queue_length = 4 clock = 7305 queue_length = 5 clock = 7331 queue_length = 4 clock = 7333 queue_length = 5 clock = 7337 queue_length = 6 clock = 7443 queue_length = 6 clock = 7694 queue_length = 4 clock = 7771 queue_length = 4 clock = 7801 queue_length = 5 clock = 7804 queue_length = 6 clock = 7986 queue_length = 6 clock = 8066 queue_length = 6 clock = 8090 queue_length = 7 clock = 8093 queue_length = 8 clock = 8251 queue_length = 7 clock = 8279 queue_length = 8 clock = 8338 queue_length = 9 clock = 8350 queue_length = 10 clock = 8399 queue_length = 10 clock = 8443 queue_length = 11 clock = 8507 queue_length = 12 clock = 8708 queue_length = 12 clock = 8719 queue_length = 13 clock = 8744 queue_length = 13 clock = 8755 queue_length = 14 clock = 8766 queue_length = 15 clock = 8916 queue_length = 14 clock = 9051 queue_length = 12 clock = 9188 queue_length = 10 clock = 9203 queue_length = 10 clock = 9366 queue_length = 8 clock = 9386 queue_length = 8 clock = 9394 queue_length = 9 clock = 9482 queue_length = 7 clock = 9531 queue_length = 7 clock = 9619 queue_length = 6 clock = 9631 queue_length = 7 clock = 9663 queue_length = 5 clock = 9694 queue_length = 6 clock = 9842 queue_length = 6 clock = 9976 queue_length = 4 clock = 9983 queue_length = 4 clock = 10018 queue_length = 4 clock = 10070 queue_length = 5 clock = 10087 queue_length = 6 clock = 10102 queue_length = 7 clock = 10123 queue_length = 7 clock = 10206 queue_length = 7 clock = 10348 queue_length = 5 clock = 10413 queue_length = 6 clock = 10416 queue_length = 7 clock = 10495 queue_length = 6 clock = 10585 queue_length = 4 clock = 10626 queue_length = 5 clock = 10685 queue_length = 5 clock = 10707 queue_length = 6 clock = 11013 queue_length = 5 clock = 11044 queue_length = 5 clock = 11051 queue_length = 6 clock = 11074 queue_length = 7 clock = 11125 queue_length = 8 clock = 11352 queue_length = 6 clock = 11368 queue_length = 6 clock = 11428 queue_length = 7 clock = 11527 queue_length = 8 clock = 11683 queue_length = 7 clock = 11705 queue_length = 8 clock = 11772 queue_length = 9 clock = 11834 queue_length = 9 clock = 11929 queue_length = 8 clock = 12099 queue_length = 6 clock = 12104 queue_length = 7 clock = 12129 queue_length = 8 clock = 12198 queue_length = 8 clock = 12259 queue_length = 9 clock = 12273 queue_length = 9 clock = 12308 queue_length = 8 clock = 12317 queue_length = 9 clock = 12422 queue_length = 9 clock = 12505 queue_length = 10 clock = 12514 queue_length = 11 clock = 12565 queue_length = 8 clock = 12567 queue_length = 9 clock = 12676 queue_length = 9 clock = 12704 queue_length = 10 clock = 12765 queue_length = 11 clock = 12771 queue_length = 12 clock = 12998 queue_length = 12 clock = 13067 queue_length = 12 clock = 13139 queue_length = 13 clock = 13141 queue_length = 14 clock = 13382 queue_length = 12 clock = 13388 queue_length = 12 clock = 13526 queue_length = 12 clock = 13563 queue_length = 13 clock = 13684 queue_length = 8 clock = 13750 queue_length = 9 clock = 13857 queue_length = 10 clock = 13937 queue_length = 9 clock = 13989 queue_length = 10 clock = 14007 queue_length = 11 clock = 14030 queue_length = 12 clock = 14031 queue_length = 13 clock = 14055 queue_length = 13 clock = 14070 queue_length = 14 clock = 14197 queue_length = 15 clock = 14310 queue_length = 16 clock = 14333 queue_length = 16 clock = 14411 queue_length = 17 clock = 14417 queue_length = 18 clock = 14538 queue_length = 18 clock = 14572 queue_length = 18 clock = 14639 queue_length = 17 clock = 14694 queue_length = 16 clock = 14737 queue_length = 17 clock = 14759 queue_length = 17 clock = 14952 queue_length = 16 clock = 14979 queue_length = 17 clock = 14990 queue_length = 18 clock = 15004 queue_length = 19 clock = 15038 queue_length = 19 clock = 15171 queue_length = 20 clock = 15187 queue_length = 20 clock = 15208 queue_length = 20 clock = 15346 queue_length = 19 clock = 15372 queue_length = 19 clock = 15422 queue_length = 19 clock = 15533 queue_length = 19 clock = 15593 queue_length = 18 clock = 15801 queue_length = 14 clock = 15841 queue_length = 14 clock = 15907 queue_length = 11 clock = 15931 queue_length = 12 clock = 15932 queue_length = 13 clock = 16004 queue_length = 14 clock = 16012 queue_length = 15 clock = 16082 queue_length = 14 clock = 16339 queue_length = 11 clock = 16346 queue_length = 12 clock = 16373 queue_length = 12 clock = 16403 queue_length = 12 clock = 16421 queue_length = 12 clock = 16500 queue_length = 13 clock = 16565 queue_length = 13 clock = 16588 queue_length = 14 clock = 16635 queue_length = 15 clock = 16644 queue_length = 16 clock = 16695 queue_length = 17 clock = 16782 queue_length = 17 clock = 16850 queue_length = 15 clock = 17043 queue_length = 10 clock = 17049 queue_length = 11 clock = 17096 queue_length = 12 clock = 17157 queue_length = 11 clock = 17231 queue_length = 11 clock = 17299 queue_length = 12 clock = 17348 queue_length = 13 clock = 17393 queue_length = 14 clock = 17414 queue_length = 15 clock = 17536 queue_length = 13 clock = 17605 queue_length = 13 clock = 17628 queue_length = 13 clock = 17651 queue_length = 14 clock = 17667 queue_length = 15 clock = 17671 queue_length = 16 clock = 17687 queue_length = 17 clock = 17724 queue_length = 18 clock = 17819 queue_length = 18 clock = 17902 queue_length = 16 clock = 17933 queue_length = 15 clock = 18092 queue_length = 14 clock = 18138 queue_length = 13 clock = 18260 queue_length = 10 clock = 18269 queue_length = 11 clock = 18334 queue_length = 10 clock = 18506 queue_length = 6 clock = 18856 queue_length = 5 clock = 18908 queue_length = 5 clock = 19029 queue_length = 5 clock = 19080 queue_length = 4 clock = 19130 queue_length = 4 clock = 19152 queue_length = 5 clock = 19240 queue_length = 6 clock = 19249 queue_length = 7 clock = 19275 queue_length = 6 clock = 19301 queue_length = 7 clock = 19339 queue_length = 7 clock = 19452 queue_length = 8 clock = 19562 queue_length = 7 clock = 19585 queue_length = 7 clock = 19649 queue_length = 7 clock = 19674 queue_length = 6 clock = 19752 queue_length = 7 clock = 19772 queue_length = 8 clock = 19895 queue_length = 6 clock = 19904 queue_length = 6 clock = 19915 queue_length = 7 clock = 19945 queue_length = 8 clock = 20030 queue_length = 7 clock = 20067 queue_length = 7 clock = 20110 queue_length = 7 clock = 20130 queue_length = 7 clock = 20138 queue_length = 8 clock = 20148 queue_length = 9 clock = 20154 queue_length = 10 clock = 20261 queue_length = 8 clock = 20321 queue_length = 9 clock = 20377 queue_length = 9 clock = 20474 queue_length = 7 clock = 20477 queue_length = 8 clock = 20543 queue_length = 9 clock = 20604 queue_length = 9 clock = 20677 queue_length = 9 clock = 20680 queue_length = 10 clock = 20694 queue_length = 11 clock = 20758 queue_length = 12 clock = 20874 queue_length = 11 clock = 20937 queue_length = 12 clock = 21198 queue_length = 9 clock = 21214 queue_length = 10 clock = 21215 queue_length = 11 clock = 21270 queue_length = 11 clock = 21294 queue_length = 12 clock = 21334 queue_length = 13 clock = 21335 queue_length = 14 clock = 21396 queue_length = 14 clock = 21439 queue_length = 14 clock = 21475 queue_length = 15 clock = 21525 queue_length = 16 clock = 21746 queue_length = 11 clock = 21749 queue_length = 12 clock = 21820 queue_length = 11 clock = 21933 queue_length = 10 clock = 21959 queue_length = 11 clock = 22004 queue_length = 12 clock = 22130 queue_length = 12 clock = 22131 queue_length = 13 clock = 22196 queue_length = 14 clock = 22235 queue_length = 14 clock = 22357 queue_length = 12 clock = 22439 queue_length = 13 clock = 22459 queue_length = 13 clock = 22713 queue_length = 5 clock = 22864 queue_length = 3 clock = 22870 queue_length = 4 clock = 22917 queue_length = 5 clock = 22964 queue_length = 6 clock = 23027 queue_length = 6 clock = 23040 queue_length = 7 clock = 23120 queue_length = 8 clock = 23128 queue_length = 9 clock = 23215 queue_length = 8 clock = 23339 queue_length = 9 clock = 23347 queue_length = 10 clock = 23352 queue_length = 11 clock = 23380 queue_length = 11 clock = 23383 queue_length = 12 clock = 23401 queue_length = 13 clock = 23470 queue_length = 13 clock = 23495 queue_length = 14 clock = 23603 queue_length = 12 clock = 23677 queue_length = 13 clock = 24042 queue_length = 10 clock = 24071 queue_length = 11 clock = 24111 queue_length = 12 clock = 24128 queue_length = 12 clock = 24151 queue_length = 13 clock = 24174 queue_length = 14 clock = 24222 queue_length = 13 clock = 24228 queue_length = 13 clock = 24408 queue_length = 13 clock = 24436 queue_length = 14 clock = 24560 queue_length = 15 clock = 24633 queue_length = 16 clock = 24637 queue_length = 17 clock = 24850 queue_length = 13 clock = 24883 queue_length = 14 clock = 25087 queue_length = 12 clock = 25122 queue_length = 13 clock = 25138 queue_length = 14 clock = 25180 queue_length = 15 clock = 25229 queue_length = 14 clock = 25280 queue_length = 15 clock = 25303 queue_length = 15 clock = 25378 queue_length = 15 clock = 25456 queue_length = 16 clock = 25506 queue_length = 17 clock = 25531 queue_length = 18 clock = 25581 queue_length = 18 clock = 25608 queue_length = 18 clock = 25642 queue_length = 19 clock = 25673 queue_length = 20 clock = 25707 queue_length = 21 clock = 25741 queue_length = 21 clock = 25804 queue_length = 21 clock = 25870 queue_length = 22 clock = 25883 queue_length = 23 clock = 26257 queue_length = 21 clock = 26341 queue_length = 21 clock = 26437 queue_length = 21 clock = 26496 queue_length = 22 clock = 26523 queue_length = 23 clock = 26590 queue_length = 23 clock = 26597 queue_length = 24 clock = 26672 queue_length = 24 clock = 26799 queue_length = 21 clock = 26810 queue_length = 22 clock = 26829 queue_length = 23 clock = 26890 queue_length = 23 clock = 27079 queue_length = 19 clock = 27250 queue_length = 19 clock = 27258 queue_length = 19 clock = 27308 queue_length = 19 clock = 27556 queue_length = 17 clock = 27662 queue_length = 17 clock = 27673 queue_length = 18 clock = 27862 queue_length = 16 clock = 27864 queue_length = 17 clock = 27897 queue_length = 18 clock = 27908 queue_length = 19 clock = 27971 queue_length = 20 clock = 28017 queue_length = 21 clock = 28040 queue_length = 22 clock = 28055 queue_length = 23 clock = 28138 queue_length = 22 clock = 28140 queue_length = 23 clock = 28214 queue_length = 24 clock = 28218 queue_length = 25 clock = 28240 queue_length = 26 clock = 28246 queue_length = 27 clock = 28262 queue_length = 28 clock = 28263 queue_length = 29 clock = 28428 queue_length = 29 clock = 28572 queue_length = 26 clock = 28752 queue_length = 23 clock = 28797 queue_length = 24 clock = 28804 queue_length = 25 clock = 28820 queue_length = 26 clock = 29054 queue_length = 24 clock = 29078 queue_length = 25 clock = 29087 queue_length = 26 clock = 29229 queue_length = 27 clock = 29327 queue_length = 27 clock = 29435 queue_length = 28 clock = 29441 queue_length = 29 clock = 29607 queue_length = 28 clock = 29790 queue_length = 24 clock = 29816 queue_length = 25 clock = 29824 queue_length = 26 clock = 29846 queue_length = 27 clock = 29855 queue_length = 28 clock = 29870 queue_length = 29 clock = 29912 queue_length = 30 clock = 29947 queue_length = 31 clock = 29951 queue_length = 32 clock = 29955 queue_length = 33 clock = 29997 queue_length = 33 clock = 30070 queue_length = 34 clock = 30106 queue_length = 35 clock = 30141 queue_length = 35 clock = 30160 queue_length = 35 clock = 30164 queue_length = 36 clock = 30204 queue_length = 37 clock = 30524 queue_length = 36 clock = 30526 queue_length = 37 clock = 30566 queue_length = 38 clock = 30579 queue_length = 38 clock = 30631 queue_length = 39 clock = 30690 queue_length = 39 clock = 30717 queue_length = 39 clock = 31051 queue_length = 37 clock = 31143 queue_length = 38 clock = 31173 queue_length = 39 clock = 31240 queue_length = 39 clock = 31325 queue_length = 36 clock = 31489 queue_length = 32 clock = 31584 queue_length = 32 clock = 31601 queue_length = 32 clock = 31785 queue_length = 31 clock = 31955 queue_length = 31 clock = 32027 queue_length = 32 clock = 32058 queue_length = 33 clock = 32166 queue_length = 31 clock = 32192 queue_length = 30 clock = 32284 queue_length = 30 clock = 32385 queue_length = 30 clock = 32417 queue_length = 31 clock = 32446 queue_length = 32 clock = 32453 queue_length = 32 clock = 32503 queue_length = 32 clock = 32661 queue_length = 31 clock = 32825 queue_length = 28 clock = 32897 queue_length = 27 clock = 32907 queue_length = 28 clock = 32920 queue_length = 29 clock = 32994 queue_length = 29 clock = 33080 queue_length = 28 clock = 33133 queue_length = 28 clock = 33201 queue_length = 28 clock = 33228 queue_length = 29 clock = 33371 queue_length = 27 clock = 33464 queue_length = 27 clock = 33485 queue_length = 28 clock = 33546 queue_length = 27 clock = 33607 queue_length = 27 clock = 33691 queue_length = 28 clock = 33698 queue_length = 29 clock = 33792 queue_length = 29 clock = 33898 queue_length = 30 clock = 33950 queue_length = 31 clock = 33982 queue_length = 32 clock = 33997 queue_length = 33 clock = 34096 queue_length = 32 clock = 34111 queue_length = 32 clock = 34154 queue_length = 31 clock = 34415 queue_length = 28 clock = 34434 queue_length = 29 clock = 34511 queue_length = 28 clock = 34608 queue_length = 27 clock = 34657 queue_length = 28 clock = 34789 queue_length = 29 clock = 34804 queue_length = 30 clock = 34865 queue_length = 29 clock = 35088 queue_length = 27 clock = 35248 queue_length = 26 clock = 35250 queue_length = 27 clock = 35371 queue_length = 26 clock = 35410 queue_length = 27 clock = 35493 queue_length = 27 clock = 35539 queue_length = 27 clock = 35541 queue_length = 27 clock = 35615 queue_length = 27 clock = 35631 queue_length = 28 clock = 35766 queue_length = 27 clock = 35896 queue_length = 24 clock = 35995 queue_length = 24 Average total time at deli 1020.9155206286837 Maximum time at deli 2993.0 Average queue length 13.188027777777778 Maximum queue length 39 Percent idle time clerk1 5.3 Percent idle time clerk2 8.536111111111111 dinner(): N guests sit down at a dinner table, without noticing the name tags. What are the chances that no one sits at their assigned seat? N P(derangement) 1 0 2 0.5 3 0.3333333333333333 4 0.375 5 0.3666666666666667 6 0.3680555555555556 7 0.3678571428571428 8 0.3678819444444444 9 0.367879188712522 10 0.3678794642857143 11 0.3678794392336059 12 0.3678794413212816 13 0.3678794411606912 14 0.3678794411721619 15 0.3678794411713971 16 0.367879441171445 17 0.3678794411714422 18 0.3678794411714424 19 0.3678794411714424 20 0.3678794411714423 dish(): Five dishwashers work together. Five dishes are broken. What are the chances that at least four of the dishes are broken by the same particular dishwasher? Probability dishwasher #1 breaks at least 4 out of 5 dishes = 0.006559 Theoretical probability is 0.00672 easywalk(): A pedestrian begins 1000 blocks east and 1000 blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the exact expected wait for stop lights? Use graphics to display the expected results. Graphics saved as "easywalk.png" election(): 2 voters participate in an election. n of the voters are candidates. Voting rules may allow a voter to vote for themselves, or not. 2 votes are required in order for a leader to be chosen. What is the probability that, on a single vote, a leader will be chosen? Probability a leader was selected = 1.0 election(): 3 voters participate in an election. n of the voters are candidates. Voting rules may allow a voter to vote for themselves, or not. 2 votes are required in order for a leader to be chosen. What is the probability that, on a single vote, a leader will be chosen? Probability a leader was selected = 0.77988 election(): 7 voters participate in an election. n of the voters are candidates. Voting rules may allow a voter to vote for themselves, or not. 4 votes are required in order for a leader to be chosen. What is the probability that, on a single vote, a leader will be chosen? Probability a leader was selected = 0.06155 election(): 2 voters participate in an election. n of the voters are candidates. Voting rules may allow a voter to vote for themselves, or not. 17 votes are required in order for a leader to be chosen. What is the probability that, on a single vote, a leader will be chosen? Probability a leader was selected = 0.10863 estimate(): N runners participate in a marathon. Each runner wears a tag with their index, from 1 to N. We observe the values of K of these tags. We want to estimate N. Produce illustrative plots for several cases. Graphics saved as "estimate.png" floss(): A person buys two rolls of dental floss. Each roll has 40 feet of floss. The person randomly selects a roll and takes 1 foot of floss. When one roll runs out, how many feet remain in the other roll? Average remaining floss = 7.1142303019125785 floss(): A person buys two rolls of dental floss. Each roll has 150 feet of floss. The person randomly selects a roll and takes 1 foot of floss. When one roll runs out, how many feet remain in the other roll? Average remaining floss = 13.808254325711056 forgetful_burglar(): In a town of 201 homes, a burglar starts at home 101. He randomly moves one or two homes left or right. What is the typical number of moves he will make before revisiting a home? K Prob(K) 1 0 2 0.250076 3 0.281263 4 0.19522 5 0.117255 6 0.0682033 7 0.0389993 8 0.0218237 9 0.0121769 10 0.0067637 Graphics saved as "fb.png" gameb(): In game B, you have two biased coins. If, at the time just before you decide to flip, your capital M is a multiple of 3 dollars, you chose coin 1, which shows heads with probability 1/10 - epsilon, otherwise you choose coin 2, which shows heads with probability 3/4 - epsilon. Game B is a losing game for you, and this code simply demonstrates that using many simulations. Produce a plot showing how the player loses. Graphics saved as "gameb.png" gs(): A building has 7 floors, and there are n elevators, each of which is at a randomly chosen floor. A person on floor 2 requests an elevator, wishing to go up. What is the probability that the first elevator to arrive is going down? Estimated probability of down elevator = 0.833649 Theoretical probability is 0.8333333333333333 gs(): A building has 7 floors, and there are n elevators, each of which is at a randomly chosen floor. A person on floor 2 requests an elevator, wishing to go up. What is the probability that the first elevator to arrive is going down? Estimated probability of down elevator = 0.723202 Theoretical probability is 0.7222222222222222 gs(): A building has 7 floors, and there are n elevators, each of which is at a randomly chosen floor. A person on floor 2 requests an elevator, wishing to go up. What is the probability that the first elevator to arrive is going down? Estimated probability of down elevator = 0.647681 Theoretical probability is 0.6481481481481481 guess_rank(): Given M = 24 items of ranks 1 through M, randomly guess the rank of each item. On average, how many ranks will we guess correctly? Average number of correct pairings = 1.001089 Expected value is 1. jury(): There are 5 judges on an appeals court. Each judge has a probability of making a correct ruling. What is the probability that a majority of the judges will rule incorrectly? Probability of a mistaken judgement = 0.0070439 kelvin(): A biased coin comes up heads with probability 0.4 To get a unbiased random value, toss the coin twice. If you get TH, call it heads if you get HT, call it tails. If you get TT or HH, do another double toss. On average, how many double tosses are necessary? Average number of double tosses = 2.0761 Theoretical value = 2.0833333333333335 malt(): Lil and Bill agree to meet in the malt shop between 3:30 and 4:00. Each arrives at a random time. Lil will wait 5 minutes, then leave. Bill will wait 7 minutes, then leave. What is the probability of a meeting? Estimated meeting probability = 0.358073 Theoretical probability is 0.3588888888888889 missing(): There are 100 senators. A bill needs a majority of present senators to pass. A = 49 senators are against the bill. M = 3 senators are missing the vote. What is the probability that the bill will be defeated? Probability of defeat = 0.129208 missing(): There are 100 senators. A bill needs a majority of present senators to pass. A = 49 senators are against the bill. M = 4 senators are missing the vote. What is the probability that the bill will be defeated? Probability of defeat = 0.063266 missing(): There are 100 senators. A bill needs a majority of present senators to pass. A = 49 senators are against the bill. M = 5 senators are missing the vote. What is the probability that the bill will be defeated? Probability of defeat = 0.193043 monotone(): Expected value of the number of random numbers that can be generated, which are monotone increasing. Extimated expected length = 2.718468 Theoretical value is 2.718281828459045 obtuse(): Define a "random" triangle as half of a rectangle with height 1 and width <= L. What are the chances the triangle is obtuse? Using value L = 1.0 Estimated likelihoood of obtuse triangle = 0.725619 Expected value = 0.7252064830064114 Using value L = 2.0 Estimated likelihoood of obtuse triangle = 0.79828 Expected value = 0.7983742851269212 obtuse1(): Define a "random" triangle by splitting the unit interval into three random pieces. What are the chances the triangle is obtuse? Estimated likelihoood of obtuse triangle = 0.079701 Theoretical value is 0.17055845832016425 optimal(): A dating club offers 11 potential partners. It turns out that any of #d of these partners would be acceptable. 2 The dater gets 1 date with each partner, but immediately after the date, must either marry that partner, or move to the next date. The dater plans to date a sample of the partners without a marriage offer, and then marry the next partner who is better than all the sample dates. As the sample size is varied, what are the chances of happiness? Use graphics to display result. Graphics saved as "optimal.png" optimal(): A dating club offers 50 potential partners. It turns out that any of #d of these partners would be acceptable. 5 The dater gets 1 date with each partner, but immediately after the date, must either marry that partner, or move to the next date. The dater plans to date a sample of the partners without a marriage offer, and then marry the next partner who is better than all the sample dates. As the sample size is varied, what are the chances of happiness? Use graphics to display result. Graphics saved as "optimal.png" patrol(): Consider a divided highway, and suppose it could be divided by a grassy median or a concrete barrier. Suppose 1 police cars patrol the highway. Suppose an accident occurs at a randomly chosen location and lane. Suppose all patrol cars immediately head towards the accident. If a grassy median, then patrol cars in the wrong lane can immediately reverse direction. For the concrete barrier, patrol cars in the wrong lane must continue to the end of the highway and then turn around. Estimate the average time required by a patrol car to reach the accident. Average grass distance = 0.3330685913278577 Average concrete distance = 1.0008862613336627 patrol(): Consider a divided highway, and suppose it could be divided by a grassy median or a concrete barrier. Suppose 2 police cars patrol the highway. Suppose an accident occurs at a randomly chosen location and lane. Suppose all patrol cars immediately head towards the accident. If a grassy median, then patrol cars in the wrong lane can immediately reverse direction. For the concrete barrier, patrol cars in the wrong lane must continue to the end of the highway and then turn around. Estimate the average time required by a patrol car to reach the accident. Average grass distance = 0.20802071521007964 Average concrete distance = 0.6663362217423731 patrol(): Consider a divided highway, and suppose it could be divided by a grassy median or a concrete barrier. Suppose 3 police cars patrol the highway. Suppose an accident occurs at a randomly chosen location and lane. Suppose all patrol cars immediately head towards the accident. If a grassy median, then patrol cars in the wrong lane can immediately reverse direction. For the concrete barrier, patrol cars in the wrong lane must continue to the end of the highway and then turn around. Estimate the average time required by a patrol car to reach the accident. Average grass distance = 0.15006863614909866 Average concrete distance = 0.5000396715585526 patrol(): Consider a divided highway, and suppose it could be divided by a grassy median or a concrete barrier. Suppose 4 police cars patrol the highway. Suppose an accident occurs at a randomly chosen location and lane. Suppose all patrol cars immediately head towards the accident. If a grassy median, then patrol cars in the wrong lane can immediately reverse direction. For the concrete barrier, patrol cars in the wrong lane must continue to the end of the highway and then turn around. Estimate the average time required by a patrol car to reach the accident. Average grass distance = 0.11656468603753468 Average concrete distance = 0.40004391183909765 patrol(): Consider a divided highway, and suppose it could be divided by a grassy median or a concrete barrier. Suppose 5 police cars patrol the highway. Suppose an accident occurs at a randomly chosen location and lane. Suppose all patrol cars immediately head towards the accident. If a grassy median, then patrol cars in the wrong lane can immediately reverse direction. For the concrete barrier, patrol cars in the wrong lane must continue to the end of the highway and then turn around. Estimate the average time required by a patrol car to reach the accident. Average grass distance = 0.09519940002454966 Average concrete distance = 0.3332279513281033 pierror(): Estimate pi by counting random points in the unit square which are also in the quarter circle. Points used = 100 Estimate for pi is 0.84 Absolute error is 2.3015926535897933 pierror(): Estimate pi by counting random points in the unit square which are also in the quarter circle. Points used = 10000 Estimate for pi is 0.7828 Absolute error is 2.358792653589793 ranking(): A list of M = 24 items is given. The test taker is required to give a rank for each. For each item, the test taker randomly chooses a value between 1 and M. What is the average number of correct rankings? Average number of correct matches = 0.999787 rhs(): Random Harmonic Series: Compute and histogram many values of the partial sums of sum ( 1 <= k < infinity ) t(i) / k where t(i) is randomly +1 or -1. Graphics saved as "rhs.png" rolls(): Two rolls of toilet paper are installed in a toilet, with 200 sheets. There are two kinds of people, with probabilities p and 1-p. * big choosers take one sheet from the larger roll * little choosers take one sheet from the smaller roll (unless empty). When one roll becomes empty, how many sheets are on the other roll? Use graphics to display results. Graphics saved as "rolls.png" smoker(): A smoker buys two packs of 40 matches. He then repeatedly selects a match from a randomly chosen pack. When one pack runs out, how many matches have been used in total? Average total number of matches used = 72.881521 Graphics saved as "smoker.png" smokerb(): A smoker buys two packs of 40 matches. He then repeatedly selects a match from a randomly chosen pack. At some point, the pack he chooses will be empty. How many matches have been used by then? Average total number of matches used = 73.807031 Graphics saved as "smokerb.png" spin(): A game involves two spinnable disks, each divided into three sectors. A player spins disk 1 or 2 according to the following rules: * if the player spins disk i, and it stops in region Pij, he moves from disk i to disk j * if the spinner stops in region Pi3, the game ends. * if the game ends in P13, the player wins. What is the probablity that the player, starting with disk 1, wins? Probabiity of winning = 0.6469 Theoretical value = 0.65 steve(): Steve gets on an elevator going up. There are 11 higher floors. Steve wishes to go up 9 floors. There are 0 additional riders in the elevator, each of whom has randomly chosen one of the 11 higher floors as destination. On average, how many times will the elevator stop until Steve reaches his floor? Estimated number of stops = 1.0 Theoretical number = 1.0 steve(): Steve gets on an elevator going up. There are 11 higher floors. Steve wishes to go up 9 floors. There are 1 additional riders in the elevator, each of whom has randomly chosen one of the 11 higher floors as destination. On average, how many times will the elevator stop until Steve reaches his floor? Estimated number of stops = 1.727555 Theoretical number = 1.7272727272727275 steve(): Steve gets on an elevator going up. There are 11 higher floors. Steve wishes to go up 9 floors. There are 2 additional riders in the elevator, each of whom has randomly chosen one of the 11 higher floors as destination. On average, how many times will the elevator stop until Steve reaches his floor? Estimated number of stops = 3.537511 Theoretical number = 2.3884297520661164 steve(): Steve gets on an elevator going up. There are 11 higher floors. Steve wishes to go up 9 floors. There are 3 additional riders in the elevator, each of whom has randomly chosen one of the 11 higher floors as destination. On average, how many times will the elevator stop until Steve reaches his floor? Estimated number of stops = 5.607925 Theoretical number = 2.989481592787379 steve(): Steve gets on an elevator going up. There are 11 higher floors. Steve wishes to go up 9 floors. There are 9 additional riders in the elevator, each of whom has randomly chosen one of the 11 higher floors as destination. On average, how many times will the elevator stop until Steve reaches his floor? Estimated number of stops = 8.996441 Theoretical number = 5.607219053020122 stopping(): From a population of 5 indexed values, the highest is sought. Values are to be discovered in order of index. When value I is discovered: * it may be rejected, and the next value discovered, or * it may be accepted, and the process is terminated. A strategy is to view S items in a row, and then accept the very next item that is larger than max(S). Given N, what is S, and what are the chances that this process will produce the maximum? Population size N = 5 Optimal sample size S = 2 Ratio N / S = 2.5 Probability of success = 0.4333333333333333 stopping(): From a population of 10 indexed values, the highest is sought. Values are to be discovered in order of index. When value I is discovered: * it may be rejected, and the next value discovered, or * it may be accepted, and the process is terminated. A strategy is to view S items in a row, and then accept the very next item that is larger than max(S). Given N, what is S, and what are the chances that this process will produce the maximum? Population size N = 10 Optimal sample size S = 3 Ratio N / S = 3.3333333333333335 Probability of success = 0.39869047619047615 stopping(): From a population of 20 indexed values, the highest is sought. Values are to be discovered in order of index. When value I is discovered: * it may be rejected, and the next value discovered, or * it may be accepted, and the process is terminated. A strategy is to view S items in a row, and then accept the very next item that is larger than max(S). Given N, what is S, and what are the chances that this process will produce the maximum? Population size N = 20 Optimal sample size S = 7 Ratio N / S = 2.857142857142857 Probability of success = 0.38420888000028863 stopping(): From a population of 50 indexed values, the highest is sought. Values are to be discovered in order of index. When value I is discovered: * it may be rejected, and the next value discovered, or * it may be accepted, and the process is terminated. A strategy is to view S items in a row, and then accept the very next item that is larger than max(S). Given N, what is S, and what are the chances that this process will produce the maximum? Population size N = 50 Optimal sample size S = 18 Ratio N / S = 2.7777777777777777 Probability of success = 0.3742750136479202 stopping(): From a population of 100 indexed values, the highest is sought. Values are to be discovered in order of index. When value I is discovered: * it may be rejected, and the next value discovered, or * it may be accepted, and the process is terminated. A strategy is to view S items in a row, and then accept the very next item that is larger than max(S). Given N, what is S, and what are the chances that this process will produce the maximum? Population size N = 100 Optimal sample size S = 37 Ratio N / S = 2.7027027027027026 Probability of success = 0.3710427787126428 sylvester_quadrilateral(): Estimate the probability that four points, chosen uniformly at random in the unit circle, form a concave (=nonconvex) quadrilateral. Estimated concave probability = 0.703777 Theoretical concave probability = 0.2955201189568185 umbrella(): A person has XI umbrellas at home, and YI at the office. With probability P, it will be raining at any given time. If it is raining, the person takes an umbrella from one place to the other. How many walks will the person take before running out of umbrellas? Use graphics to display results. Graphics saved as "umbrella.png" umbrella(): A person has XI umbrellas at home, and YI at the office. With probability P, it will be raining at any given time. If it is raining, the person takes an umbrella from one place to the other. How many walks will the person take before running out of umbrellas? Use graphics to display results. Graphics saved as "umbrella.png" walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 0.75181 walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 1.22956 walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 1.76493 walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 2.51014 walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 3.99058 walk(): A pedestrian begins M blocks east and M blocks north of a destination. At each intersection, there is a stop light which is set randomly, and switches after 1 minute. Until reaching avenue 1 or street 1, the pedestrian always crosses the intersection in accordance with the stop light. Thereafter, the pedestrian must wait at each stop light encountered. What is the average wait for stop lights? Estimated waiting time = 5.64 digital_dice_test(): Normal end of execution. Tue Jan 2 19:13:03 2024