SearcharxivSearch

arXiv · 2404.11170

Relating bubble sort to birthday problem

Abstract

Birthday problem is a well-known classic problem in probability theory widely applied in cryptography, and bubble sort is a popular sorting algorithm leading to some interesting theoretical problems in computer science. However, the relation between bubble sort and birthday problem has not been discovered. By relating bubble sort to birthday problem, based on a generalization of Poisson limit theorem for dissociated random variables, this paper offers an intuitive explanation to naturally indicate that $\displaystyle \frac{n - P_{n}}{\sqrt{n}}$ converges in distribution to the standard Rayleigh distribution, where $P_{n}$ is the number of passes required to bubble sort $n$ distinct elements. Then asymptotic distributions and statistical characteristics of bubble sort and birthday problem are presented. Moreover, this paper discovers that some common optimizations of bubble sort could lead to average performance degradation.

Explore related subjects

Keep this discovery

BibTeXRIS

Jichu Jiang. 2024-04-17. Relating bubble sort to birthday problem. https://arxiv.org/abs/2404.11170

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

Averaging principles for nonautonomous multiscale stochastic Burgers equations with reflection

In this paper, we study averaging principles for nonautonomous multiscale stochastic Burgers equations with reflection. First, we derive a general averaging principle applicable to such equations under minimal assumptions. Subsequently, since the coefficients of the obtained averaged equation still depend on the small scaling parameter $\e$, we impose either periodic or asymptotic conditions on the coefficients, thereby obtain two distinct averaged equations whose coefficients are independent of $\e$ and establish two averaging principles. Stopping times and Khasminskii's time discretization schemes play an important role. Finally, a concrete example is provided to illustrate the applicability and validity of the theoretical results.

math.PR

Spectral properties of Random Matrices

We give the theoretical foundations of random matrix theory through the definitions of a random matrix, a random probability measure and the corresponding empirical spectral distribution. The technical tool we use is the Stieltjes transform method through which we prove optimal convergence of the empirical spectral distribution of random sample covariance matrices to the deterministic Marchenko-Pastur distribution. We also give new results about the rigidity of the eigenvalues of this random sample covariance matrix and the rate of their convergence. We then define the Dyson equation method to prove new local laws about a random matrix model that interpolates between the Marchenko-Pastur distribution, the elliptical law and the circular law. Through our work these local laws can be considered universal.

math.PR

Moments approach for the elephant random walk

We discuss the method of moments for the one-dimensional elephant random walk (ERW). We first derive a differential recurrence relation for the characteristic function of the ERW, which yields a corresponding system of recurrence relations for its moments. We then obtain asymptotic approximations for the moments in each of the three parameter regimes of the ERW. Finally, by establishing the convergence of the moments and verifying the corresponding moment-determinacy conditions, we identify the limiting distributions of the ERW in each regime.

math.PR