Skip to contents

A ball is drawn and one of the other colour is added. With b0 blue and r0 red balls (total \(T_0\)), the expected difference after \(n\) steps is \(D_0 (T_0-1)/(T_0+n-1)\), which solves the one-step recursion \(E[D_{n+1}] = E[D_n](1 - 1/T_n)\) (Research.P4.Friedman.meanDiff_succ) and tends to zero (difference_mean_tendsto); the mean share \(1/2 + E[D_n]/(2T_n)\) tends to one half (mean_share_tendsto_half). The quantity \((B-R)(B+R-1)\) is a martingale (friedman_step). Same-colour reinforcement (morie_feedback_loop_urn_law) gives a random limit; the cross-colour rule gives a deterministic one.

Usage

morie_friedman_urn(b0, r0, n = 100L)

Arguments

b0, r0

Starting counts of the two colours; b0 + r0 > 1.

n

Number of steps to tabulate.

Value

A data frame with one row per step: step, total, mean_diff and mean_share.

References

Grimmett G, Stirzaker D (2020). Probability and Random Processes, 4th ed., Exercise 12.3.6. Oxford.

Examples

tail(morie_friedman_urn(b0 = 9, r0 = 1, n = 50), 3)
#>    step total mean_diff mean_share
#> 49   48    58  1.263158  0.5108893
#> 50   49    59  1.241379  0.5105202
#> 51   50    60  1.220339  0.5101695