Skip to main content Accessibility help
Hostname: page-component-684bc48f8b-kbg4c Total loading time: 0.255 Render date: 2021-04-12T16:44:21.964Z Has data issue: true Feature Flags: { "shouldUseShareProductTool": true, "shouldUseHypothesis": true, "isUnsiloEnabled": true, "metricsAbstractViews": false, "figures": false, "newCiteModal": false, "newCitedByModal": true }

Analysis of swaps in radix selection

Published online by Cambridge University Press:  01 July 2016

Amr Elmasry
University of Copenhagen
Hosam Mahmoud
The George Washington University
Rights & Permissions[Opens in a new window]


Radix Sort is a sorting algorithm based on analyzing digital data. We study the number of swaps made by Radix Select (a one-sided version of Radix Sort) to find an element with a randomly selected rank. This kind of grand average provides a smoothing over all individual distributions for specific fixed-order statistics. We give an exact analysis for the grand mean and an asymptotic analysis for the grand variance, obtained by poissonization, the Mellin transform, and depoissonization. The digital data model considered is the Bernoulli(p). The distributions involved in the swaps experience a phase change between the biased cases (p ≠ ½) and the unbiased case (p = ½). In the biased cases, the grand distribution for the number of swaps (when suitably scaled) converges to that of a perpetuity built from a two-point distribution. The tool for this proof is contraction in the Wasserstein metric space, and identifying the limit as the fixed-point solution of a distributional equation. In the unbiased case the same scaling for the number of swaps gives a limiting constant in probability.

General Applied Probability
Copyright © Applied Probability Trust 2011 


Part of this work was carried out while the author was at Max-Planck-Institut für Informatik. The author is currently on leave from Alexandria University of Egypt.


