The maximum population of a planet is calculated by the following formula:
0.02 * (PQ + 1) ^ 3
Where PQ is the planet's quality rating.
For example, the maximum population of a PQ10 world is calculated as:
0.02 * (10 + 1) ^ 3 = 0.02 * 11 * 11 * 11 = 26.62 billion people