An urn contains a azure balls and c carmine balls, where a > 0 and c > 0. Balls
are selected from the urn at random and discarded, until the first time a selected ball
has a color different from its predecessor. That ball is then replaced, and the
procedure is restarted. The process continues until the last ball is discarded. Show
that this last ball is equally likely to be azure or carmine.


In particular, it is asserted that P(last ball is azure) = P(last ball is carmine) = 1/2, and that this
probability is independent of the initial values of a and c. The exercise quoted above asks the reader to
prove this fact. Here you will merely demonstrate the claim experimentally.


Notice that, unlike most other random processes we’ve studied, the probability of selecting a particular
color changes after each ball is discarded. It’s as if we’re flipping a weighted coin that changes its
probabilities after each flip.


Let the total number of balls be 100, so that a + c = 100, and let a = 10, 50 and 90, respectively. Run
2000 trials of the experiment for each value of a, and calculate the relative frequency of the last ball
discarded being azure, in each case.

HOW WOULD YOU PROGRAM THIS IN PYTHON??

Respuesta :