0
$\begingroup$

This question already has an answer here:

How do we create a list pair from the below list

list1={11,12,13,14,15,16};

desired pair list

listpair={{11,11},{11,12},{11,13},...,{11,16},{12,12},{12,13},...,{12,16},{13,13},{13,14},...,{13,16},...,{16,16}}
$\endgroup$

marked as duplicate by Coolwater, MarcoB, Community Mar 28 '18 at 5:52

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ Have you seen Subsets[] or Tuples[]? $\endgroup$ – J. M. will be back soon Mar 27 '18 at 13:14
  • $\begingroup$ I have seen Tuples although I could not use it I suspected my choice. Once again I will try. $\endgroup$ – monfneg Mar 27 '18 at 13:21
  • $\begingroup$ Tuples generates some unwanted terms such as {12,11}. $\endgroup$ – monfneg Mar 27 '18 at 13:25
  • $\begingroup$ Subsets does not generate {12,12} or {13,13} $\endgroup$ – monfneg Mar 27 '18 at 13:25
2
$\begingroup$
Select[Tuples[list1, 2], #[[1]] <= #[[2]] &];

How about this?

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.