# How to calculate possible combinations of sets

1. Dec 8, 2012

### davidbdix

Posts: 10

I am a woodworker, and am designing a two part magnetic/spring lock for my blanket chest. The first part has 3 master buttons (primary buttons A, B, C), and the second part has 11 secondary buttons (1, 2, 3, ....11). What you do first is choose 1 of the 3 master buttons that opens the first part of the lock. Then out of the secondary buttons, you have to choose button(s), but the user does NOT know how many buttons need to be pressed to open the rest of the lock. The user also doesn't know if the buttons have to be pressed in a certain order OR if they can be pressed again. So, not only do you have to choose the correct master button, but the secondary buttons as well. The master control that you choose stays depressed because of a lever, but each secondary button is spring-loaded so it pushes back out when you release it. The interior of the lock (the guts) is made up of springs, neodymium magnets, steel rods, and blocks of wood (Which really should not matter because it has nothing to do with the math problem).

To sum up: You are choosing A, B, or C, and then some unknown amount of buttons #1-11. How many combination possibilities are there? Can this problem even be calculated?

2. Dec 8, 2012

### Staff: Mentor

There is an infinite amount if possible sequences of secondary buttons - if you allow sequences of arbitrary length. Just consider the options
1,1,1,... (n times), 2
For every n, this is a unique sequence to be pressed.

If buttons cannot be pressed multiple times, and the order does not matter, every button has the option "has to be pressed" or "must not be pressed" (I assume that pressing wrong buttons will not open the chest). This gives 212 possible combinations of the secondary buttons, and 3 choices for the master button, for a total of 3*212=12 288 options.

If all secondary buttons have to be pressed once, and the order does matter, you have 12!=479 001 600 possible orders. *3 for the master button -> 1 437 004 800
If those sequences can be shorter, you get even more combinations (but not so many). If they have to be shorter, the number reduces a lot.

Something else?

3. Dec 8, 2012

### davidbdix

Thank you for the reply. I expected it would be an infinite answer. I've redesigned the lock. Same scenerio as before. 3 primary buttons, 11 secondary buttons. This time, the user is aware that each secondary button can only be pressed once, and order still does not matter. Choose 1 primary button, it stays depressed. You don't know how many secondary buttons are to be pressed though. It could be 1, maybe 6, maybe 10. The real answer would be four of the eleven, but that information will not be given to 3 the user. What is the equation to solve it?

On the first part of your answer, how did you figure 212? But that is the correct scenario.

Oh, I just looked up and saw the second half of your answer. I didn't think the answer could be 12! because there are 3 different (what I call) sets. 11 buttons when you have A depressed, 11 buttons when B depressed, and 11 buttons when C depressed.

Last edited: Dec 8, 2012
4. Dec 8, 2012

### davidbdix

By the way, pressing the wrong buttons reinforces the lock. Each wrong button has a lock bar on it, sliding into the lock, making it stronger than before. :)

5. Dec 8, 2012

### Michael Redei

If the order doesn't matter, the user can choose any subset of the 11 buttons and press each one of those. So he has one decision("press it" or "don't press it") to make for each of 11 buttons, resulting in 211 = 2048 possiblities.

If he knows that he must press at least one button, and not all eleven, you must subtract those possibilities from that number, and you end up with 2046 possibilities, one correct one, and 2045 false ones.

Multiply 2046 by 3 (for the first button), and you have 6138 possibilities for the whole lock.

Does that help?

6. Dec 8, 2012

### davidbdix

great! thank you