Logo

PERMUT

Updated 2024-03-13 13:08:02.540000

Syntax

SELECT [westclintech].[wct].[PERMUT] (
   <@Number, float,>
  ,<@Number_chosen, float,>)

Description

Use the scalar function PERMUT to calculate the number of permutations for a given number objects that can be selected from a number of objects. Use PERMUT to calculate combinations where the ordering of objects is significant. Use BICO where the ordering of objects is not significant.

P_{n,r}=\frac{n!}{(n-r)!}

Arguments

@Number_chosen

is any positive number describing the number of objects in each permutation. @Number_chosen is an expression of type float or of a type that can be implicitly converted to float.

@Number

is any positive number describing the number of objects. @Number is an expression of type float or of a type that can be implicitly converted to float.

Return Type

float

Remarks

If @Number = 0, PERMUT returns an error.

If @Number_chosen < 0, PERMUT returns an error.

Both @Number and @Number_chosen are truncated to zero decimal places.

Examples

Select wct.PERMUT(14, 3);

This produces the following result.

{"columns":[{"field":"column 1","headerClass":"ag-right-aligned-header","cellClass":"ag-right-aligned-cell"}],"rows":[{"column 1":"2184"}]}