Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site riccb.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!ihnp4!riccb!rjnoe From: rjnoe@riccb.UUCP (Roger J. Noe) Newsgroups: net.math Subject: Re: Pistachio Probabilities Message-ID: <499@riccb.UUCP> Date: Fri, 23-Aug-85 09:58:46 EDT Article-I.D.: riccb.499 Posted: Fri Aug 23 09:58:46 1985 Date-Received: Sun, 25-Aug-85 04:48:20 EDT References: <285@ihnet.UUCP> Distribution: net Organization: Rockwell International - Downers Grove, IL Lines: 41 > Suppose you begin with a bag containing O openable pistachios, > and U unopenable pistachios. A trial consists of selecting a nut at random, > and eating it (if possible), or returning it to the bag. > How many trials, on the average, are required to consume all the "openable" > pistachios? Express the answer in terms of U and O. > Any ideas on the variance/distribution of trials(U,O)? > Although I have not given this problem a lot of thought (yet), > it looks surprisingly difficult. > The pistachios, by the way, were delicious. > -- > This .signature file intentionally left blank. > Karl Dahlke ihnp4!ihnet!eklhad Actually, it's not that hard. Express the problem in terms of a recurrence relation. Let T(No,Nu) denote the expected number of trials given that there are "No" openable nuts and "Nu" unopenable nuts in the bag. Assume also that we know No before we begin so that we don't keep searching for openable nuts when there are none left. Then for No=0, T(0,Nu)=0. Now, what if No>0? Clearly there is a No/(No+Nu) probability of selecting an openable nut, which adds a trial and decrements No. There is a Nu/(No+Nu) probability of picking an unopenable nut, which adds a trial but does not change No nor Nu. (Try pronouncing "No" as "no" and "Nu" as "new" - these sentences can be a lot of fun!) Then the relation for No>0 is No Nu T(No,Nu) = 1 + ----- * T(No-1,Nu) + ----- * T(No,Nu) No+Nu No+Nu Rearranging, T(No,Nu) = 1 + Nu/No + T(No-1,Nu) So the obvious solution is _No \ T(No,Nu) = No + Nu * > 1/k (No > 0) /__ k=1 -- Roger Noe ihnp4!ihopa!riccb!rjnoe Rockwell International