mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2026-03-13 08:51:02 +08:00
Add integer partition.
This commit is contained in:
33
src/algorithms/math/integer-partition/README.md
Normal file
33
src/algorithms/math/integer-partition/README.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# Integer Partition
|
||||
|
||||
In number theory and combinatorics, a partition of a positive
|
||||
integer `n`, also called an **integer partition**, is a way of
|
||||
writing `n` as a sum of positive integers.
|
||||
|
||||
Two sums that differ only in the order of their summands are
|
||||
considered the same partition. For example, `4` can be partitioned
|
||||
in five distinct ways:
|
||||
|
||||
```
|
||||
4
|
||||
3 + 1
|
||||
2 + 2
|
||||
2 + 1 + 1
|
||||
1 + 1 + 1 + 1
|
||||
```
|
||||
|
||||
The order-dependent composition `1 + 3` is the same partition
|
||||
as `3 + 1`, while the two distinct
|
||||
compositions `1 + 2 + 1` and `1 + 1 + 2` represent the same
|
||||
partition `2 + 1 + 1`.
|
||||
|
||||
Young diagrams associated to the partitions of the positive
|
||||
integers `1` through `8`. They are arranged so that images
|
||||
under the reflection about the main diagonal of the square
|
||||
are conjugate partitions.
|
||||
|
||||

|
||||
|
||||
## References
|
||||
|
||||
- [Wikipedia](https://en.wikipedia.org/wiki/Partition_(number_theory))
|
||||
Reference in New Issue
Block a user