Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Each half of x can be viewed as a subset of size q of the corresponding set: {0,1,...,pq-1} and {pq,pq+1,...,2pq-1}, respectively. This gives raise to the following code:

for x1 in Subsets(range(p*q),q):
  for x2 in Subsets(range(p*q,2*p*q),q):
    x = list(x1)+list(x2)
    List1.append(x)

Each half of x can be viewed as a subset of size q of the corresponding set: {0,1,...,pq-1} and {pq,pq+1,...,2pq-1}, respectively. This gives raise to the following code:

for x1 in Subsets(range(p*q),q):
  for x2 in Subsets(range(p*q,2*p*q),q):
    x = list(x1)+list(x2)
sorted(x1|x2)
    List1.append(x)