Message Boards Message Boards

4 Replies
0 Total Likes
View groups...
Share this post:

Derangements and System` Prefix

Posted 9 years ago

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 <a href="mailto:Cycles@{{1,2,3}">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?


POSTED BY: Bruce Colletti
4 Replies
Posted 9 years ago

Thanks Dan.

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.

POSTED BY: Bruce Colletti

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.

POSTED BY: Ilian Gachevski
Posted 9 years ago

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).

POSTED BY: Bruce Colletti

Also maybe some methods in this thread.

POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract