If you dive deep into Tolkien fandom, a recurring question is "How many elves were there at any time?" Now, Tolkien cared a lot about languages and moon phases, but his attitude toward demographics or non-human food production would be an insult to good handwaving, so this is hard to answer well. The one hard number is that Turgon brought 10,000 troops to the Battle of Unnumbered Tears. We also have a couple of proportions, and then a whole mass of "the greater part".
Also, in the older Fall of Gondolin, 12 named companies muster to the defense of Gondolin; a company of around 800 people would give 9600 defenders. Under the circumstances you'd think *everyone* who could fight would be...
In the past I've just made a range of estimates of how 10,000 relates to the population of Gondolin and applied averages to the rest, but I thought I would try estimating all the ranges. At which point a Monte Carlo simulation is more useful than just multiplying minima and maxima. Since I wanted the answer ASAP I did it in straight Python, not R or Octave or some library. Being lazy, I used uniform distribution for the ranges.
Kind of my first non-class Monte Carlo? Apart from some old C programs that were simply simulating dice outcomes like 3d6 and "4d6, top 3" and such.
Edit: whoops! I found a bad error in my original code. If I'm trying to go from 10,000 Noldor+Sindar soldiers to a "Noldor in Valinor" population, I need to *multiply* by the fraction of Noldor in Gondolin, not divide!
Instead of pasting code I'll just link: https://mindstalk.net/noldor.py
The first thing I learned is that when you're doing 9 divisions, the small-divisor outliers meant that I needed lot more bins than I thought at first.
95% likely over 50,000, 95% likely under 1 million; 90% likely over 70,000, 90% likely under 680,000. 90% confidence interval is 50,000-1 million, 80% confidence is 70,000-680,000.
Possible range is 8000 -- definitely too small -- to almost 9 million.
Also, in the older Fall of Gondolin, 12 named companies muster to the defense of Gondolin; a company of around 800 people would give 9600 defenders. Under the circumstances you'd think *everyone* who could fight would be...
In the past I've just made a range of estimates of how 10,000 relates to the population of Gondolin and applied averages to the rest, but I thought I would try estimating all the ranges. At which point a Monte Carlo simulation is more useful than just multiplying minima and maxima. Since I wanted the answer ASAP I did it in straight Python, not R or Octave or some library. Being lazy, I used uniform distribution for the ranges.
Kind of my first non-class Monte Carlo? Apart from some old C programs that were simply simulating dice outcomes like 3d6 and "4d6, top 3" and such.
Edit: whoops! I found a bad error in my original code. If I'm trying to go from 10,000 Noldor+Sindar soldiers to a "Noldor in Valinor" population, I need to *multiply* by the fraction of Noldor in Gondolin, not divide!
Instead of pasting code I'll just link: https://mindstalk.net/noldor.py
The first thing I learned is that when you're doing 9 divisions, the small-divisor outliers meant that I needed lot more bins than I thought at first.
95% likely over 50,000, 95% likely under 1 million; 90% likely over 70,000, 90% likely under 680,000. 90% confidence interval is 50,000-1 million, 80% confidence is 70,000-680,000.
Possible range is 8000 -- definitely too small -- to almost 9 million.