// Program to solve for probabilities of a specific game. s = 0 for i=0 to 100 s = s + i pe1 = s / 101 println["Projected earnings: " + pe1] s = 0 for i=0 to 100 { if i < pe1 // If projected earnings are less than you'd get from a s = s + pe1 // new ball, draw a new ball. else s = s + i // Otherwise take it. } pe2 = s / 101 println["Projected earnings: " + pe2] s = 0 for i=0 to 100 { if i < pe2 s = s + pe2 else s = s + i } pe3 = s / 101 println["Projected earnings: " + pe3]