@@ -0,0 +1,496 @@
+'''%0ACTCI chapter 18.3%0AWrite a method to randomly generate a set of m integers from an array of size n.%0AEach element must have equal probability of being chosen%0A'''%0A%0Aimport random%0A%0Adef SubsetGenerator(array,m):%0A    subset = %5B%5D%0A    for i in range(m):%0A        ind = random.randint(1,len(array)-i)+i-1%0A        subset.append(array%5Bind%5D)%0A        array%5Bind%5D = array%5Bi%5D      %0A    return subset%0A%0Aif __name__==%22__main__%22:%0A   array = %5B1,2,3,4,5,6,7,8,9%5D%0A   subset = SubsetGenerator(array,3)%0A   print subset%0A

Create GenerateSubsets.py