find subsets
- To: mathgroup at smc.vnet.net
- Subject: [mg104694] find subsets
- From: r_poetic <radford.schantz at mms.gov>
- Date: Sat, 7 Nov 2009 06:47:11 -0500 (EST)
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?
- Follow-Ups:
- Re: find subsets
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: find subsets
- From: Tomas Garza <tgarza10@msn.com>
- Re: find subsets