// output of ./demo/comb/combination-chase-demo.cc: // Description: //% Combinations (n choose k) in a strong minimal-change order. //% The delta set is generated. //% Algorithm C, "Chase's sequence", TAOCP 4A/1, pp.367. //% Phillip J. Chase: Combination generation and graylex ordering, //% Congressus Numerantium, vol.69, pp.215-242, (1989) arg 1: 7 == n [Combinations (n choose k): n>=1] default=7 arg 2: 3 == k [ 1<=k<=n] default=3 1: { 4, 5, 6 } ....111 2: { 2, 5, 6 } ..1..11 3: { 0, 5, 6 } 1....11 4: { 1, 5, 6 } .1...11 5: { 3, 5, 6 } ...1.11 6: { 3, 4, 6 } ...11.1 7: { 2, 4, 6 } ..1.1.1 8: { 0, 4, 6 } 1...1.1 9: { 1, 4, 6 } .1..1.1 10: { 1, 2, 6 } .11...1 11: { 0, 2, 6 } 1.1...1 12: { 0, 1, 6 } 11....1 13: { 0, 3, 6 } 1..1..1 14: { 1, 3, 6 } .1.1..1 15: { 2, 3, 6 } ..11..1 16: { 2, 3, 4 } ..111.. 17: { 0, 3, 4 } 1..11.. 18: { 1, 3, 4 } .1.11.. 19: { 1, 2, 4 } .11.1.. 20: { 0, 2, 4 } 1.1.1.. 21: { 0, 1, 4 } 11..1.. 22: { 0, 1, 2 } 111.... 23: { 0, 1, 3 } 11.1... 24: { 0, 2, 3 } 1.11... 25: { 1, 2, 3 } .111... 26: { 1, 2, 5 } .11..1. 27: { 0, 2, 5 } 1.1..1. 28: { 0, 1, 5 } 11...1. 29: { 0, 3, 5 } 1..1.1. 30: { 1, 3, 5 } .1.1.1. 31: { 2, 3, 5 } ..11.1. 32: { 2, 4, 5 } ..1.11. 33: { 0, 4, 5 } 1...11. 34: { 1, 4, 5 } .1..11. 35: { 3, 4, 5 } ...111. binomial(7, 3)=35