Combinations and permutations: Difference between revisions

Content deleted Content added
Steenslag (talk | contribs)
Clarify task description. Promote from draft to full task status.
Line 1:
{{draft task|Probability and statistics}}{{draft task|Discrete math}}
{{wikipedia|Combination}} {{wikipedia|Permutation}}
 
;Task:
Implement the [[wp:Combination|combination]] (<sup>n</sup>C<sub>k</sub>) and [[wp:Permutation|permutation]] (<sup>n</sup>P<sub>k</sub>) operators in the target language:
* <math>^n\operatorname C_k =\binom nk = \frac{n(n-1)\ldots(n-k+1)}{k(k-1)\dots1} </math>
Line 6 ⟶ 8:
See the wikipedia articles for a more detailed description.
 
'''To test''', generate and print examples of:
* PermutationsA sample of permutations from 1 to 12 and Combinations from 10 to 60 using exact Integer arithmetic.
* PermutationsA sample of permutations from 5 to 15000 and Combinations from 100 to 1000 using approximate Floating point arithmetic.<br> This 'floating point' code could be implemented using an approximation, e.g., by calling the [[Gamma function]].
This 'floating point' code could be implemented using an approximation, e.g., by calling the [[Gamma function]].
 
'''See Also:'''
* [[Evaluate binomial coefficients]]
{{Template:Combinations and permutations}}
 
=={{header|ALGOL 68}}==
{{works with|ALGOL 68|Revision 1 - one minor extension to language used - PRAGMA READ, similar to C's #include directive.}}