Skip to content

MasMedIm/derangement

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Get the number of permutations of a set of elements, such that no element appears in its original position.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors