coin_simulation_test 22-Dec-2018 10:16:20 COIN_SIMULATION_TEST: MATLAB version COIN_SIMULATION simulates and visualizes the repeated tossing of a coin. COIN_BIASED_TEST COIN_BIASED simulates the tossing of a biased coin N times. HEADS has a probability of 0.7 Coin toss results: -1=Tails, +1=Heads 1: -1 2: -1 3: 1 4: -1 5: 1 6: 1 7: 1 8: 1 9: -1 10: -1 11: 1 12: -1 13: -1 14: 1 15: -1 16: 1 17: 1 18: -1 19: -1 20: -1 21: 1 22: 1 23: -1 24: -1 25: 1 26: -1 27: -1 28: 1 29: 1 30: 1 31: -1 32: 1 33: 1 34: 1 35: 1 36: -1 37: 1 38: 1 39: -1 40: 1 41: 1 42: 1 43: -1 44: -1 45: 1 46: 1 47: 1 48: 1 49: -1 50: -1 51: 1 52: 1 53: 1 54: 1 55: 1 56: 1 57: -1 58: 1 59: 1 60: 1 61: -1 62: 1 63: 1 64: 1 65: -1 66: -1 67: 1 68: 1 69: 1 70: 1 71: -1 72: 1 73: -1 74: 1 75: -1 76: 1 77: 1 78: 1 79: 1 80: 1 81: 1 82: -1 83: 1 84: 1 85: -1 86: 1 87: -1 88: -1 89: 1 90: 1 91: 1 92: 1 93: 1 94: -1 95: -1 96: 1 97: 1 98: 1 99: 1 100: 1 COIN_STREAK_TEST COIN_STREAK computes streaks of H's or T's in N tosses of a coin. Coin toss results: -1=Tails, +1=Heads 1: 1 2: -1 3: 1 4: -1 5: 1 6: -1 7: 1 8: -1 9: -1 10: -1 11: 1 12: 1 13: 1 14: -1 15: 1 16: -1 17: -1 18: -1 19: 1 20: 1 Streak list: 1: 0 2: 1 3: -1 4: 1 5: -1 6: 1 7: -1 8: 1 9: -1 10: -2 11: -3 12: 1 13: 2 14: 3 15: -1 16: 1 17: -1 18: -2 19: -3 20: 1 21: 2 COIN_UNIFORM_TEST COIN_UNIFORM simulates the tossing of a fair coin N times. Coin toss results: -1=Tails, +1=Heads 1: 1 2: -1 3: 1 4: -1 5: -1 6: -1 7: 1 8: 1 9: 1 10: -1 11: 1 12: -1 13: 1 14: 1 15: 1 16: 1 17: -1 18: -1 19: -1 20: 1 21: -1 22: -1 23: 1 24: -1 25: 1 26: 1 27: 1 28: 1 29: 1 30: 1 31: 1 32: 1 33: -1 34: -1 35: 1 36: 1 37: 1 38: -1 39: 1 40: 1 41: -1 42: 1 43: 1 44: 1 45: 1 46: 1 47: -1 48: -1 49: -1 50: 1 51: 1 52: 1 53: -1 54: 1 55: 1 56: 1 57: -1 58: -1 59: -1 60: 1 61: -1 62: 1 63: -1 64: 1 65: -1 66: 1 67: 1 68: -1 69: -1 70: 1 71: -1 72: -1 73: 1 74: 1 75: 1 76: 1 77: -1 78: -1 79: -1 80: -1 81: -1 82: 1 83: -1 84: -1 85: 1 86: -1 87: -1 88: -1 89: -1 90: -1 91: 1 92: 1 93: 1 94: 1 95: -1 96: 1 97: 1 98: 1 99: 1 100: 1 Saving a copy of this plot in "coin_biased_barchart.png" Saving a copy of this plot in "coin_biased_plot.png" Saving a copy of this plot in "coin_biased_average.png" Saving a copy of this plot in "coin_biased_sign.png" Saving a copy of this plot in "coin_biased_streak.png" Saving a copy of this plot in "coin_biased_sum.png" Saving a copy of this plot in "coins_biased_sum_barchart.png" Saving a copy of this plot in "coin_uniform_barchart.png" Saving a copy of this plot in "coin_uniform_plot.png" Saving a copy of this plot in "coin_uniform_average.png" Saving a copy of this plot in "coin_uniform_sign.png" Saving a copy of this plot in "coin_uniform_streak.png" Saving a copy of this plot in "coin_uniform_sum.png" Saving a copy of this plot in "coins_uniform_plot.png" Saving a copy of this plot in "coins_uniform_average.png" Saving a copy of this plot in "coins_uniform_sum.png" Saving a copy of this plot in "coins_uniform_sum_barchart.png" R8ROW_PRINT_TEST R8ROW_PRINT prints an R8ROW. The R8ROW: Col: 1 2 3 4 Row 1 : 11 12 13 14 2 : 21 22 23 24 3 : 31 32 33 34 4 : 41 42 43 44 5 : 51 52 53 54 6 : 61 62 63 64 R8ROW_PRINT_SOME_TEST R8ROW_PRINT_SOME prints some of an R8ROW. The R8ROW, rows 2:4, cols 1:2: Col: 1 2 Row 2 : 21 22 3 : 31 32 4 : 41 42 R8ROW_RUNNING_AVERAGE_TEST R8ROW_RUNNING_AVERAGE returns M sets of running averages of an MxN R8ROW. Random R8ROW: Col: 1 2 3 4 5 Row 1 : -1.72373 -4.00822 -4.07409 -4.97242 7.88645 2 : 9.34476 -1.13633 1.74308 8.46256 7.61271 3 : 7.44264 -3.35065 1.01959 0.261285 -3.15344 4 : 3.42543 -4.34257 6.3201 -3.58183 -4.88731 5 : 1.22961 4.50949 6.9593 -4.79575 -1.09546 Col: 6 7 8 9 10 Row 1 : 8.68726 5.381 3.96875 3.61549 5.71707 2 : -3.29504 3.42494 -2.16568 0.5054 -3.2344 3 : 0.27443 7.91824 6.42238 4.25807 -0.510063 4 : 7.34331 1.80691 0.954827 0.422931 7.37504 5 : -0.993016 8.67966 -2.22029 -1.80605 7.3699 Running averages: Col: 1 2 3 4 5 Row 1 : 0 -1.72373 -2.86597 -3.26868 -3.69462 2 : 0 9.34476 4.10422 3.31717 4.60352 3 : 0 7.44264 2.046 1.70386 1.34322 4 : 0 3.42543 -0.458567 1.80099 0.455285 5 : 0 1.22961 2.86955 4.2328 1.97566 Col: 6 7 8 9 10 Row 1 : -1.3784 0.299208 1.02518 1.39312 1.64005 2 : 5.20536 3.78862 3.73667 2.99888 2.72182 3 : 0.443886 0.415643 1.48744 2.10431 2.34362 4 : -0.613235 0.712856 0.869149 0.879859 0.829089 5 : 1.36144 0.96903 2.07055 1.53419 1.16306 Col: 11 Row 1 : 2.04776 2 : 2.1262 3 : 2.05825 4 : 1.48368 5 : 1.78374 R8ROW_RUNNING_SUM_TEST R8ROW_RUNNING_SUM returns the M running sums of an R8ROW. Random R8ROW: Col: 1 2 3 4 5 Row 1 : -1.72373 -4.00822 -4.07409 -4.97242 7.88645 2 : 9.34476 -1.13633 1.74308 8.46256 7.61271 3 : 7.44264 -3.35065 1.01959 0.261285 -3.15344 4 : 3.42543 -4.34257 6.3201 -3.58183 -4.88731 5 : 1.22961 4.50949 6.9593 -4.79575 -1.09546 Col: 6 7 8 9 10 Row 1 : 8.68726 5.381 3.96875 3.61549 5.71707 2 : -3.29504 3.42494 -2.16568 0.5054 -3.2344 3 : 0.27443 7.91824 6.42238 4.25807 -0.510063 4 : 7.34331 1.80691 0.954827 0.422931 7.37504 5 : -0.993016 8.67966 -2.22029 -1.80605 7.3699 Running sums: Col: 1 2 3 4 5 Row 1 : 0 -1.72373 -5.73194 -9.80604 -14.7785 2 : 0 9.34476 8.20843 9.95151 18.4141 3 : 0 7.44264 4.09199 5.11158 5.37287 4 : 0 3.42543 -0.917133 5.40297 1.82114 5 : 0 1.22961 5.73909 12.6984 7.90265 Col: 6 7 8 9 10 Row 1 : -6.89201 1.79525 7.17625 11.145 14.7605 2 : 26.0268 22.7317 26.1567 23.991 24.4964 3 : 2.21943 2.49386 10.4121 16.8345 21.0925 4 : -3.06617 4.27714 6.08404 7.03887 7.4618 5 : 6.80719 5.81418 14.4938 12.2735 10.4675 Col: 11 Row 1 : 20.4776 2 : 21.262 3 : 20.5825 4 : 14.8368 5 : 17.8374 R8ROW_UNIFORM_AB_TEST R8ROW_UNIFORM_AB sets an R8ROW to random values in [A,B]. Using initial random number seed = 123456789 The random matrix: Col: 1 2 3 4 Row 1 : 3.74735 2.52895 2.49382 2.01471 2 : 9.65054 4.06062 5.59631 9.18003 3 : 8.63607 2.87965 5.21045 4.80602 4 : 6.49356 2.35063 8.03739 2.75636 5 : 5.32246 7.07173 8.3783 2.10894 R8VEC_PRINT_TEST R8VEC_PRINT prints an R8VEC. The R8VEC: 1: 123.456 2: 5e-06 3: -1e+06 4: 3.14159 R8VEC_RUNNING_AVERAGE_TEST R8VEC_RUNNING_AVERAGE returns the running averages of an R8VEC. Random R8VEC: 1: -1.72373 2: 9.34476 3: 7.44264 4: 3.42543 5: 1.22961 6: -4.00822 7: -1.13633 8: -3.35065 9: -4.34257 10: 4.50949 Running averages: 1: 0 2: -1.72373 3: 3.81052 4: 5.02123 5: 4.62228 6: 3.94374 7: 2.61842 8: 2.08202 9: 1.40294 10: 0.76455 11: 1.13904 R8VEC_RUNNING_SIGN3_TEST R8VEC_RUNNING_SIGN3 returns the running sign3 of an R8VEC. Random R8VEC: 1: -1.72373 2: 9.34476 3: 7.44264 4: 3.42543 5: 1.22961 6: -4.00822 7: -1.13633 8: -3.35065 9: -4.34257 10: 4.50949 Running sign3: 1: 0 2: -1 3: 1 4: 1 5: 1 6: 1 7: 1 8: 1 9: 1 10: 1 11: 1 R8VEC_RUNNING_SUM_TEST R8VEC_RUNNING_SUM returns the running sums of an R8VEC. Random R8VEC: 1: -1.72373 2: 9.34476 3: 7.44264 4: 3.42543 5: 1.22961 6: -4.00822 7: -1.13633 8: -3.35065 9: -4.34257 10: 4.50949 Running sums: 1: 0 2: -1.72373 3: 7.62104 4: 15.0637 5: 18.4891 6: 19.7187 7: 15.7105 8: 14.5742 9: 11.2235 10: 6.88095 11: 11.3904 R8VEC_UNIFORM_AB_TEST R8VEC_UNIFORM_AB returns a random R8VEC with entries in a given range [ A, B ] For this problem: A = 10.000000 B = 20.000000 Input SEED = 123456789 Random R8VEC: 1: 12.1842 2: 19.5632 3: 18.2951 4: 15.617 5: 14.1531 6: 10.6612 7: 12.5758 8: 11.0996 9: 10.4383 10: 16.3397 Input SEED = 1361431000 Random R8VEC: 1: 10.6173 2: 14.4954 3: 14.0131 4: 17.5467 5: 17.9729 6: 10.0184 7: 18.975 8: 13.5075 9: 10.9454 10: 10.1362 Input SEED = 29242052 Random R8VEC: 1: 18.591 2: 18.4085 3: 11.231 4: 10.0751 5: 12.603 6: 19.1248 7: 11.1366 8: 13.5163 9: 18.2289 10: 12.6713 COIN_SIMULATION_TEST: Normal end of execution. 22-Dec-2018 10:16:28 diary off