Happy to help! I actually intentionally left in some ambiguity between small and big averages because I wasn't quite sure how the calculation worked. I just checked and learned something new!
The rule for calculating an Average of X (where X > 2) is to remove exactly \[ \lceil 0.05 * X \rceil \] solves from the top and the bottom (the cut-off brackets represent the
ceiling function). In layman's terms, this means that you take 5% of the number X, and round it up to the nearest whole number. This actually works for both "small" and "big" averages; here are some examples:
Average of 5: 5% of 5 = 0.25, which rounds up to 1. Drop 1 solve on each side.
Average of 20: 5% of 20 = 1, which cannot be rounded up further. Drop 1 solve on each side.
Average of 21: 5% of 21 = 1.05, which rounds up to 2. Drop 2 solves on each side (?!?!?!)
It might be surprising that you actually end up dropping over 19% of solves in an average of 21 instead of the ideal 10% for big averages, but this is actually how csTimer calculates an ao21! You can check yourself by going to Settings -> Statistics -> Statistical indicators -> Custom, and then typing in ao21. If you input 21 times and click on the time for your average of 21, you'll see 4 times in parentheses. (Putting a time in parentheses is the standard way to show it doesn't count in an average.)
Keep in mind, this particular edge case (for weird things like average of 21) might be slightly less standardized - I'm not sure if every timer uses the ceiling function in the same way csTimer does. The only one I've actually checked is csTimer, but seeing as it's kind of the gold standard for timers nowadays, I'd guess that most other timers follow a similar rule. It is pretty straightforward too, since it doesn't require distinguishing between big and small averages. Maybe some older cubers who know more about where this standard originated can comment.
