Fish in Pond Algorithm
How many fish in the Pond? Algorithm
One way of estimating the number of fish in a pond is to capture and mark some fish. Release the marked fish back into the pond and give them a chance to mingle back into the pond.
Now capture a new batch of fish (the sample). Count the number of marked fish in the newly captured sample.
Algorithm for Estimating fish in pond:
- Capture some fish from the pond and mark them.
- Write down the number of marked fish. Let's call this markedFish.
- Put the marked fish back into the pond and give them time to swim around and mingle.
- Take a new sample of fish. Let's call this sample.
- Count the number of marked fish in the new sample, let's call this sampleMarked.
- The estimated number of fish in the pond is the number of fish that were marked originally times the number of fish in the sample divided by the number of marked fish in the sample.
Now do the calculation.