PRiMAL
Explore with PRogramming, Math, and ALgorithms...
(under construction)


Blindsort
Blindsort is a new esoteric sorting algorithm (unpublished) invented by me. With Blindsort, an array $a[1\ldots n]$ of elements cannot be read, copied, or explicitly modified. The only available operation is a blind swap swap(i,j), which swaps the two elements $a[i]$ and $a[j]$. If a swap operation ever places an element in its correct position, then that element becomes frozen. When all elements are frozen, the array is sorted. Sort the array in the fastest way! The closest idea to Blindsort is a very different algorithm called Gorosort that appeared in Google Code Jam 2011 (an archive can be found here).

The obvious starting point for this problem is the algorithm, either deterministic or randomized (for instance, one could repeatedly choose two random elements to swap). Programming follows, which could then provide a way to empirically compute the running time in terms of the number of swaps on some (random) input. With desmos, one can visualize data points, overlay different functions, and immediately observe the effect of parameters on those functions. For instance, one could plot $cn$, $cn\log n$, $cn^2$, etc..., and observe changes using a sliding bar for parameter $c$. This helps to conjecture a complexity for the running time before resorting to a rigorous time analysis. For randomized algorithms, the analysis of the expected running time may be harder, so one could either seek lower and upper bounds instead or, if ambitious, calculate it anyway. One can then ask the natural question: Can I improve on the running time (thus revisiting the algorithmic aspect)?

Since frozen elements can be ignored, Blindsort shifts the focus from permutations, as the mathematical object of sorting, to derangements, which provides us with a different fresh setting that is typically not studied. Advanced questions can consider a lower bound on the time of the best deterministic blind sorting, the worst derangement for any given fixed algorithm, and special cases such as the effect of a bound $k\ll n$ on the number of distinct elements.