Scala Simulation for the Galton-Watson Process
The Galton-Watson process is the anchor of many genetic studies and has been extensively studied in several scholarly articles. Mostly by mathematical means. This scala code takes another approach and can run thoudand and millions of Monte Carlo Simulations to estimate the survival probabilities of lineages (seedNodes) with various lambda value (i.e. average number of descendants).
The advantage of the simulation approach is that simulations can easily be extended with lot more complex models, while mathematical approach has significant limitation when increasing the complexity.
More on Galton-Watson Process : https://en.wikipedia.org/wiki/Galton%E2%80%93Watson_process
Enjoy the experimentation.