simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

combinations.md (934B)


      1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
      2 
      3 # Function combinations
      4 
      5 Compute the number of ways of picking `k` unordered outcomes from `n`
      6 possibilities.
      7 
      8 Combinations only takes integer arguments.
      9 The following condition must be enforced: k <= n.
     10 
     11 
     12 ## Syntax
     13 
     14 ```js
     15 math.combinations(n, k)
     16 ```
     17 
     18 ### Parameters
     19 
     20 Parameter | Type | Description
     21 --------- | ---- | -----------
     22 `n` | number &#124; BigNumber | Total number of objects in the set
     23 `k` | number &#124; BigNumber | Number of objects in the subset
     24 
     25 ### Returns
     26 
     27 Type | Description
     28 ---- | -----------
     29 number &#124; BigNumber | Number of possible combinations.
     30 
     31 
     32 ### Throws
     33 
     34 Type | Description
     35 ---- | -----------
     36 
     37 
     38 ## Examples
     39 
     40 ```js
     41 math.combinations(7, 5) // returns 21
     42 ```
     43 
     44 
     45 ## See also
     46 
     47 [combinationsWithRep](combinationsWithRep.md),
     48 [permutations](permutations.md),
     49 [factorial](factorial.md)