Confusing probability question

I have got a task, which seems a quite confusing for me. It is simple: In a market, they sell eggs in egg holders, they store $10$ of them in each. There is $60$% chance, that all of the eggs are ok, $30$% chance, that exactly $1$ of them is broken, and $10$% chance, that exactly $2$ of them are broken(it is random, which one is broken).

We buy an egg holder, and after we grab our first egg, we are sad, because it is broken. What is the probability, that there is one more broken egg in our holder?

The "logical" way would be: $30$% of them have $1$ broken egg, $10$% of them have $2$, so, to have $2$ broken, the chance must be $\frac14$. But I am not really sure if that is the correct approach, since the broken egg can be anywhere, getting a broken one for first may be not that easy, or is that independent?(Maybe, I could use Bayes Theorem somehow)?

Any help appreciated.


I see this as analogous to the pancake problem ... specifically, I would argue that having randomly observed a broken egg, the chances that you are in case C have disproportionately increased.

Imagine that you had $100$ of your cartons, $60$ of type A, $30$ of type B, and $10$ of type C. You select one egg randomly from each. You'll get $3$ broken ones from the Bs and $2$ from the Cs. Hence your probability is $\frac 25$.


The answer isn't just $1/4$, because you're more likely to pick a broken egg first if the holder has two broken eggs.

Let $B$ be the event where the first egg we observe is broken, $H_1$ the event our holder has one broken egg and $H_2$ the event where our holder has two broken eggs.

Since there's one broken egg out of ten in the $H_1$ case, $P(B\ |\ H_1) = 1/10$. Likewise there are two broken eggs in the $H_2$ case, so $P(B\ |\ H_2) = 2/10$.

This means $P(B) = 1/10 \times 3/10\ +\ 2/10 \times 1/10 = 3/100 + 2/100 = 5/100$. You have a five percent chance of first examining a broken egg whenever you buy a holder of 10 eggs.

Now we're interested in $P(H_2\ |\ B)$ or the probability we have two broken eggs after we've observed the first one. By Bayes' theorem:

$P(H_2 | B) = \frac{P(B | H_2)P(H_2)}{P(B)} = \frac{(2/10)\ \times\ (1/10)}{5/100} = \frac{2/100}{5/100} = \frac{2}{5}$.


Not really an answer, but more a visualisation of the excellent answer of Lulu.

$\begin{array}{cccccccccc} A & A & A & A & A & A & B & B & B & C\\ 0 & 0 & 0 & 0 & 0 & 0 & \otimes & \otimes & \otimes & \otimes\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & \otimes\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0 & 0\end{array}$

The columns correspond with boxes. You picked a broken egg. The $5$ broken eggs have equal chances to be the elected one. Exactly $2$ of the $5$ are located in a box that contains another broken egg.


Here is a simple C++ program I have quickly created for this purpose, and confirming the previous perfect answers: the solution is empirically around 40%, indeed.

#ifdef _WIN32
#define CLEAR "cls"
#else
#define CLEAR "clear"
#endif

#include <iostream>
#include <random>
#include <limits>   
#include <cstdlib>

class Holder {
public:
    int eggs[10];
};

int main() {

    int i, j;

    double total_broken = 0, two_broken = 0;

    std::random_device rd;
    std::mt19937 engine(rd());

    std::uniform_int_distribution<int> broken_egg(0, 9);
    std::uniform_int_distribution<int> holders(0, 99);

    Holder * holder = new Holder[100];

    std::cout << " Breaking the eggs...";

    do {

        // Reset all the holders (0: unbroken)
        for (i = 0; i < 100; ++i) 
            for (j = 0; j < 10; ++j)
                holder[i].eggs[j] = 0;

        // 30 %: 1 random egg broken (1: broken)
        for (i = 0; i < 30; ++i) 
            holder[i].eggs[broken_egg(engine)] = 1;

        // 10 %: 2 random eggs broken
        for (i = 30; i < 40; ++i) 
        {
            int broken_a, broken_b;

            do {
                broken_a = broken_egg(engine);
                broken_b = broken_egg(engine);
            } while (broken_a == broken_b);

            holder[i].eggs[broken_a] = 1;
            holder[i].eggs[broken_b] = 1;
        }

        // Select randomly one egg holder
        int selected_holder = holders(engine);

        // Is the first egg broken?
        if (holder[selected_holder].eggs[0] == 1)
        {
            ++total_broken;

            for (j = 1; j < 10; ++j)
            {
                // ... if so, are there 2 broken eggs in the holder?
                if (holder[selected_holder].eggs[j] == 1)
                {
                    ++two_broken;
                    break;
                }
            }
        }

        if (total_broken > 0 && (int)total_broken % 10000 == 0)
        {
        system(CLEAR);
        std::cout << std::endl;
        std::cout << " Chance  \t";
        std::cout << " # holders with 2 broken eggs /";
        std::cout << " # holders with broken egg(s)" << std::endl;

        std::cout << " " << (two_broken * 100) / total_broken;
        std::cout << " % \t " << two_broken << " / ";
        std::cout << total_broken << std::endl;
        }

    } while (total_broken < std::numeric_limits<double>::max());

    return 0;
}

Say you bought 10 egg holders. Six were fine. Three contained one broken egg. One contained two broken eggs. Five broken eggs in total. You picked one of these five eggs. The chance is 3/5 = 60% that you picked one of the three eggs from the three containers with one broken egg. The chance is 2/5 = 40% that you picked one of the two eggs from the container with two broken eggs. So the chance is 40% that there is another broken egg in the same container.