Simplifying expression with ceil

108 Views Asked by At

How can I simplify the following? $\lceil \frac{x}{\lceil \frac{x}{y} \rceil}\rceil$ I'm dealing with partitioning data for processing, where x is the total input size and y is the maximum chunk size per processing batch job, and I want to keep the chunks as even as possible. The above gives me the actual chunk size to use. For example, with a total size of 605 and maximum specified at 500, I launch two jobs of sizes 303 and 302 respectively. But it seems to me there should be a more concise way to compute this than doing, say if it were Python, math.ceil(x/math.ceil(x/y)). Ran it by wolframalpha but it wouldn't simplify it, so my next stop is here.