Hi,
i´m programming a little dice game (Android&Windows). As you can see on the screenshot i have 9 dice (right). The objective of the game is to match the symbols on the enemy cards (middle) to defeat them. To balance the game i want to calculate the probability for matching an enemy card with the dice. I think the probability for 1 roll would be enough but a variable row count would be even better (the dice can be saved between rounds). The dice have 6 faces: light attack, light shield, light magic, dark attack, dark shield and dark magic. The enemy symbols can include all of this faces (p=1/6) and light, dark (p=1/2), attack, shield and magic (p=1/3). I´m planning to include pairs later on.
I´ve searched for hours to solve this problem. Does anyone know how to solve it or can point me in the right direction?

Your description of what you’re after is distinctly lacking in usable detail. The enemy cards in the middle appear to have a variable number of “capacities”: Top left has three, top right has five, bottom left has seven, and bottom right has five. Is this always the case? If not, what is the allowable range of the number of enemy capacities for each enemy? How many capacities are necessarily populated, if any?

What is the meaning of the capacities that are blank? What is the meaning of different colours for blank capacities?

Are the capacities randomly assigned to the enemy cards? Or do they depend on the capacities of the challenger?

Does a single roll need to defeat any one of the four enemy cards? Or does it need to defeat all four simultaneously?

Is a “defeat” an exact match, i.e. if one of the enemies has two dark attacks and one light magic, must a winning throw include exactly two dark attacks and one light magic, or can it be two or more dark attacks and one or more light magics?

Do the enemy capacities change between one roll and the next? If so, how? In either case, how many rolls does the challenger get?

However the rules of the game may be, if there is much complexity, your best bet would be to run a Monte Carlo simulation once the rules are properly quantified.

Thank you very much for your answer! I will try to clarify:
The Enemy Cards (18 in total) have capacity between 2-8.
The capacities are not blank. Colored sides mean: red = attack, blue = defense, yellow = magic, white = light, black = dark.
The capacities are more or less random. The idea is to generate 1000+ sequences at random and use a difficulty metric to select some of them by a difficulty rating.
The player has some health. After every round a timer on the cards is decreased by one (left side). When the timer hits zero the player loses a small amount (right side on the card) of health and the timer is reseted. So the player can roll his dices till he is dead. After all symbols on a enemy card are matched the dice are released and can be used again on the next roll.
But for simpicity reasons i'm only intrested in the probabilty of matching all symbols of one card by rolling 9 dice one time (or a fixed amount of rolls).
The capacities stay the same between rounds and the dices that are matched in one round stay on the card till all dice are matched to the card. The dice are matched by the player by dragging them on the card symbols. This means he can decided if he wants to use a dark attack to match an dark attack, attack or dark symbol.

I used a monte carlo simulation in a similar game. The problem is the complexity of determinig if a given set of dice match. Since you can use 1 dice to match multiple symbols (e.g. dark or attack) i have to observe all possibilities & combinations. This worked ok for 5 dice but isn't usable for 8.

It will be better, besides stating the rules explicitly and describing the model, you also provide some relevant examples to illustrate different possible scenarios, like your second last paragraph.

I would also like to clarify several things if I missed:

1. What are the faces of the dice? Are all 9 dice have the same faces? And now you are rolling them independently?

2. You want to calculate the probability of matching an enemy card with the dice. So I assume you mean 1 enemy card is selected already, and how many dice here in concern? Would you mind to clarify again how to match? (the rules, etc). You really need to clarify this to define the event which you are interested to calculate the probability.

3. As asked by Con-Tester, so do we already know all the information of the selected enemy card - those colors, attributes as you said? So the probability will be in terms of these parameters. Please also provides the possible combinations of these parameters.

Since this matter is a bit complicated i build you guys a WebGL-Demo of the game: WebGL Demo link (it will probabliy take some time to load)

1. yes - all the same faces & yes - all rolled independently.
2. For simplicity i would like to assume that only one card has to be matched. (To clarify this: i don´t need to calculate all probabilities regarding the game. I just need some metric to describe the difficulty of the cards - e.g.: i have 2 cards: the first has one symbol: "light attack" and the second has 2 symbols "dark magic" & "dark defense". Now i need some numbers to express their difficulty. The difficulty obviously depends on the number of dice that can be used to match these symbols)

3. the enemy cards have 2-8 symbols to match. They are selected at random. I need some way to calculate the difficulty of a given symbol sequence for matching all symbols with 9 dice in one roll (or a given roll count - if this is possible).

Ok it is much clearer now. The question remain is:

- Do you want to calculate the probability of match, given the complete information about the symbols of the selected enemy cards before roll?
- Or you still assign a prior distribution about those symbols to be appeared? i.e. Those symbols are random, and not known before roll.

In general there are types dice results. For it correspond to cases. For each case the probability is

So you can first compute all these multinomial coefficients, and sum all of them for the cases that match the constraint, and divide by . This is a brute force way to do it, may not be efficient when is large.

Another example using hand calculation:
Suppose the enemy card now contains 1 "light defense", 2 "light" and 1 "dark magic" symbols.
The probability of matching this card is

It just show how tedious it would be if you carry on to more types, if you manage to calculate it by hand. Maybe it has a more systematic way to do this.

@BGM thank you very much for your answer! When i´m back home i will study it carefully to understand it in depth.

@rogojel since 1 side can match multiple sides (e.g. the attack symbol matches light & dark attack) i would have to consider all possible ways to match the ysmbols. I did this for another game with 5 dice. But because of the matching it gets slow quickly.