arXiv ScienceSearch

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

Explore connections, maps & timelines

BibTeXRIS

Jichu Jiang. 2024-09-22. 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

Bounded weak solutions to cross-diffusion semiconductor model with electron-hole scattering

Semiconductor model is a system of parabolic partial differential equations with cross-diffusion phenomenon. Previous results showed that a weak solution exists and is not bounded in general. So semiconductor model was categorized as a cross-diffusion system without bounded weak solutions. In this work, we show that once the initial value is bounded, there exists a weak solution that is also bounded. The entropy method is a major tool in global existence analysis of cross-diffusion systems. We notice that traditional entropies in volume-filling cases may not provide required positive semi-definiteness result for the existence proof. In this situation, a transformation of variables technique has been applied. The product between Hessian matrix of the entropy and replacement diffusion matrix is positive semi-definite, then we apply the entropy method to show semiconductor model has a bounded weak solution.

math.PR

Global existence and uniqueness analysis of cross-diffusion multispecies chemotaxis system with volume-filling

The system of multispecies chemotaxis equations is a cross-diffusion system with volume-filling. In this work, we show that a weak solution of the two species chemotaxis system exists. The entropy method is a major tool in existence analysis of cross-diffusion systems. Previous investigations indicate that traditional entropies in volume-filling cases may not be able to provide required gradient estimates. In this situation, we upgrade existing matrix computation methods to derive gradient estimates. Due to the cross-diffusion phenomenon, the uniqueness of the weak solution to a cross-diffusion system is very difficult to prove in general. In this work, we apply the distance functional to show that when parameters of the chemotaxis system are identical, the weak solution is unique.

math.PR

Self-normalized scaled quadratic variation

The concept of a scaled quadratic variation was originally introduced by E. Gladyshev in 1961 for processes with Gaussian increments. Using certain deterministic scaling, arrived at from the covariance of the process, Gladyshev showed that the sum of scaled square increments along the dyadic partition sequence converges almost surely to a finite limit. In this paper, we propose a pathwise counterpart in which the deterministic normalization is replaced by a self-normalizing factor built from the $p$-th variation of the path along a given sequence of partitions. The resulting quantity requires no probabilistic assumption and no knowledge of a covariance structure, and its scale is both path-dependent and sensitive to the partition sequence. Under a mild regularity condition on the limiting $p$-th variation, we show that the self-normalized and the classical deterministic normalizations are comparable, and for fractional Brownian motion the two agree up to a multiplicative constant. We establish a switching behaviour in the index, and prove that for $p \ge 2$ the self-normalized scaled quadratic variation obeys a smooth-transformation formula under $C^2$ maps; at $p=2$ this recovers the known transformation rule for quadratic variation. Since only squared increments are scaled, the construction polarizes, yielding a matrix-valued scaled quadratic variation for every $p \geq 1$ for $\mathbb R^d$ valued paths. We conclude with examples beyond the Gaussian setting.

math.PR