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:])


| cite | improve this answer | |
$\endgroup$

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.