Is there a Mathematica 10.2 function (or option) that creates derangements?
Since one doesn’t seem to exist, I’ve used Combinatorica’s Derangement function. To avoid conflicts between Combinatorica and Mathematica, I prefix Mathematica functions with System, e.g., SystemCycles@{{1,2,3}} rather than simply Cycles@{{1,2,3}} (if Combinatorica isn’t loaded).
But it’s irritating to constantly type this prefix. Is there a way to avoid typing the prefix when Combinatorica is loaded?
It isn’t difficult to define one’s own Derangements function in a line or two of WL code. See this thread on StackOverflow for some very efficient implementations.
Thanks, Ilian. I’ll use one of these if there’s indeed no built-in functionality (in the kernel) like Combinatorica’s Derangements function (which I’m now using but want to avoid because of the conflicts with the kernel).
This is eerie: although I had been concerned about creating all derangements, I ended the workday wondering about the value of random derangements – the very matter that your link addressed! I had forgotten all about MathGroup.
In addition to being scary smart, the Wolfram Team apparently has ESP. That always helps in securing the marketplace and in product development.