# Non repeating combinations with variable quantity in the set

I'll get straight into it:

The problem I'm working on is described as a lock with 12 buttons where in a certain combination, a button can only be pressed once, and the combination could be in length anywhere between 1 and 12. It asks me to calculate the number of possible combinations that would open this lock, and a "pseudo code" example of how a computer would find the combinations themselves. Now, this last part doesn't seem like it fits here, but I threw it in anyway.

So what is the process for this? I was thinking along the lines of combinations formula where the pool is 12 and choose is 1-12, and they are all added up, but I don't think this is correct as it gave me a very large number.

Thanks, Emanuel

• Large numbers are common in combinatorics. Am I correct in assuming the sequence in which the buttons are pressed matters? In that case, you would have to multiply the number of ways of choosing the numbers by the number of ways they could be arranged. – N. F. Taussig May 15 '19 at 20:02
• Sequence does not matter in this case – Emanuel Elliott May 15 '19 at 20:04
• If that is true, then the method you outlined is correct. – N. F. Taussig May 15 '19 at 20:05
• I see. Could you type something up as an answer so I can mark it as solved? Edit: I can answer myself. Thanks – Emanuel Elliott May 15 '19 at 20:11
• Alternatively, each button is either in the combination or is not, for $2^{12}$ combinations, except you need to subtract the combination with zero buttons, so $2^{12}-1$. – Mike Earnest May 15 '19 at 21:48