I am new to the language, I'm sure this question will sound very easy to most of you!
I would like to have a program which takes a set of strings and returns the subset of those strings with hamming weight n. I tried to do it like this:
Spaceweight[dim2_, n] := Module[{listi, weight, listinew},
listinew = {};
listi = SpaceF[dim2];
For[cc = 1 <= Length[listi], cc++,
If[DigitCount[listi, 2, 1] = n, listinew = Append[listinew, listi]];
Return[listinew]];
]
but it doesn't even pretend to work. How would you go about doing this?
Thanks, Mary