MathGroup Archive 2009

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

Search the Archive

Re: find subsets


In[2]:= Select[Ns,MemberQ[#,b]&&MemberQ[#,c]&]

Out[2]= {{a,b,c},{b,c,d},{b,c,e}}


> Date: Sat, 7 Nov 2009 06:47:11 -0500
> From: radford.schantz at
> Subject: [mg104694] find subsets
> To: mathgroup at
> Hello,
> here is a quick question from a novice.
> First, generate a list of subsets using Subsets or KSubsets
> functions.
> 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: Re: find subsets
  • Next by Date: Re: How can I reduce the frequency of a sine wave tia sal22
  • Previous by thread: find subsets
  • Next by thread: Re: find subsets