Search for a tool
Subfactorial

Tool to compute subfactorial. Subfactorial !n is the number of derangements of n object, ie the number of permutations of n objects in order that no object stands in its original position.

Results

Subfactorial -

Tag(s) : Arithmetics,Mathematics

dCode and you

dCode is free and its tools are a valuable help in games, puzzles and problems to solve every day!
You have a problem, an idea for a project, a specific need and dCode can not (yet) help you? You need custom development? Contact-me!


Team dCode read all messages and answer them if you leave an email (not published). It is thanks to you that dCode has the best Subfactorial tool. Thank you.

This page is using the new English version of dCode, please make comments !

Subfactorial

Sponsored ads

SubFactorial Calculator !N


Also on dCode: FactorialPermutationsPrimorial

Tool to compute subfactorial. Subfactorial !n is the number of derangements of n object, ie the number of permutations of n objects in order that no object stands in its original position.

Answers to Questions

How to calculate a subfactorial?

SubFactorial n is a calculated using this formula: $$ !n = n! \sum_{k=0}^n \frac {(-1)^k}{k!} $$

You can also use the formula : $$ !n = \left [ \frac {n!}{e} \right ] $$ where [] stands for roundinghref to the closest integer.

How to write a subfactorial?

The subfactorial as the factorialhref, uses the exclamation mark as symbol but it is written to the left of the number: !N.

How to list derangements

Derangementshref (or Rencontres) are permutationshref without the one with fixed points (no item is in its original place). The number of derangementshref for n elements is subfactorial of n: n.

Derangementshref of {1,2,3,4} are {2,1,4,3}, {2,3,4,1}, {2,4,1,3}, {3,1,4,2}, {3,4,1,2}, {3,4,2,1}, {4,1,2,3}, {4,3,1,2}, and {4,3,2,1}, and so !4 = 9.

Ask a new question

Source code

dCode retains ownership of the source code of the script Subfactorial. Except explicit open source licence (free / freeware), any algorithm, applet, software (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any snippet or function (convert, solve, decrypt, encrypt, decipher, cipher, decode, code, translate) written in PHP (or Java, C#, Python, Javascript, etc.) which dCode owns rights can be transferred after sales quote. So if you need to download the Subfactorial script for offline use, for you, your company or association, see you on contact page !

Questions / Comments


Team dCode read all messages and answer them if you leave an email (not published). It is thanks to you that dCode has the best Subfactorial tool. Thank you.


Source : http://www.dcode.fr/subfactorial
© 2016 dCode — The ultimate 'toolkit' website to solve every problem. dCode