Search arXivSearch

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

The extremal process of a cascading family of branching Brownian motion

We study the asymptotic behaviour of the extremal process of a cascading family of branching Brownian motions. This is a particle system on the real line such that each particle has a type in addition to his position. Particles of type $1$ move on the real line according to Brownian motions and branch at rate $1$ into two children of type $1$. Furthermore, at rate $α$, they give birth to children too of type $2$. Particles of type $2$ move according to standard Brownian motion and branch at rate $1$, but cannot give birth to descendants of type $1$. We obtain the asymptotic behaviour of the extremal process of particles of type $2$.

math.PR

Breuer-Major Theorems for Hilbert Space-Valued Random Variables

Let $\{X_k\}_{k\in\mathbb Z}$ be a stationary Gaussian process with values in a separable Hilbert space $\mathcal H_1$, and let $G:\mathcal H_1\to\mathcal H_2$ be a measurable map into another separable Hilbert space $\mathcal H_2$. We derive a central limit theorem for the centered normalized partial sums of the Hilbert space-valued subordinated process $\{G[X_k]\}_{k\in\mathbb Z}$. Our result holds under either of two sets of sufficient conditions, formulated in terms of the transformation $G$ and the temporal and cross-sectional dependence structure of $\{X_k\}_{k\in\mathbb Z}$. These conditions coincide in finite dimensions but lead to genuinely different phenomena in the infinite-dimensional setting. The proof relies on the recently developed Fourth Moment Theorem on Hilbert spaces, leveraging tools from the infinite-dimensional Malliavin-Stein framework. We also provide continuous-time and quantitative versions of the central limit theorem. In a series of examples, we recover and strengthen limit theorems for a wide array of statistics relevant in functional data analysis, and present, as an application of our result, a novel limit theorem in the framework of neural operators.

math.PR

Controlled rough SDEs, pathwise stochastic control and dynamic programming principles

We study stochastic optimal control of rough stochastic differential equations (RSDEs). This is in the spirit of the pathwise control problem (Lions--Souganidis 1998, Buckdahn--Ma 2007; also Davis--Burstein 1992), with renewed interest and recent works drawing motivation from filtering, SPDEs, and reinforcement learning. Results include regularity of rough value functions, validity of a rough dynamic programming principles and new rough stability results for HJB equations, removing excessive regularity demands previously imposed by flow transformation methods. Measurable selection is used to relate RSDEs to "doubly stochastic" SDEs under conditioning. In contrast to previous works, Brownian statistics for the to-be-conditioned-on noise are not required, aligned with the "pathwise" intuition that these should not matter upon conditioning. Depending on the chosen class of admissible controls, the involved processes may also be anticipating. The resulting stochastic value functions coincide in great generality for different classes of controls. RSDE theory offers a powerful and unified perspective on this problem class.

math.PR