Ok to post 1. EstGR := proc(p, i, N, K) local c, prob, r, cle; r := 0; c := 0; prob := 0; while r < K do cle := GRt(p, i, N); prob := prob + cle[1]; c := c + cle[2]; r := r + 1; end do; prob := prob/K; c := c/K; print('ProbabilityOfExitingAWinner', prob); print('AverageDurationofGame', c); RETURN([prob, c]); end proc 2. A. The linear homogeneous equation is true because it takes into account the probability of either outcome being ½. The boundary conditions are true because not tossing a coin will result in a zero probability, and at N times will add to 1. B. yN(i) = i/N satisfies the same recurrence and boundary conditions as xN(i) because plugging in any value of i into the recurrence will give i/N. 0 would return 0 and N would return 1 satisfying the win and loss conditions, so we can write the formula xN(i) = i/N. C. The recurrence is true because the number of coin flips is equal to the number of rounds, so it is true to find the number of rounds. The boundary conditions are true because it takes at least 1 flip to receive an outcome. D. Plugging in zN(i) returns i(N-1), and since the boundary conditions are equal to 0, it can be written EN(i) = i(N-i). 3. ExtractFairGR := proc(i, N) local a, b, c, d; a := i; b := 0; while 0 < a and a < N do c := RandomVariable(Bernouli(i/N)); b := b + 1; d := trunc(Sample(c, 1)[1]); if d = 0 then a := a - 1; else a := a + 1; end if; end do; RETURN([i/N, b]); end proc; a := 1; while a <= 19 do ExactFairGR(a, 20); EstGR(1/2, a, 20, 3000); end do; 4. ExtractFairGR := proc(i, N) local a, b, c, d; a := i; b := 0; while 0 < a and a < N do c := RandomVariable(Bernouli(i/N)); b := b + 1; d := trunc(Sample(c, 1)[1]); if d = 0 then a := a - 1; else a := a + 1; end if; end do; RETURN([i/N, b]); end proc; a := 1; while a <= 19 do ExactFairGR(a, 20); EstGR(1/2, a, 20, 3000); end do; Software would not show a result