Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Combination List

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78132] Re: Combination List
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Sat, 23 Jun 2007 07:17:56 -0400 (EDT)

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