All pastes #941874 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-14 00:39 UTC
rendered paste body
Here is the challenge: Start out with a bag of 100 beans, 50 black and 50 white. RANDOMLY draw pairs of beans (you can get black-black, black-white, and white-white), until all of the beans are removed from the bag. Remove 90% of the white-white pairs (if you had 10 white-white pairs, remove 9 of the pairs, leaving 1 pair (2 beans)). Remove 50% of the white-black and black-black pairs (if you have 10 black-black pairs, remove 5, and if you have 10 black-white pairs, remove 5). Store the number of beans left in file, marking the # of white beans and the # of black beans. Calculate the percentage of white beans left over and the percentage of black beans left over. If, of the remaining beans, 40% are white and 60% are black, replenish the bean population in the bag to 40 whites and 60 blacks. Again, draw pairs of beans randomly until there are no more beans left in the bag. Rinse & Repeat, FIVE TIMES. Be sure to write to file all the relevant numbers.