This question is from a Permutations assignment, the question is…