Best-case Analysis of MergeSort with an Application to the Sum of Digits Problem, A manuscript (MS) v2
Marek A. Suchenek

TL;DR
This paper derives a simple, efficient formula for the minimal number of comparisons in MergeSort and connects it to the sum of binary digits problem, providing insights into algorithm analysis and number theory.
Contribution
It introduces a new, less complex formula for MergeSort comparisons and links it to the sum of binary digits, showing no closed-form exists for the formula.
Findings
The formula can be evaluated in logarithmic time.
There is no closed-form expression for the minimal comparisons.
Results extend to the sum of binary digits problem.
Abstract
An exact formula \[ B(n) = \frac{n}{2}(\lfloor \lg n \rfloor + 1) - \sum _{k=0} ^{\lfloor \lg n \rfloor} 2^k Zigzag(\frac{n}{2^{k+1}}), \] where \[ Zigzag (x) = \min (x - \lfloor x \rfloor, \lceil x \rceil - x), \] for the minimal number of comparisons of keys performed by on an -element array is derived and analyzed. The said formula is less complex than any other known formula for the same and can be evaluated in time, where is a constant. It is shown that there is no closed-form formula for the above. Since the recurrence relation for the minimal number of comparisons of keys for is identical with a recurrence relation for the number of 1s in binary expansions of all integers between and (exclusively), the above results extend to the sum of binary digits problem.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsVLSI and Analog Circuit Testing · VLSI and FPGA Design Techniques · graph theory and CDMA systems
