Did I understand correctly?
Subsets[Range[1, 16], {2}]
EDIT: If you want to use Permutations
, you could use
DeleteDuplicates[Permutations[Range[16], {2}], Sort[#1] == Sort[#2] &]
which deletes all "duplicates", where "duplicate" is defined by the equality of the two lists when sorted (ie, {2,3}
is "equal" to {3,2}
for purposes of this comparison).
EDIT: The meaning of #1
and #2
may be demonstrated by this example:
f={#1,#2}&
and then f[a,b]
evaluates to {a,b}
. That is, you are defining a pure function which takes two arguments, returning a list containing the two arguments, and assigning it to f
. This could also be useful.
In the DeleteDuplicates
example above, I am using as a test function (see second usage example in the documentation and also this example) that considers two lists equal if they are the same after sorting; thus, {3,4}
is equal to {4,3}
, since when sorted they both become {3,4}
.
See also this.
Subsets[list, {2}]
. $\endgroup$