[Math] Probability of picking exactly one correct from a pool of 6 incorrect and 4 correct

combinatoricsprobability

So as the question says. You have 6 incorrect objects and 4 correct ones. What are the odds that, when picking 3 of them at random, you end up with exactly one of them being correct.

This seems to be quite trivial but I'm having issues since my solution differs from the provided one. Also, I've written a program that simulates it and it seems to be leaning towards my solution.

Anyways, the way I did it is just by multiplying $\dfrac{4}{10}\dfrac{6}{9}\dfrac{5}{8}$ with the result being $\dfrac{1}{6}$. The reasoning is that you first have a 4 in 10 chance of picking the correct one and then you need to pick the incorrect one 2 times with 6 in 9 and 5 in 8 chances. I thought that maybe the fact that the order doesn't matter is making my calculation off but since you can write the product as a big fraction and commute everything, that can't be the problem.

The provided solution is $\dfrac{\binom{4}{1}\binom{6}{2}}{\binom{10}{3}}$. I can see how that would work as well so I can't really say what the problem might be with their solution.

Anyways, I wrote a program that picks 3 numbers out of [0,0,0,0,0,0,1,1,1,1] at random. It does it 100000 times and the number of times it got exactly one 1 is around 18800. That's obviously much closer to my $\dfrac{1}{6}$ than their $\dfrac{1}{2}$. Is their solution wrong? If so, why?

Edit:
Now that I think about it, my solution should be the incorrect one since it answers the question of what the odds are that I FIRST pick a correct one and then 2 incorrect ones, but why would the simulation lean towards my solution then?

Best Answer

I just tried running the simulation and it works (out of $100000$, I got the number of trials in which only 1 correct object picked up as $49982$, fairly converging to $\frac{1}{2}$).

Code: (Octave)

sum = 0;
res = 0;
a=[0,0,0,0,0,0,1,1,1,1];
for i = 1:100000;
[junk,index] = sort(rand(1,10));
pick = index(1);
sum = sum+a(pick);
b=[];
tempcount = 1;
for j = 1:length(a);
if(j == pick)
continue
else
b(tempcount) = a(j);
end
tempcount = tempcount + 1;
end
[junk,index] = sort(rand(1,9));
pick = index(1);
sum = sum+b(pick);
c = [];
tempcount = 1;
for j = 1:length(b);
if(j == pick)
continue
else
c(tempcount) = b(j);
end
tempcount = tempcount + 1;
end
[junk,index] = sort(rand(1,8));
pick = index(1);
sum = sum+c(pick);
if(sum == 1);
res = res + 1;
end
sum = 0;
end

Related Question