Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: subsets of a set

  • To: mathgroup at
  • Subject: [mg70083] Re: subsets of a set
  • From: dimmechan at
  • Date: Mon, 2 Oct 2006 00:34:24 -0400 (EDT)
  • References: <efld41$d3i$>

Thanks to everyone that reply to me.


Î?/Î? dimmechan at έγÏ?αÏ?ε:
> In page 226 of John Gray's Mastering Mathematica
> (unfortunately I had the 1994's edition)
> there is the following exercise:
> "Given a finite set (presented as a list) and an integer k
> find all k-element subsets of the set".
> There is one solution however for practicing (no there is no professor
> that asked me this for homeworks! I work individually...) I search for
> other
> So considering the following list
> lst = Tuples[Range[7], 3];
> I can erase the sublists containg at least two same elements
> Cases[lst, {x_, y_, z_} /; x ß?  y && x ß?  z && y ß?  z]
> but after I cannot erase the permutations of e.g. {1,2,3};
> that is in the output there are the sublists {1,2,3},
> {2,1,3},{3,1,2} e.t.c. for other triplets.
> I look for both functional as well pattern matching approaches.
> Thanks

  • Prev by Date: Re:ArcTan[-Infinity, y] always returning 0?
  • Next by Date: Re: equation question
  • Previous by thread: RE: subsets of a set
  • Next by thread: Re: general