Message Boards Message Boards

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

Derangements and System` Prefix

Posted 10 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 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?

Thanks.

POSTED BY: Bruce Colletti
4 Replies

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 10 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
Posted 10 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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract