JCL Help:Permutation

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Returns nPr. i.e. permutation of R objects from N.


Pascal

 function Permutation(N: Cardinal; R: Cardinal): Float;


Parameters

Parameters Description
N: Cardinal N is the total number of available items, from which R items will be taken at a time. N must be greater than R but cannot exceed the value of the MaxFactorial constant or 0 will be returned.
R: Cardinal R is the number of items that will be selected at a time from N total items. R must be smaller than or equal to N.


Return Value

If the above mentioned constraints are met the permutation of R objects from N is returned or 1.0 if R = 0.0.


Description

Permutation returns nPr, i.e. permutation of R objects from N. Note: N must be greater than 0, R must be smaller than or equal to N and N must be smaller than the global constant MaxPermutation (1754 when Float is Extended), otherwise the function returns 0. A permutation is the number of unique ways you can organize R items taken from a pool of N items. For example, [Red, Blue, Green] is not the same permutation as [Green, Blue, Red].


About

Unit

JclStatistics


Donator

ESB Consultancy


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page