Noctiflorous Pansy Mulch

# npm

Have ideas to improve npm?Join in the discussion! »

## derange

1.0.1 • Public • Published

# Derange

Generate a random derangement of a set.

In combinatorial mathematics, a derangement is a permutation of the elements of a set, such that no element appears in its original position. In other words, a derangement is a permutation that has no fixed points. (Wikipedia)

## Usage

For examples of usage see the provided example.js file.

const derange = require('derange')

const derangedSet = derange([ /* your set here */ ])

### Note

Since there is no possible derangement for empty sets and sets with a single element, the ouptut of the function for this cases will be the empty set.

## Keywords

### Install

npm i derange

0

1.0.1

ISC

2.65 kB

5

### Repository

github.com/stefanalexlupu/derange