Simulating a population sample growth/decay
OK, heres some theory that I need to improve on.
I have a population of worms, and select 20 of em to display on the stage. They have 2 colours, green and pink.
At the start there will be 10 pink and 10 green displayed.
I can click on a worm to 'eat' it, and have to get as many as i can before a timer runs out. One colour is easy to see, while the other is much more difficult, the point being that it emulates nature : the easy to see worms get eaten and their population declines.
Once the timer runs out, worms are added to teh population to replace the ones eaten in that 'round' and thats where the theory comes in. I need to replace worms representative of the total population.
For example, had the population been 100 worms, and i had eaten 10 pink worms (all those on display first round), then the population of worms would be 40 pink, 50 green. I need to replace 10 worms, but there is less pink than greens, so they arent going to make so much, i do a percentage 4/9 and 5/9.
So i make 4 pinks, and 6 greens, and start round 2, selecting 20 worms as a percentage of the total pop.
This approach works great to start, but as the pink pop declines -(gets closer to zero) it takes longer and longer (more and more rounds) to finally eliminate the pink pop, which is the opposite to how it should go : a pop should dwindle faster and faster.
Is there a diff approach i can take to this problem? I like maths but this is doing my head in a bit :crazy:
Cheerz
Dwayne