Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

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 thisthis.

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.

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.

added 104 characters in body
Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94

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.

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}.

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.

added 873 characters in body
Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94

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}.

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).

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}.

added 314 characters in body
Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94
Loading
Source Link
acl
  • 19.9k
  • 3
  • 66
  • 94
Loading