27-Jul-2021 21:14:20 coin_simulation_test(): MATLAB/Octave version 9.9.0.1467703 (R2020b). 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: -2.02003 2: -3.65451 3: 3.14547 4: -2.56417 5: -4.92839 6: 3.18903 7: 4.45988 8: 0.896659 9: 3.51225 10: -3.75117 Running averages: 1: 0 2: -2.02003 3: -2.83727 4: -0.843022 5: -1.27331 6: -2.00432 7: -1.13877 8: -0.33896 9: -0.184508 10: 0.226243 11: -0.171498 R8VEC_RUNNING_SIGN3_TEST R8VEC_RUNNING_SIGN3 returns the running sign3 of an R8VEC. Random R8VEC: 1: 2.51379 2: -3.70888 3: -1.22009 4: -2.40457 5: -4.50953 6: 8.14737 7: -4.13376 8: 2.01384 9: 4.11022 10: 0.365834 Running sign3: 1: 0 2: 1 3: -1 4: -1 5: -1 6: -1 7: -1 8: -1 9: -1 10: 0.808382 11: 1 R8VEC_RUNNING_SUM_TEST R8VEC_RUNNING_SUM returns the running sums of an R8VEC. Random R8VEC: 1: 1.69422 2: 6.9434 3: 7.20647 4: -0.455217 5: -1.29719 6: 0.840032 7: -2.53543 8: 6.26803 9: -4.09157 10: -3.62995 Running sums: 1: 0 2: 1.69422 3: 8.63762 4: 15.8441 5: 15.3889 6: 14.0917 7: 14.9317 8: 12.3963 9: 18.6643 10: 14.5728 11: 10.9428 coin_simulation_test(): Normal end of execution. 27-Jul-2021 21:14:30