Permutations in Wolfram Alpha

200 Views Asked by At

So, the program has to print all possible permutations of a set A with elements {x, y, z, w, u, t}, with length of 3, which accomplish this condition: 'u' must not appear after 't'. I know how to find all possible permutations like this:

A = {x, y, z, w, u, t}; Permutations[A, {3}]

But i can't figure it out how to print only the permutations where 'u' doesn't appear after 't'. Any help ?

1

There are 1 best solutions below

0
On BEST ANSWER

Use DeleteCases.

DeleteCases[Permutations[A, {3}], {___, t, ___, u, ___}]