Hey Wilmer.
This is a conditional probability. (Hint: P(A|B) = P(A and B)/P(B)).
Thanks Chiro.
I'm trying to re-learn (completely forgot!) conditional probability.
OK:
16^3 = 4096
At least 1 (of the 3 picked) is an apple: 3584
At least 2 (of the 3 picked) are red apples: 640
P(A and B) = 3584/4096 + 640/4096 ? That's sure not correct...
Where am I goofing?
Couple of things:
1. You are assuming that the 3 items are picked with replacement, meaning that after you pick a fruit you put it back in the bin and then select another. This makes each selection independent of the others. But I intepret the problem to mean that the fruit is selected without replacement, so the bin ends up with 13 fruits in it. In this case there are 16*15*14 = 3360 possible combinations of selections.
2. In chiro's post event A is "selection of at least 2 red apples" and event B is "selection of at least 1 red apple" So P(A and B) is the probability of selecting at least 2 red apples and at least 1 red apple, which is the same as simply the probability of selecting at least 2 red apples.
P(at least 2) = P(2) + P(3)
P(2) = (4/16) x (3/15) x (12/14) x C(3,1), where C(3,1) is the combination of one item out of 3.
P(3) = (4/16) x (3/15) x (2/14)
P(at least one red apple) = P(1)+P(2)+P(3). You already have values for P(2) and P(3), so now you just need to determine P(1). Then you can apply P(A|B) = P(A and B)/P(B). Can you finish it from here?
3. If the fruits are replaced after each selection then the number of ways to get 3 reds is 4^3 = 64. not 640, and the number of ways to get 2 reds is 4^2x12x3 = 576. So the probability of selecting at least two reds is (64+576)/4096.
In ebaines post, he writes P(1), P(2), P(3), but doesn't explain what those are. By P(1), he means the probability of picking exactly one red apple. P(2) would be the probability of picking exactly two red apples. P(3) is the probability of picking exactly three red apples. And he did not mention it, but we should add P(0) is the probability of picking exactly 0 red apples.
So, why are we discussing P(0), P(1), P(2), and P(3)? It is because these are probabilities of "disjoint" events. That means that if you pick exactly zero apples, it is not possible that you also picked exactly one apple. The events do not overlap. No matter what three fruit you pick, the outcome will be in exactly one of the four events. These are also called "mutually exclusive" events. So, their probabilities are additive. If you want the probability of picking zero or two apples, it would be P(0) + P(2). If you want the probability of picking at least 2 apples, like ebaines said, that would be P(2) + P(3). Lastly, if you pick three fruits, there is 100% chance that you picked three fruits. So, the sum of the four probabilities must equal 1. In other words, P(0)+P(1)+P(2)+P(3) = 1.
Well, the probability of at least 1 red apple would be P(at least 1) = P(1) + P(2) + P(3), as ebaines said.
Since P(0)+P(1)+P(2)+P(3) = 1, we have P(0) + P(at least 1) = 1, so P(at least 1) = 1-P(0).
Let's calculate P(0). That means that you do not pick any red apples. So, for your first pick, you have 12/16 fruits to choose. The second pick, you have 11/15, and the third, you have 10/14. So, and
Next, another way to calculate the probability of at least 2 red apples is to take the probability of at least 1 red apple and subtract the probability of exactly 1 red apple. Let's look at the outcomes that yield exactly 1 red apple:
We can choose a red apple, then two fruit that are not red apples.
We can choose a fruit that is not a red apple, then a red apple, then a fruit that is not a red apple.
We can choose two fruit that are not red apples, then a red apple.
These are disjoint outcomes. It is not possible that your first choice is simultaneously a red apple and not a red apple. But, if you wind up with one red apple, it had to be one of your three choices. So, the sum of the three probabilities must equal the probability of picking exactly one red apple (again, we can only add probabilities if they are disjoint, and we only know they add up to the whole probability if they cover every possible outcome).
So, the probability for picking red, non-red, non-red:
The probability for picking non-red, red, non-red:
The probability for picking non-red, non-red, red:
Then, the probability for picking exactly 1 red apple:
The 3 you see before the fraction on the middle row is the same as C(3,1) that ebaines used. It means we want one red apple, but we don't care which specific pick of the three got it. There are three picks to choose from where we wind up with the red apple, so there are three times the number of ways of getting the red apple on the first pick, then no more red apples.
This means, the probability of at least 2 red apples would be
So, the conditional probability would be:
Thanks, Slip....
Once more: it's not the probability of "at least 1 red apple",
but the probability of "at least 1 apple" (red or green); ********************
here's my initial post:A box contains 4 red apples, 4 green apples and 8 peaches.
3 are picked at random.
It is known that at least 1 of the 3 is an apple. ********************
What is probability that at least 2 are red apples?
I see. Sorry about that.
Ok, so again, if at least two of the chosen fruit are red apples, then you are guaranteed that at least one of the chosen fruit is an apple (red or green), so is still as we calculated before.
Now, we just need the probability that at least one of the chosen fruit is an apple. What are the possible outcomes? We can pick so that we wind up with exactly 0, 1, 2, or 3 apples (red or green). It is not possible that we wind up with exactly 0 apples and exactly 1 apple simultaneously, so these are disjoint events. Also, if we pick three fruits, the only possible outcomes are exactly 0, 1, 2, or 3 apples, so the sum of the probabilities of each disjoint event must equal 1. The probability of picking at least one apple is:
.
So, again, to find the conditional probability by dividing the two:
Thanks loads, Slip...
Was confused, as I couldn't get close to that from simulation program I wrote;
then I realised that if there is no apples (red or green) picked, then this "attempt"
is skipped and a new attempt made; see line 130:
100 1-4 = red apples, 5-8 = green apples, 9-16 = peaches
110 Do 1000000 times
120 Pick at random (from 1 to 16), no replacement, a b and c
130 If a>8 and b>8 and c>8 then goto 120
140 If at least 2 of a,b,c are < 5 then t = t + 1
150 End loop
160 Print t
Ran it 5 times; t = 150870, 151364, 150930, 150,747 and 150562
And 19/126 = ~150794
So all's fine! Thanks again.
Slip, what do you get if we change problem slightly to:
A box contains 8 red apples, 8 green apples and 16 peaches.
5 fruits are picked at random.
It is known that at least 1 of the 5 is an apple (red or green).
What is probability that at least 2 are red apples?
Trying to simulate...thanks.
You can use the same technique as before:
P(At least 2 red | at least 1 red or green) = P( at least 2 red AND at least 1 red or green)/P(at least one red or green).
As before, the numerator can be simplified to P(at least 2 red), since if there are 2 red then you know that there is at least 1 red or green.
P(at least 2 red) = P(2 red) + P(3 red)+P(4 red) + P(5 red). Note that it also equals 1 - (P(0 red)+P(1 red)). We'll use the latter form as it's less work:
P(0 red) = Permut(24,5)/Permut(32,5), where "Permut(A,B)" means the permutation of A things B at a time:
P(1 red) = Permut(24,5)xPermut(8,1)/Permut(32,5) x C(5,1):
Therefore
Now for the denominator: P(at least 1 red or green) = 1 - P( no red or green)
So - the probability that there are at least 2 red apples given that there is at least 1 red or green apple is:
Another way to do this is with combinations (since you don't care about the order that you pick the fruit). You will get the same answer either way. With combinations, you can just divide the number of outcomes. So, if we figure out the number of outcomes with (at least two red AND at least one red or green) divided by the number of outcomes with at least one apple (red or green), that will give us the same probability.
Just as ebaines did, we want the number of outcomes with exactly 0 red and exactly 1 red, then take the compliment (total number of outcomes minus outcomes that give us only 0 or 1 red). For exactly 0 red, that is outcomes.
For exactly 1 red, that is outcomes (note: since we are doing combinations, we don't care which of the apples is red). So, there are outcomes with at least 2 red.
For at least one apple (red or green), we want the number of outcomes with 0 apples and take the compliment: .
So, the probability that you get at least 2 red apples given that you pick at least one apple (red or green):
Thank you very much Slip and Mr.Baines; confirmed my simulation; 5 runs @ 1 million each:
1: 374,846
2: 375,431
3: 375,019
4: 374,897
5: 374,961
...and 1319/3518 = ~374,929
More important is the help you've both given me in "remembering" this probability style,
by showing the steps...thanks again.
I'll recommend you both for a raise