Skip to content

Instantly share code, notes, and snippets.

@tempodat
tempodat / puzzle.py
Created April 20, 2024 14:59
N rabbits in a bag - numerical solution
"""
A numeric solution for a probability question I thought about,
It's similar to a "n marbles in a bag" type question: If I had
some rabbits that grow year by year, and every year I chose one
rabbit at random, noted its age and replaced it with a baby)
so out of N integers (each rabbits age), one of them gets swapped
with zero and then they all grow by one. What's the average age
of the rabbits i'm pulling out?
"""