derangement

1.0.1 • Public • Published

To know !

Suppose that a professor gave a test to 4 students – A, B, C, and D – and wants to let them grade each other's tests. Of course, no student should grade his or her own test. How many ways could the professor hand the tests back to the students for grading, such that no student received his or her own test back?

Use this library to know the result !

Based on this formula :

Formula

Getting Started

npm i derangement

Importing

let derangementOf = require('derangement')

How to use it ?

Pretty straightforward :

console.log(derangementOf(5))
44

Contributing

To contribute, please submit problems in the Issues tab, or give better implementations with a direct Pull request

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Package Sidebar

Install

npm i derangement

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

4.94 kB

Total Files

5

Last publish

Collaborators

  • azermite