Combinations and permutations: Difference between revisions

Content deleted Content added
m →‎{{header|Tcl}}: Some notes
m tidy up description
Line 1:
{{draft task|Probability and statistics}}{{draft task|Discrete math}}
{{wikipedia|Combination}} {{wikipedia|Permutation}}
Implement the [[wp:Combination|combination]] (<sup>n</sup>C<sub>k</sub>) and [[wp:Permutation|permutation]] (<sup>n</sup>P<sub>k</sub>) Operatorsoperators in the target language:
* <math> ^nC_k =\binom nk = \frac{n(n-1)\ldots(n-k+1)}{k(k-1)\dots1} </math>
* <math>^nP_k = n\cdot(n-1)\cdot(n-2)\cdots(n-k+1)</math>
c.f.See Wikipediathe wikipedia articles for a more detailed description.
 
'''To test, generate and print examples of:'''
* Permutations from 1 to 12 and Combinations from 10 to 60 using exact Integer arithmetic.
* Permutations from 5 to 15000 and Combinations from 100 to 1000 using approximate Floating point arithmetic.
** (This 'floating point' code could be implemented using an approximation, e.g., by calling the [[Gamma function]].)
 
=={{header|ALGOL 68}}==