A game is played between a gambler and a banker. A fair coin is tossed repeatedly in
Question:
A game is played between a gambler and a ’banker’. A fair coin is tossed repeatedly in a sequence of identical experiments. The probability of heads is, 0 ≤ p ≤ 1, and if this occurs, the gambler wins 1 unit. The probability of tails is q = 1 − p; if this arises, the gambler loses 1 unit. The gambler starts the game with k pounds.
Part A:
Note:
The game ends when either:
(a) the gambler is bankrupt (has £0) and is ruined.
(b) the gambler reaches a total of N pounds, has won the game, and retires.
Write a MATLAB that calculates and plot the following parameters:
Number of times Gambler Wins.
Number of iteration when a total of N pounds has been collected by gambler.
A table with each iteration result and accumulative balance of gambler and banker simultaneously.
Part B:
If a toss of coin is unfair in a sequence of identical experiment having 70% of heads occurrences, then determine:
No of Wins of banker against gambler.
Calculate the overall winner of Gambling after 100 events.
Probability and Statistical Inference
ISBN: 978-0321923271
9th edition
Authors: Robert V. Hogg, Elliot Tanis, Dale Zimmerman