Reptorian's Combinatorics Library: Combinations
Description
Combinations are selections of elements where order does not matter.For example, the sequences { 1,2,3 } and { 3,2,1 } represent
the same combination.
Examples:
rep_ncr_combinations(s)_
Standard combinations where elements are selectedwithout repetition.
$ +rep_ncr_combinations 5,3 repeat w { e[0] {I[#-1,$>]} }
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,1,2
[gmic]./ 0,1,3
[gmic]./ 0,1,4
[gmic]./ 0,2,3
[gmic]./ 0,2,4
[gmic]./ 0,3,4
[gmic]./ 1,2,3
[gmic]./ 1,2,4
[gmic]./ 1,3,4
[gmic]./ 2,3,4
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (10,1,1,3) [120 b of float32].
data = (0,0,0,0,0,0,1,1,1,2^1,1,1,2,2,3,2,2,3,3^2,3,4,3,4,4,3,4,4,4).
min = 0, max = 4, mean = 2, std = 1.41421, coords_min = (0,0,0,0), coords_max = (2,0,0,2).
[gmic]./ End G'MIC interpreter.
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,1,2
[gmic]./ 0,1,3
[gmic]./ 0,1,4
[gmic]./ 0,2,3
[gmic]./ 0,2,4
[gmic]./ 0,3,4
[gmic]./ 1,2,3
[gmic]./ 1,2,4
[gmic]./ 1,3,4
[gmic]./ 2,3,4
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (10,1,1,3) [120 b of float32].
data = (0,0,0,0,0,0,1,1,1,2^1,1,1,2,2,3,2,2,3,3^2,3,4,3,4,4,3,4,4,4).
min = 0, max = 4, mean = 2, std = 1.41421, coords_min = (0,0,0,0), coords_max = (2,0,0,2).
[gmic]./ End G'MIC interpreter.
rep_r_combination(s)_
Combinations with repetition allowed.$ +rep_r_combinations 4,3 repeat w { e[0] {I[#-1,$>]} }
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,0,0
[gmic]./ 0,0,1
[gmic]./ 0,0,2
[gmic]./ 0,0,3
[gmic]./ 0,1,1
[gmic]./ 0,1,2
[gmic]./ 0,1,3
[gmic]./ 0,2,2
[gmic]./ 0,2,3
[gmic]./ 0,3,3
[gmic]./ 1,1,1
[gmic]./ 1,1,2
[gmic]./ 1,1,3
[gmic]./ 1,2,2
[gmic]./ 1,2,3
[gmic]./ 1,3,3
[gmic]./ 2,2,2
[gmic]./ 2,2,3
[gmic]./ 2,3,3
[gmic]./ 3,3,3
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (20,1,1,3) [240 b of float32].
data = (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,3^0,0,0,0,1,1,1,2,2,3,1,1,1,2,2,3,2,2,3,3^0,1,2,3,1,2,3,2,3,3,1,2,3,2,3,3,2,3,3,3).
min = 0, max = 3, mean = 1.5, std = 1.11803, coords_min = (0,0,0,0), coords_max = (19,0,0,0).
[gmic]./ End G'MIC interpreter.
[gmic]./ Start G'MIC interpreter (v.3.7.3).
[gmic]./ 0,0,0
[gmic]./ 0,0,1
[gmic]./ 0,0,2
[gmic]./ 0,0,3
[gmic]./ 0,1,1
[gmic]./ 0,1,2
[gmic]./ 0,1,3
[gmic]./ 0,2,2
[gmic]./ 0,2,3
[gmic]./ 0,3,3
[gmic]./ 1,1,1
[gmic]./ 1,1,2
[gmic]./ 1,1,3
[gmic]./ 1,2,2
[gmic]./ 1,2,3
[gmic]./ 1,3,3
[gmic]./ 2,2,2
[gmic]./ 2,2,3
[gmic]./ 2,3,3
[gmic]./ 3,3,3
[gmic]./ Display image [0] = '[unnamed]'.
[0] = '[unnamed]':
size = (20,1,1,3) [240 b of float32].
data = (0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,3^0,0,0,0,1,1,1,2,2,3,1,1,1,2,2,3,2,2,3,3^0,1,2,3,1,2,3,2,3,3,1,2,3,2,3,3,2,3,3,3).
min = 0, max = 3, mean = 1.5, std = 1.11803, coords_min = (0,0,0,0), coords_max = (19,0,0,0).
[gmic]./ End G'MIC interpreter.
Commands
Combinations:
| rep_ncr_combinations | rep_ncr_combination_index2list | rep_ncr_combination_list2index |
| rep_r_combinations | rep_r_combination_index2list | rep_r_combination_list2index |


Home
Download
News
Mastodon
Bluesky
X
Summary - 18 Years
Summary - 17 Years
Summary - 16 Years
Summary - 15 Years
Summary - 13 Years
Summary - 11 Years
Summary - 10 Years
Resources
Technical Reference
Scripting Tutorial
Video Tutorials
Wiki Pages
Image Gallery
Color Presets
Using libgmic
G'MIC Online
Community
Discussion Forum (Pixls.us)
GimpChat
IRC
Report Issue