combination lock

## combination lock

 Sat Jul 18 19:27:12 2015   by   13W Hi,I'm looking to find the odds of rolling a certain combination of numbers. For example, if the combination is 24467 and the players are rolling 12d6, what are the odds that they roll the combination? Thanks in advance for any help. Mon Jul 20 09:16:52 2015   by   Torben I don't quite understand how you would go from 12d6 to 24467.  If you just add 12d6, you would get nowhere near this number, and if you use the dice as digits, you have too many digits and none that could be 7.  You can, of course, assign a number to each of the possible outcomes of rolling 12d6, but there are many ways to do so, so I can't really help unless you specify more precisely what you mean. Mon Jul 20 09:28:40 2015   by   13W Sorry for the confusion, poor example with the 7, should have been a 5. I want to count the number of times certain numbers show up after rolling 12d6. In the example I gave above, I want to spot at least: one [2], two [4]s, one [6] and one [5] of the 12 dice rolled. I would like to be able to test different length "combinations" if possible (ex. three digit, four digit, etc.) Mon Jul 20 09:35:55 2015   by   13W Sorry for the confusion, poor example with the 7, should have been a 5. I want to count the number of times certain numbers show up after rolling 12d6. In the example I gave above, I want to spot at least: one [2], two [4]s, one [6] and one [5] of the 12 dice rolled. I would like to be able to test different length "combinations" if possible (ex. three digit, four digit, etc.) Mon Jul 20 10:34:19 2015   by   13W Sorry for the confusion, poor example with the 7, should have been a 5. I want to count the number of times certain numbers show up after rolling 12d6. In the example I gave above, I want to spot at least: one [2], two [4]s, one [6] and one [5] of the 12 dice rolled. I would like to be able to test different length "combinations" if possible (ex. three digit, four digit, etc.) Mon Jul 20 14:04:00 2015   by   Torben For that you can use the multiset difference operator (--).  The following should do it:`if {2,4,4,5,6} -- 12d6 then "not found" else "found"`The idea is that we remove the dice found in 12d6 from the combination.  If that leaves an empty multiset (which is a false condition for the if-then-else), we have found the combination, otherwise we have not.This particular combination has a 39.39% chance of being found by 12d6. Mon Jul 20 16:27:00 2015   by   13W Thank you! I appreciate your quick response and the time and effort you place into maintaining Troll.