Skip to content

Commit 761a16c

Browse files
committed
Update README.md
1 parent f0d2609 commit 761a16c

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ console.log(cmb.toArray());
6060
]
6161
````
6262

63-
### permutationCombination
63+
### permutation of combination
6464
````
6565
cmb = Combinatorics.permutationCombination(['a','b','c']);
6666
console.log(cmb.toArray());
@@ -99,9 +99,7 @@ console.log(cp.toArray());
9999
]
100100
````
101101

102-
### baseN
103-
104-
Builds a number represented as an array.
102+
### base N
105103

106104
````
107105
baseN = Combinatorics.baseN(['a','b','c'], 3);
@@ -146,7 +144,7 @@ console.log(baseN.toArray())
146144
+ .`factorial(n)`
147145
calculates `n!`
148146
+ .`factoradic(n)`
149-
returns the factoradic representation of n in array, *LSB ORDER*. See
147+
returns the factoradic representation of n in array, *in least significant order*. See
150148
http://en.wikipedia.org/wiki/Factorial_number_system
151149

152150

@@ -180,6 +178,13 @@ but more efficient.
180178

181179
Creates a generator which generates the cartesian product of the arrays. All arguments must be arrays with more than one element.
182180

181+
#### Combinatorics.baseN( _ary_ , _nelem_ )
182+
183+
Creates a generator which generates _nelem_ -digit "numbers" where each digit is element in _ary_ .
184+
Note this "number" is in least significant order.
185+
186+
When _nelem_ is ommited, _ary_.length is used.
187+
183188
### Generator Methods
184189

185190
All generators have following methods:
@@ -225,7 +230,7 @@ Same as _generator_`.length`
225230

226231
#### .nth(n)
227232

228-
Available for `power` and `cartesianProduct` generator which returns the *n*th element.
233+
Returns the *n*th element (starting 0). Available for `power`, `cartesianProduct` and `baseN`.
229234

230235
#### .get(x0, ...)
231236

0 commit comments

Comments
 (0)