Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm very bad at maths and I've a situation where I need to find number of combinations for a real world situation.

I've 50 files and set of permissions can be given to users on those files such as View, Create, Edit, Delete and Distribute.

Now a user who has Create permission on a file, he should have View permission as well and this permission hierarchy is given below:

  • Delete - Highest level
  • Edit
  • Create
  • View - Lowest level in permission hierarchy

Which means if user has permission to delete a file then he should have all the other 3 permissions.

Also for Distribute permission he should have View permission and distribute forms a different hierarchy.

Now each user can be assigned with different set of permissions on each file, for ex: User1 can have View, Distribute permission on File1 and all permissions on File2 and so on with other 48 files with different permission set.

Now with this combination if I see all the permissions on all 50 files as a single set for a user with satisfying the permission hierarchy condition, how many combinations of permissions can be assigned to a single user? How can I find this value

share|cite|improve this question
up vote 2 down vote accepted

If I understand your question correctly, there are nine possible permissions a user can have for a given file:

  1. Delete (and all permissions below it)
  2. Delete (and all permissions below it) + Distribute
  3. Edit (and all permissions below it)
  4. Edit (and all permissions below it) + Distribute
  5. Create (and all permissions below it)
  6. Create (and all permissions below it) + Distribute
  7. View
  8. View + Distribute
  9. Nothing

Since there are 9 choices for each of your 50 files, there are $9^{50}$ possible sets of permissions. This arises from the fact that you have 9 possibilities per file and 50 files, so you multiply all 50 of the 9's together.

share|cite|improve this answer

You need to calculate the number of possible permissions per user per file. If I have read your guidance correctly, this is $9$ (Nothing, View, Create, Edit, Delete, with the last four possibly combined with Distribute).

You then need to combine this with the number of files to get $9^{50}$ possibilities per user. This is about $5 \times 10^{47}$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.