MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Combination List


On 6/22/07 at 6:35 AM, BC at gmail.com (Bruno Campanini) wrote:

>Not exactly.

>Tuples[Range[3],2]  gives:
>1 1
>1 2
>1 3
>2 1
>2 2
>2 3
>3 1
>3 2
>3 3

>I need instead unique values:

>1 1
>1 2
>1 3
>2 2
>2 3
>3 3

Then either

Union[Sort/@Tuples[Range@3,2]]

or

Union[Tuples[Range@3, 2], SameTest -> (Sort@#1 === Sort@#2 &)]

will do the trick
--
To reply via email subtract one hundred and four


  • Prev by Date: bug in Integrate
  • Next by Date: Re: Quick Question
  • Previous by thread: Re: Combination List
  • Next by thread: Re: Combination List