I often run into a situation where I'd like to generate a set of permutations with at most $n$ elements (here $n = 5$):
Permutations[{"t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13"}, 5]
I'd like to also specify that a specific subset of elements always appears in each subset (without generating the entire list of permutations and scanning through it, or scanning through the permutations in lexicographic order: Generating a permutation of elements in chunks). For example, could one generate a list of all length $n = 5$ permutations for the above example where the subset of elements {"t2","t5","t7"}
always appears (in any order)?
Is there a (fast) way to ask Mathematica to do this? One solution would be to ask for all length $q = 2$ subsets of {"t1","t2","t3","t4","t5","t6","t7","t8","t9","t10","t11","t12","t13"}
, concatenate these subsets with the list {"t2","t5","t7"}
, generate the permutations for each subset, then concatenate each list of permutations. However, is there maybe a nicer solution?