Number of tries until Failure with n different independent Bernoulli experiment I have 3(n) coffee machines in an office. I have a historical log of these machines, and I know in the last ten days(t) how many times they failed to make a coffee.
For example:

*

*machine 1: 10 failures in 100 tries

*machine 2: 20 failures in 1000 tries

*machine 3: 50 failure in 300 tries

I know that I can use the Expected Value of the Geometric distribution for a machine to calculate the mean number of tries before the first failure.
Question:
How many times does one person need to use coffee machines in this office until he gets the first failure?
How can we formulate this problem?
 A: As noticed in the comment by @periwinkle, the result depends also on the probability of the machine by a user. I would assume that the machines are chosen uniformly at random, but any other probability distribution can be used instead. Recall the law of total probability
$$
P(A) = \sum_i P(B_i \cap A)
$$
The probability of a failure of $i$-th machine depends on the probability of picking this machine $\pi_i$ and the probability of failure $p_i$. The events are independent, so jointly the probability is $\pi_i p_i$, and the overall probability of failure is
$$
p = \sum_i \pi_i p_i
$$
That's the probability we would plug-in into the Geometric distribution to calculate the expected number of runs till failure $1/p$.
Let's verify this using simulation
pi <- c(1/3, 1/3, 1/3)
p <- c(10/100, 20/1000, 50/300)

sim <- function(n) {
    for (i in 1:n) {
        # pick machine
        k <- sample.int(3, size=1, prob=pi)
        # simulate failure or no failure with probability p[k]
        if (runif(1) < p[k]) {
            return(i)
        }
    }
    warning("no success")
}

That gives us the following result that confirms the analytical solution:
> set.seed(42)
> summary(replicate(50000, sim(1000)))
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   1.00    3.00    7.00   10.44   14.00  116.0
> 1/sum(pi * p)
[1] 10.46512

