I have a game I am trying to analyze. It is based on the simultaneous rolling of three dice. I wrestled with the logic in my head a number of times before settling on this method:
Generate a list of all 3-permutations of (1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6). Filter this list based on whatever criterion (sums to 9, is a run, etc). Then divide the length of the filtered list by the number of 3-permutations.
I then played the game according to this logic (generating expected values for bets and playing all those bets that have a positive expected value), and it seems sound, though I admit my sample size was rather small (about 50 plays). But something in the back of my head says these odds have not been calculated correctly.
My first inclination was to use combinations, because it didn’t really matter if the dice came up 1 2 3 or 2 1 3, it was still a run. But really the question was not the number of combinations, but the number of times some combination would appear, which led me to the “filter the permutations” route. Have I gone wrong?
I am a little fuzzy on your question but it sounds like you are wondering if, when generating all possible dice rolls, you should take into account the order of the dice. That is, should you consider 123 and 213 to be the same roll.
The answer is no. You must consider all possibilities, taking into account the order of the dice, even if the order isn’t important to how your game works. You would enumerate all possible throws as
111
112
113
114
115
116
121
122
123
etc.
This because, for example, there are 6 ways to roll a 1, a 2, and a 3 if you don’t care about order, but there is only one way to roll three 1’s. So 123 has to be represented as 6 times more frequent than 111.
I really don’t understand what you mean by “permute 3 dice” and “3-permute”. Look: How many ways are there to make the first choice? How many for the second? How many for the third? Just multiply those three numbers and you’ll have your number of permutations.
I think you are asking whether listing all of the possible ways to choose three numbers from the set of {1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6} will give you the possible ways that the dice can come up. The answer is no. There are 181716 ways to choose three numbers from that set*, and that yields 4,896 possible results. But this is wrong, because if you choose, say the first three elements of this set, you have selected a result that represents three numbers thrown on one die, and no numbers from the other two dice.
You can easily enumerate all the possibilities by the process I started in my post above. There are 666 = 216 possibilities.
There are 18 numbers you can choose for the first number. That leaves 17 for the second and 16 for the third, or 1817*16 different ways to choose all three.
The sample space here is just the set all triples of the form (x, y, z) where each of x, y and z is in the set {1, 2, 3, 4, 5, 6}. Since you’re assuming each die is fair, all triples are equally likely, and so the probability of getting a triple with any particular property is just the number of triples with that property divided by the total number of triples.
To the OP: Your terminology is somewhat muddled, but if I get the gist of what you’re trying to do, it’s the following … you roll three dice and you want to know the probability that some event A will result, e.g., the three dice add up to some number, the three dice are all odd, etc. The way to do this is to first count all the possible outcomes that are possible when you toss the three dice. The answer to that is 6x6x6=216. That is the denominator of your probability. The numerator will be the number of ways in which the three dice will result in the desired event A. To get that number you can either list all the possible ways in which A can occur and then count them, or you can use some other enumeration approach such as permutations or combinations. For events involving sums where the ordering of the dice are irrelevant you just count the combinations. Put the numerator over the denominator and you have your probability.
Sorry about the terminology, guys. I would say “5 choose 3” to represent the number of combinations of 3 items from a group of 5 items. But I don’t know what to call the equivalent operation for permutations (e.g. 5 P 3), so I just said “3-permutations”, which made sense in my head.
In any case, as CookingWithGas suspected, I am doing it wrong. Instead I should just be counting in faux base-6 to enumerate the permutations (where e.g my symbols are 1-6 instead of 0-5). This is very easy to implement. Thank you.
Just to clarify the terminology, erislover is not using permutations; there are 216 combinations. The original proposal also used combinations, not permutations.
Let’s say you have a bag of black and white marbles, and there are 2 of each color. You want to know all the combinations of 3 marbles you can select (without replacement–that is, you draw three marbles out at a time). There are only two combinations:
BBW
BWW
With combinations, the order isn’t considered. BBW is the same combination as BWB.
If you want to determine how many permutations you can have, you have to consider order, and there are 6 permutations:
BBW
BWB
WBB
WWB
WBW
BWW
In erislover’s case, we are dealing with probabilities of the throw of three dice, each with 6 possible faces. We are identifying combinations because we are listing all the possible ways to select one number from each die, rather than permutations, where you would be taking a given set of numbers and seeing how many different ways you can rearrange them.
erislover’s initial strategy of selecting from the set of all possible rolls from all three dice also used combinations (not permutations!) of three numbers selected from a set of 18. The reason it is combinations is that each number appears in the set 3 times, and it matters which 2 you selected if you select a 2. (Well, using the term “set” here is playing fast and loose because elements in a set must be distinct, IIRC. You can think of this as a bag of numbered balls.)
Another way of thinking about this that will yield the same answer is that you have a bag of 6 numbered balls, and you can choose 3 with replacement. (You pick a ball, you put it back before picking another one.) What are all the possible ways to draw 3 balls, when the order matters? That is permutations, because order matters. I think that may be what erislover was thinking of when he described using permutation, but describing it as picking from a set of 18 didn’t match the description.
This can be an important distinction! If you draw two, rather than three, of the marbles, there are 4 combinations of marbles that are possible, but only 3 combinations of colors (one of which is twice as likely as either of the others).
My mistake, you are correct. And in fact, the formula that I applied your selection from a set of 16 numbers to get a total of 4,896 was the formula for permutations.