0
$\begingroup$

Attaching a code that generates unique combinations of 8 letters but, it still lacks a condition wherein all letters should have equal counts per column. For my code, basically, letter a to h should show 26 times per column.

options(max.print=999999999) product <- c("a", "b", "c","d","e","f","g","h") p <- length(product) fin=unique(t(sapply(1:208, function(x) sample(product, p)))) nrow(fin) == factorial(p) fin

$\endgroup$
0
$\begingroup$

There are a lot!

def all_permutations(prefix, lst):
    if 0==len(lst):
        yield prefix
    else:
        for i in range(len(lst)):
            all_permutations(prefix+lst[i], lst[:i]+lst[i+1:])


$\endgroup$

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.