A-level probability question, to bring joy to children at Christmas:

Tesco have an offer on Octonauts figures at the moment (that's true, so if you were hoping to buy some, now you know). The parents of an adorable 2 year old want 5 out of the 8 characters (he owns 3 already). However, the figures are not listed separately, just as 'one supplied.'

How many should they order into store to have a good chance (say >90%) of getting the 5 they want out of the random selection that Tescos send? There's no issue with taking any surplus back, so they could order vast quantities... but that would seem a little absurd.

[I can see 3 similar problems. (a) the simple problem, where 'Tescos' is a box containing all 8 characters, once and once only (b) a finite problem, where Tescos is a finite but large box (say containing 64 octonauts, 8 of each) and (c) an infinite problem, where Tescos is an Octonaut producing machine that can produce as many Octonauts as are ordered and dispenses them at random. I think the actual problem is (c), but I'm quite interested in the solutions to (a) and (b) as well and how it makes the maths different...]

My vague thoughts...

The simple problem would be easy. If you only bought 7 octonauts, there'd be a 5/8 chance that the last octonaut was in the set 'octonauts I wanted' and a 3/8 chance it wasn't. So that's only a 37% chance of a happy toddler... so you buy all 8 and have 100% chance. (is that right? Have I done something wrong?)

I wondered if it's best tackled as 1 - the probability you don't get all the figures you want. I thought briefly this was 1 - (3/8)^n, where n is the number of figures you buy, but actually this is Wrong, because that is the probability you get at least one figure you want, not that you get all five. And you must have to do something a bit like permutations and combinations, because four Pesos is different to a Peso, a Kwazii, a Barnacles, and a Tweak, even if in both situations you have 'four things you wanted'

So the first octonaut comes out of the machine. You have a 5/8 chance it's one you want, and a 3/8 chance it isn't. Gah, I'm going to draw a huge probability tree, which is hard in text. If you got the one you wanted, you now have a 4/8 chance of getting another one you want, and a 4/8 chance of not doing so.

*draws tree diagram up to three Octonauts*

So the number of octonauts at each node of this tree is a binomial distribution ( minus 1). That is, after one octonaut, the nodes are 'have 1 wanted octonaut' or 'have 0 wanted octonauts' And after two octonauts, the nodes are 2, 1, 1, 0. And after 3 it's 3,2,2,1,2,1,1,0 = 1*3,3*2,3*1,1*0.

Oh, this is coin tosses! Every time you pull the octanaut lever it's like tossing a coin, and heads is 'octonaut I want' and tails is 'octonaut I didn't want'. EXCEPT it's a biased coin (the first time you have 5/8ths chance of wanted Octonaut, rather than 1/2) and EXCEPT the bias of the coin changes based on what you got... because if you already have one, you have 4/8th chance of a wanted Octonaut, and if you already have two you have a 3/8ths chance... So, err, not much like coin tosses.

So it doesn't matter how you got to the 'I have two octonauts I want' node, any future path from their is the same. But there are lots of different ways of getting to (eg) the 'I have two octonauts I want' node and their probabilities aren't the same - eg after 3 Octonauts, 1,1,0 is more likely (P = 0.20ish) than 0,1,1 (P = 0.12 ish). Which makes sense, because you are more likely to get an Octonaut you want when you don't have any octonauts you want at all.

Hmm. I could solve it by drawing a Huge Diagram, but I'd get something wrong. My brain is saying 'simulation!' but a) that's not Real Maths, and b) I don't know how to do it in a quick and dirty way. Not in Excel, I guess... ;-)

Any help?

ETA: I _think_ I've solved this now, although in a very cludgy way!

See comments, especially

http://atreic.livejournal.com/506283.html?thread=7797931#t7797931