1 year ago

#232235

test-img

Richard Qi

Count the number of permutations

Hey I'm taking a DS&A course, and we had an interesting homework question regarding counting permutations. The problem is the following:

There is are N(N <= 15) people each with an id from 1 to N. All N people have a list of numbers they will accept. You have an array of size N numbers called A. You can permutate A however you like. For each permutation, the first number in A goes to the first person, the second number goes to the second person, and so on. What is the number of permutations of A where, for every person, their assigned number in A is also in their list?

I've tried thinking about using directed graphs, but couldn't figure it out. Could someone point me in the right direction?

Thanks!

graph

dynamic-programming

permutation

combinatorics

directed-graph

0 Answers

Your Answer

Accepted video resources