Some thougts on cartesian products
cito at online.de
Sun Jan 22 13:17:25 EST 2006
Paul Rubin schrieb:
> aleax at mail.comcast.net (Alex Martelli) writes:
>>> given length. You could get a 6/49 lotto tip with something like:
>> And that would be better than the current random.sample(range(49),6) in
>> WHAT ways, exactly...?
> I think the first one would be incorrect since it samples with
> replacement. At least, it looks like it does.
No, the elements of the powerset would be sets with 6 elements each, not
tuples. So technically, it would be correct. Just horribly inefficient.
More information about the Python-list