MathGroup Archive 2009

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

Search the Archive

find subsets

  • To: mathgroup at
  • Subject: [mg104694] find subsets
  • From: r_poetic <radford.schantz at>
  • Date: Sat, 7 Nov 2009 06:47:11 -0500 (EST)

here is a quick question from a novice.

First, generate a list of subsets using Subsets or KSubsets

Ns = KSubsets[{a,b,c,d,e},3] = {{a,b,c},{a,b,d},{a,b,e},{a,c,d}, etc.}

How can one infer from that list a list of its members that contain
given elements, e.g. a list of members that contain b, or those that
contain both b and c? For illustration:

Some_function[Ns, b and c] = { {a,b,c},{b,c,d},{b,c,e}}

I keep thinking there must be a direct way to do this using Select or
some other function?

  • Prev by Date: Clustering (question)
  • Next by Date: Mathematica Installation SELinux
  • Previous by thread: Re: Clustering (question)
  • Next by thread: Re: find subsets