Random number of dice with random number of faces-Probability of getting a max number provided Suppose we have a vector $y$ that represent $m$ dice with a potentially varying number of faces (let's call this number $k_i$, where $i$ goes from $1$ to $m$). Let's also suppose that $x_{max}$ is an input that states the max number that can be present in any combination of the dice after being thrown, and that must be present in at least one of these.
I'm interested in the probability of such an event, so I would need a generic formula where I can provide a vector $y$ of $m$ dices with $k_i$ faces and max integer $x_{max}$.
I understand that the probability of at least one case occurring would be:
$$
P(X) = \prod_{i=1}^{m} \frac{1}{k_i}
$$
To consider all cases that fit the criterion I would need to multiply $P(X)$ by the number of all cases $n$, that would yield $P(T)$. This is where I'm having a problem: Im not sure how to arrive at the generic formula to calculate all the possible cases that fit the criterion.
I have arrived at a solution where I generate all permutations and discard the ones that fit the criteria, via programming, but it's not the most efficient method.
Here's a couple of examples:
$$
1) y = [2,5,8],
x_{max} = 8,
P(T) = 0.125
$$
$$
2) y=[2, 5, 7, 3],
x_{max} = 3,
P(T) = 0.180952380952
$$
$$
3)y = [3,4]
x_{max} = 2
P(T) = 0.25
$$
 A: I'll write $x =x_{max}$. I'm assuming a dice with $k_i$ faces shows integers between $1$ and $k_i$.
We can consider this the probability that no die shows higher than $x$ (I.e. all dice show $\leq x$) minus the probability that all dice show $<x$. This comes out to (taking into account that probability cannot exceed $1$)
$$
{\prod_{i=1}^m \min\left\{\frac{x}{k_i},1\right\}} - {\prod_{i=1}^m \min\left\{\frac{x-1}{k_i},1\right\}}
$$
A: Let's try to reproduce your example (2)
So the dice have sides $2,5,7,3$, and  there are $2\times 5 \times 7 \times 3 = 210$ equally possible outcomes
We now want to count the ones where the maximum value is exactly $3$. Count the number of ways all the dice show less than or equal to $3$ and subtract the number of ways all the dice show less than or equal to $2$.  So $2 \times 3 \times 3 \times 3 - 2 \times 2 \times 2 \times 2 = 54-16=38$
This gives a probability as $\frac{38}{210} \approx  0.18095$, as you found
In general this becomes $$\dfrac{\prod_i \min\left\{x_{\max},k_i\right\}   - \prod_i \min\left\{x_{\max}-1,k_i\right\}}{\prod_i k_i}$$
