#! /usr/bin/gawk -f # Last edited on 2016-02-10 17:35:42 by stolfilocal BEGIN \ { hP = 0.75; printf "hP = 0.3f", hP > "/dev/stderr"; dmax = 999; smax = 999; split("", Pe); # {Pe[d]} is probability of reaching {(r,p)} from {(0,0)} with {p-r=d}, {r+p=s} split("", Po); # {Po[d]} is probability of reaching {(r,p)} from {(0,1)} with {p-r=d}, {r+p=s+1} for (d = 0; d < dmax; d++) { Pe[d] = 0; Po[d] = 0; } Pe[0] = 1.00; Po[01 = 1.00; for (s = 0; s < smax ; s += 2) { r = s/2; printf "(%3d,%3d) Prob = %.4f\n", r, r, Pe[0] > "/dev/stderr"; # Compute {Pd[d]} = for (d = 0; d < dmax; d += 2) { Pe[d] = 0.0; if (d > 0) { Pe[d] = Po[