COMBOSET - Subsets of a set S of size n - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP Prime Software Library (/forum-15.html) +--- Thread: COMBOSET - Subsets of a set S of size n (/thread-7892.html) |
COMBOSET - Subsets of a set S of size n - Han - 03-07-2017 02:25 AM Usage: COMBOSET(set, size) where set is a set of objects, and size refers to the desired size of the subsets. Example: COMBOSET({1, "b", (2,-1), [1,2], 3.14}, 3) { {1,"b",2-i}, {1,"b",[1,2]}, {1,"b",3.14}, {1,2-i,[1,2]}, {1,2-i,3.14}, {1,[1,2],3.14}, {"b",2-i,[1,2]}, {"b",2-i,3.14}, {"b",[1,2],3.14}, {2-i,[1,2],3.14} } Code: EXPORT COMBOSET(s,n) See also: http://www.hpmuseum.org/forum/thread-2845.html http://www.hpmuseum.org/forum/thread-7759.html |