Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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|improve this question
add comment

2 Answers 2

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|improve this answer
add comment

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|improve this answer
add comment

Your Answer

 
discard

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.