22
$\begingroup$

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.

$\endgroup$
1
  • 2
    $\begingroup$ That this approach isn't correct becomes slightly more intuitively clear if you replace "$2$" by "$10$". $\endgroup$
    – joriki
    Commented Sep 17, 2015 at 21:18

7 Answers 7

29
$\begingroup$

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$.

$\endgroup$
0
28
$\begingroup$

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}$.

$\endgroup$
16
$\begingroup$

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.

$\endgroup$
6
$\begingroup$

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;
}
$\endgroup$
1
  • 2
    $\begingroup$ It's always good to write a program to verify probability problems (intuition can be deceiving). +1. $\endgroup$ Commented Sep 16, 2015 at 22:26
1
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

The chance you'll pick the carton with one broken egg is 30%.
The chance the first egg is broken in that carton is 10%.
The chance of both is $$30\% * 10\% = 3\%$$

The chance you'll pick the carton with two broken eggs is 10%.
The chance the first egg is broken in that carton is 20%.
The chance of both is $$10\% * 20\% = 2\%$$

These are our only possible cases, so the probability of 2 broken eggs is $$\frac{2\%}{3\%+2\%} = \frac{2}{5}$$

$\endgroup$
-1
$\begingroup$

Per the OP.

What is the probability, that there is one more broken egg in our holder?

thanks to @drhab for the diagram that shows this intuitively :)

Clarifying Edit

1) What the OP is asking is somewhat equivocal and perhaps this question is better suited to Puzzling Stack Exchange. See points 2) and 3) following.

2) Because it is given that we have a holder with (at least) one broken egg, the proportion of holders without broken eggs is irrelevant to the answer.

3) Because it is given that there can be only a maximum of 2 broken eggs/holder, finding the broken egg in the first slot (or for that matter the 2nd slot,... 9th slot) is irrelevant to the answer.

4) Given the description in the OP of the holders with broken eggs, two questions may be asked:

  • i) What proportion of the egg holders with broken egg(s) have 2 broken eggs? Answer = 25%
  • ii) What proportion of broken eggs come from holders with 2 broken eggs? Answer = 40%

You'll excuse me if that I took the OP to be asking question i) when others took it to be asking question ii). ESL and all that... and thanks to @kviiri for pushing me until I understood.

$\endgroup$
4
  • 1
    $\begingroup$ -1 for being an incorrect answer and also claiming that drhab's correct diagram is a demonstration for your incorrect outcome. $\endgroup$
    – kviiri
    Commented Sep 18, 2015 at 8:14
  • $\begingroup$ Just read drhab's answer or my answer, they both say you're wrong and are mathematically sound - unlike yours since you assume a broken egg is equally likely in cases B and C, which is clearly not true. The correct answer is 2/5 and if you want to dispute my proof of that, let me know what my error is by leaving a comment on my answer. $\endgroup$
    – kviiri
    Commented Sep 18, 2015 at 18:53
  • 1
    $\begingroup$ Then why are you saying the correct answer is 1/4? drhab's diagram as well as simple conditional probability math clearly shows it's 2/5. As you say yourself, 2/5 of the broken eggs are from holders with two broken eggs. $\endgroup$
    – kviiri
    Commented Sep 19, 2015 at 6:36
  • $\begingroup$ @kviiri -- see edit. sorry and thanks for being persistent. $\endgroup$
    – user23715
    Commented Sep 22, 2015 at 2:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .