Abstract
Consider a totally ordered set S of n elements; as an example, a set of tennis players and their rankings. Further assume that their ranking is a total order and thus satisfies transitivity and anti-symmetry. Following Yao [29], an element (player) is said to be (i, j)-mediocre if it is neither among the top i nor among the bottom j elements of S. More than 40 years ago, Yao suggested a stunningly simple algorithm for finding an (i, j)-mediocre element: Pick \(i+j+1\) elements arbitrarily and select the \((i+1)\)-th largest among them. She also asked: “Is this the best algorithm?” No one seems to have found such an algorithm ever since.
We first provide a deterministic algorithm that beats the worst-case comparison bound in Yao’s algorithm for a large range of values of i (and corresponding suitable \(j=j(i)\)). We then repeat the exercise for randomized algorithms; the average number of comparisons of our algorithm beats the average comparison bound in Yao’s algorithm for another large range of values of i (and corresponding suitable \(j=j(i)\)); the improvement is most notable in the symmetric case \(i=j\). Moreover, the tight bound obtained in the analysis of Yao’s algorithm allows us to give a definite answer for this class of algorithms. In summary, we answer Yao’s question as follows: (i) “Presently not” for deterministic algorithms and (ii) “Definitely not” for randomized algorithms. (In fairness, it should be said however that Yao posed the question in the context of deterministic algorithms.)
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
We could formulate a general algorithm for finding an (i, j)-mediocre element, acting differently in a specified range, as we did for the deterministic algorithm in Sect. 2. However, for clarity, we preferred to specify it in this way.
References
Ajtai, M., Komlós, J., Steiger, W.L., Szemerédi, E.: Optimal parallel selection has complexity \(O(\log \log {n})\). J. Comput. Syst. Sci. 38(1), 125–133 (1989)
Alexandrescu, A.: Fast deterministic selection. In: Proceedings of the 16th International Symposium on Experimental Algorithms (SEA 2017), June 2017, London, pp. 24:1–24:19 (2017)
Baase, S.: Computer Algorithms: Introduction to Design and Analysis, 2nd edn. Addison-Wesley, Reading (1988)
Battiato, S., Cantone, D., Catalano, D., Cincotti, G., Hofri, M.: An efficient algorithm for the approximate median selection problem. In: Bongiovanni, G., Petreschi, R., Gambosi, G. (eds.) CIAC 2000. LNCS, vol. 1767, pp. 226–238. Springer, Heidelberg (2000). https://doi.org/10.1007/3-540-46521-9_19
Bent, S.W., John, J.W.: Finding the median requires \(2n\) comparisons. In: Proceedings of the 17th Annual ACM Symposium on Theory of Computing (STOC 1985), pp. 213–216. ACM (1985)
Blum, M., Floyd, R.W., Pratt, V., Rivest, R.L., Tarjan, R.E.: Time bounds for selection. J. Comput. Syst. Sci. 7(4), 448–461 (1973)
Chen, K., Dumitrescu, A.: Select with groups of 3 or 4. In: Dehne, F., Sack, J.R., Stege, U. (eds.) WADS 2015. LNCS, vol. 9214, pp. 189–199. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-21840-3_16. arXiv.org/abs/1409.3600
Cormen, T.H., Leiserson, C.E., Rivest, R.L., Stein, C.: Introduction to Algorithms, 3rd edn. MIT Press, Cambridge (2009)
Cunto, W., Munro, J.I.: Average case selection. J. ACM 36(2), 270–279 (1989)
Dor, D., Håstad, J., Ulfberg, S., Zwick, U.: On lower bounds for selecting the median. SIAM J. Discrete Math. 14(3), 299–311 (2001)
Dor, D., Zwick, U.: Finding the \(\alpha n\)-th largest element. Combinatorica 16(1), 41–58 (1996)
Dor, D., Zwick, U.: Selecting the median. SIAM J. Comput. 28(5), 1722–1758 (1999)
Dumitrescu, A.: A selectable sloppy heap. Algorithms 12(3), 58 (2019). https://doi.org/10.3390/a12030058
Dumitrescu, A.: Finding a mediocre player (2019, preprint). arXiv.org/abs/1901.09017
Edelkamp, S., Weiß, A.: QuickMergesort: practically efficient constant-factor optimal sorting, preprint available at arXiv.org/abs/1804.10062
Floyd, R.W., Rivest, R.L.: Expected time bounds for selection. Commun. ACM 18(3), 165–172 (1975)
Fussenegger, F., Gabow, H.N.: A counting approach to lower bounds for selection problems. J. ACM 26(2), 227–238 (1979)
Hadian, A., Sobel, M.: Selecting the \(t\)-th largest using binary errorless comparisons. Comb. Theory Appl. 4, 585–599 (1969)
Hoare, C.A.R.: Algorithm 63 (PARTITION) and algorithm 65 (FIND). Commun. ACM 4(7), 321–322 (1961)
Hyafil, L.: Bounds for selection. SIAM J. Comput. 5(1), 109–114 (1976)
John, J.W.: A new lower bound for the set-partitioning problem. SIAM J. Comput. 17(4), 640–647 (1988)
Kaplan, H., Kozma, L., Zamir, O., Zwick, U.: Selection from heaps, row-sorted matrices and X+Y using soft heaps (2018, preprint). http://arXiv.org/abs/1802.07041
Kirkpatrick, D.G.: A unified lower bound for selection and set partitioning problems. J. ACM 28(1), 150–165 (1981)
Knuth, D.E.: The Art of Computer Programming, Volume 3: Sorting and Searching, 2nd edn. Addison-Wesley, Reading (1998)
Mitzenmacher, M., Upfal, E.: Probability and Computing: Randomized Algorithms and Probabilistic Analysis. Cambridge University Press, Cambridge (2005)
Motwani, R., Raghavan, P.: Randomized Algorithms. Cambridge University Press, Cambridge (1995)
Paterson, M.: Progress in selection. In: Karlsson, R., Lingas, A. (eds.) SWAT 1996. LNCS, vol. 1097, pp. 368–379. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-61422-2_146
Schönhage, A., Paterson, M., Pippenger, N.: Finding the median. J. Comput. Syst. Sci. 13(2), 184–199 (1976)
Yao, F.: On lower bounds for selection problems. Technical report MAC TR-121, Massachusetts Institute of Technology, Cambridge (1974)
Yap, C.K.: New upper bounds for selection. Commun. ACM 19(9), 501–508 (1976)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Dumitrescu, A. (2019). Finding a Mediocre Player. In: Heggernes, P. (eds) Algorithms and Complexity. CIAC 2019. Lecture Notes in Computer Science(), vol 11485. Springer, Cham. https://doi.org/10.1007/978-3-030-17402-6_18
Download citation
DOI: https://doi.org/10.1007/978-3-030-17402-6_18
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-17401-9
Online ISBN: 978-3-030-17402-6
eBook Packages: Computer ScienceComputer Science (R0)