Question: Generating every possible set, from the elements of a larger set.

Hi,

 

I'm having trouble getting to grips with this problem.  I have a set of 21 objects A:={a,b,c,d,e etc} and I want to create another set B of length 10 consisting of some of the elements of A. I then want to carry out a test on B.  However, I then want to repeat the proccess for another set B and another and another until all possible set Bs have been tested. For example

A:={a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u} #This set is constant and should never change

B:={a,b,c,d,e,f,g,h,i,j}: #Define B

Test(B) # Apply the test to B and print the result (This result will always be either zero or a scalar equation)

B:={a,b,c,d,e,f,g,h,i,k}: # Define a new B

Test(B) # Carry out the test on the new B

B:= .... etc

 

Obviously doing this by hand isn't feasable, I need a loop of some kind but am having trouble writing one. I need every unique B that one can make from A.  The test is fairly simply and can be done within a loop, so B need not be a global variable (it need only exist within the loop).  Any help would be appreciated!

Please Wait...