Mathematics seems the best place for this but happy to move questions to another community if you decide.
I want to translate pseudocode into mathematical notation for the following for loop but am having a problem translating it.
To briefly describe the problem: it's demographics. I have population figures for large geographic areas (bigzones) and independent population figures for smaller geographic areas (smallzones) that nest within bigzones.I am finding the ratio of each bigzone population to sum of the smallzones within each bigzone.
For bigzone_i (1 to n)
divide valueA-bigzone_i by sum valueB-smallzone_j (1 to m)
Where 'smallzones' are areas with valueA nested within 'bigzones' that have a valueB.
I have writtenthis LaTeX statement but not sure that it captures the process or I've used standard notation.
bigzone_{i} . \frac{\sum_{j=1}^n smallzone_{ValueB}}{bigzoneValueB_i}
If you want to find the ratio of "bigzone" population to sum of "smallzone" populations within the "bigzone", then let $B_i$ be the population of the $i^{th}$ "bigzone" and $S_{i,j}$ the population of the $j^{th}$ "smallzone" within the $i^{th}$ "bigzone". Then for $1≤i≤n$, your desired ratio $R_i$ is $$R_i=\frac{B_i}{\sum_{j=1}^mS_{i,j}}$$ or its reciprocal.