(* Modeling Market Share *) sim = Table[ (marketSize = 100; initialCokeShare = 0.5; cokeSwitcher = 0.1; pepsiSwitcher = .2; cokeShare = marketSize initialCokeShare; pepsiShare = marketSize - cokeShare; leaveCoke = If[cokeShare == 0, 0, Random[BinomialDistribution[cokeShare, cokeSwitcher]]]; leavePepsi = If[pepsiShare == 0, 0, Random[BinomialDistribution[pepsiShare, pepsiSwitcher]]]; vars = {{cokeShare, pepsiShare, leaveCoke, leavePepsi}}; Do[ vars = Append[ vars, {c1 = Last[vars][[1]] - Last[vars][[3]] + Last[vars][[4]], c2 = marketSize - c1, If[c1 == 0, 0, Random[BinomialDistribution[c1, cokeSwitcher]]], If[c2 == 0, 0, Random[BinomialDistribution[c2, pepsiSwitcher]]]}], {51}]; Map[Mean, Transpose[vars]] // N), {100}]; Map[Mean, Transpose[sim]]