Barbour, A. D., Holst, L. and Janson, S. (1992). Poisson Approximation. Oxford University Press.Google Scholar
Chung, K. L. (1974). A Course in Probability Theory, 2dn edn. Academic Press, New York.Google Scholar
Cormen, T. H., Leiserson, C. E., Rivest, R. L. and Stein, C. (2001). Introduction to Algorithms, 2nd edn. MIT Press, Cambridge, MA.Google Scholar
De La Briandais, R. (1959). File searching using variable length keys. In Proc. Western Joint Computer Conf., AFIPS, San Francisco, CA, pp. 295298.Google Scholar
Fagin, R., Nievergelt, J., Pippenger, N. and Strong, H. (1979). Extendible hashing—a fast access method for dynamic files. ACM Trans. Database Systems 4, 315344.CrossRefGoogle Scholar
Feller, W. (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd edn. John Wiley, New York.Google Scholar
Fill, J. A. and Janson, S. (2004). The number of bit comparisons used by Quicksort: an average-case analysis. In Proc. ACM-SIAM Symp. Discrete Algorithms, Association for Computing Machinery, New York, pp. 300307.Google Scholar
Fill, J. A. and Nakama, T. (2008). Analysis of the expected number of bit comparisons required by Quickselect. In Proc. 10th Workshop Algorithm Engineering and Experiments and the 5th Workshop on Analytic Algorithmics and Combinatorics, Society for Industrial and Applied Mathematics, Philadelphia, PA, pp. 249256.Google Scholar
Flajolet, P., Gourdon, X., and Dumas, P. (1995). Mellin transforms and asymptotics: harmonic sums. Theoret. Comput. Sci. 144, 358.CrossRefGoogle Scholar
Fredkin, E. (1960). Trie memory. Commun. ACM 3, 490499.CrossRefGoogle Scholar
Hoare, C. A. R. (1962). Quicksort. Comput. J. 5, 1015.CrossRefGoogle Scholar
Hollerith, H. (1894). The electric tabulating machine. J. Roy. Statist. Soc. 57, 678682.CrossRefGoogle Scholar
Hwang, H.-K. and Tsai, T.-H. (2002). Quickselect and the Dickman function. Combinatorics Prob. Comput. 11, 353371.CrossRefGoogle Scholar
Jacquet, P. and Szpankowski, W. (1998). Analytical depoissonization and its applications. Theoret. Comput. Sci. 201, 162.CrossRefGoogle Scholar
Knape, M. and Neininger, R. (2008). Approximating perpetuities. Methodology Comput. Appl. Prob. 10, 507529.CrossRefGoogle Scholar
Knuth, D. E. (1998). The Art of Computer Programming, Vol. 3, 2nd edn. Addison-Wesley, Reading, MA.Google Scholar
Lent, J. and Mahmoud, H. M. (1996). Average-case analysis of multiple Quickselect: an algorithm for finding order statistics. Statist. Prob. Lett. 28, 299310.CrossRefGoogle Scholar
Mahmoud, H. M. (2000). Sorting. Wiley-Interscience, New York.CrossRefGoogle Scholar
Mahmoud, H. M. (2010). Distributional analysis of swaps in Quick Select. Theoret. Comput. Sci. 411, 17631769.CrossRefGoogle Scholar
Mahmoud, H. M. and Ward, M. D. (2008). Average-case analysis of cousins in m-ary tries. J. Appl. Prob. 45, 888900.Google Scholar
Mahmoud, H. M., Modarres, R. and Smythe, R. T. (1995). Analysis of QUICKSELECT: an algorithm for order statistics. RAIRO Inf. Théor. Appl. 29, 255276.CrossRefGoogle Scholar
Mahmoud, H., Flajolet, P., Jacquet, P. and Régnier, M. (2000). Analytic variations on bucket selection and sorting. Acta Informatica 36, 735760.CrossRefGoogle Scholar
Martı´nez, C. and Prodinger, H. (2009). Moves and displacements of particular elements in quicksort. Theoret. Comput. Sci. 410, 22792284.CrossRefGoogle Scholar
Mehlhorn, K. (1984). Data Structures and Algorithms. Springer, Berlin.Google Scholar
Prodinger, H. (1995). Multiple Quickselect–Hoare's Find algorithm for several elements. Inform. Process. Lett. 56, 123129.CrossRefGoogle Scholar
Sedgewick, R. (1977). The analysis of Quicksort programs. Acta Informatica 7, 327355.CrossRefGoogle Scholar
Sedgewick, R. (1978). Implementing quicksort programs. Commun. ACM 21, 847857.CrossRefGoogle Scholar
Sedgewick, R. (1980). Quicksort. Garland, New York.Google Scholar
Sedgewick, R. (1998). Algorithms in C, Parts 1–4, 3nd edn. Addison-Wesley, Reading, MA.Google Scholar
Stuart, A. and Ord, J. (1987). Kendall's Advanced Theory of Statistics, Vol. 1, 5th edn. Oxford University Press, New York.Google Scholar
Vallée, B., Clément, J., Fill, J. A. and Flajolet, P. (2009). The number of symbol comparisons in quicksort and quickselect. In Automata, Languages and Programming (Lecture Notes Comput. Sci. 5555), eds Albers, S. et al., Springer, Berlin, pp. 750763.CrossRefGoogle Scholar

Full text views

Full text views reflects PDF downloads, PDFs sent to Google Drive, Dropbox and Kindle and HTML full text views.

Total number of HTML views: 0
Total number of PDF views: 190 *
View data table for this chart

* Views captured on Cambridge Core between September 2016 - 12th April 2021. This data will be updated every 24 hours.

Access Access

Send article to Kindle

To send this article to your Kindle, first ensure is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about sending to your Kindle. Find out more about sending to your Kindle.

Note you can select to send to either the or variations. ‘’ emails are free but can only be sent to your device when it is connected to wi-fi. ‘’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Analysis of swaps in radix selection
Available formats

Send article to Dropbox

To send this article to your Dropbox account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Dropbox.

Analysis of swaps in radix selection
Available formats

Send article to Google Drive

To send this article to your Google Drive account, please select one or more formats and confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your <service> account. Find out more about sending content to Google Drive.

Analysis of swaps in radix selection
Available formats

Reply to: Submit a response

Your details

Conflicting interests

Do you have any conflicting interests? *