HP-48: extract coefficient of power series « Next Oldest | Next Newest »

 ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 10-20-2012, 08:26 AM The following problem was posted recently in a math-forum: Quote: Every 10 minutes a bacteria has 3 possible actions. It will die, remain the same, or split into two. The probability of it dying is 1/4, staying the same is 1/4, and splitting is 1/2. All future bacteria share this probability. If you start with one bacteria, what is the probability that there will be exactly 6 bacteria after 30 min? Among others the following solution was posted: Quote: There is a huge literature on this sort of random processes, going under the name of branching processes. For the current problem, define the function f (z)=1/4+1/4z+1/2z2, and consider the third iterate f(f(f(z))), and especially the coefficient in front of z6. My first attempt to use WolframAlpha failed so I decided to give it a try using my HP-48GX: ```f: \<< \-> z '(1+z+2*z^2)/4' \>> g: \<< \-> z 'f(f(f(z)))' \>> ``` When I calculated g(z) I wondered how to extract the 6th coefficient. So I came up with this solution: ```\<< \-> n \<< z g z n TAYLR 1 n START z \.d NEXT n ! / \>> \>> ``` Would there be an easier way to find that coefficient? And does somebody happen to know how to do this calculation with WolframAlpha? Many thanks in advance Thomas Edited: 20 Oct 2012, 8:39 a.m. ▼ Gilles Carpentier Senior Member Posts: 468 Threads: 17 Joined: May 2011 10-20-2012, 11:52 AM With the 50G 'f(z)=(1+z+2*z^2)/4' DEFINE 'f(f(f(z)))' EVAL -> '(16*z^8+32*z^7+88*z^6+104*z^5+265*z^4+224*z^3+358*z^2+152*z+809)/2048' The z^6 coef is : 11/256 But I dont understand the mathematical aspect of this.... Edited: 20 Oct 2012, 11:53 a.m. ▼ Thomas Klemm Senior Member Posts: 735 Threads: 34 Joined: May 2007 10-21-2012, 08:31 AM Quote: The z^6 coef is : 11/256 Correct! Is there a way to extract that number from the expression? It appears that EVAL behaves differently on the HP-50G. With the HP-48GX the expression I get with f(f(f(z))) isn't changed at all. Quote: But I dont understand the mathematical aspect of this.... I had a look at the Wikipedia article Branching process: Let dn be the extinction probability by the n-th generation. Then using the generating function f(z) we get: dn+1 = f(dn). Therefore the extinction probability after k more steps is: dn+k = fk(dn). After expanding the expression we get: dn+k = fki dni where fki is the i-th coefficient of fk(z). On the other hand if we knew how many offsprings we have after k steps we could calculate the extinction probability with exactly that sum. HTH Thomas Edited: 21 Oct 2012, 8:34 a.m. Han Senior Member Posts: 709 Threads: 104 Joined: Nov 2005 10-21-2012, 11:42 PM If you simply look at how polynomials multiply, it will tell you a lot. (1+ax)(1+bx) = 1 + ax + bx + abx^2 If you look at the coefficient of x, which is a+b, it basically "counts" how many x's there are. There's a contribution of "a" from 1+ax and a contribution of "b" from 1+bx. In the original problem, we have z representing a single population. z^2 would represent when the population splits and now there are two of them. z^3 would mean that we have 3 bacteria -- but they could have arrived in several ways: x splits int x1 and x2, and then x2 splits again while x1 remains fixed would be one example. This would be represented by a product of z and z^2. Or we could also have x1 splitting while x2 remains fixed (this would be a product of z^2 and z). So (1+2z+z^2)/4 = 1/4 z^0 + 1/2 z^1 + 1/4 z^2 1/4 z^0 = 1/4 probability 0 bacteria 1/2 z^1 = 1/2 probability 1 bacteria remains at 1 1/4 z^2 = 1/4 probability 1 bacteria splits into two (z^2). [(1+2z+z^2)/4 ]^2 -- this would represent two cycles, and let's consider the coefficients of z's. z^0 = 0 bacteria: How do we obtain the coefficient of z^0 -- the only way is from 1/4z^0 * 1/4z^0 = 1/16z^0 z^1 = 1 bacteria: How do we obtain the coefficient of z^1 -- the only way is from 1/4z^0 * 1/2z^1 OR 1/2z^1 * 1/4z^0 = 1/8z^1 + 1/8z^1 = 1/4z^1 (the 1/4z^0 from the first (1+2z+z^2)/4 multiplied with the 1/2z from the second (1+2z+z^2)/4, and vice versa). z^2 = 2 bacteria: How do we obtain the coefficient of z^2 -- the only way is from 1/4z^0 * 1/4z^2 = 1/16*z^2 OR 1/2z^1 * 1/2z^1 = 1/4*z^2 OR 1/4z^2 * 1/4z^0 = 1/16*z^2 Summing up: 3/8*z^2 etc. So when you consider how polynomial multiplication works, it matches up precisely with the sum and/or product of probabilities based on possible outcomes. Edited: 21 Oct 2012, 11:58 p.m.

 Possibly Related Threads... Thread Author Replies Views Last Post HP Prime Save Power Turn Off Not Working Timothy Roche 12 1,721 10-27-2013, 01:41 PM Last Post: Michael de Estrada HP-10C Series Family Photo Max Stone 5 1,087 10-24-2013, 10:31 PM Last Post: Eddie W. Shore Low power warning for HP-15C LE and batteries Nick_S 1 653 09-16-2013, 09:34 AM Last Post: Hans Brueggemann Nibble reverse (HP-48,49,50g) Gerson W. Barbosa 44 4,751 07-28-2013, 10:10 PM Last Post: Gerson W. Barbosa (OT) Pandigital expression (HP-48,49,50g) Gerson W. Barbosa 19 2,328 07-19-2013, 05:59 AM Last Post: Gilles Carpentier Questions about building a RAM card for hp 48 Waon Shinyoe (China) 0 519 07-09-2013, 09:53 PM Last Post: Waon Shinyoe (China) HP 9845 option 200 power supply Dave F 2 753 05-30-2013, 08:10 AM Last Post: Dave F HP 50g Takes hours to compute a convergent series Matthew Richards 10 1,379 05-14-2013, 03:30 PM Last Post: Thomas Klemm HP Calc Series Mic 3 742 03-21-2013, 01:34 AM Last Post: Mic HP 48G series -> 20 years NACHO 0 443 12-13-2012, 09:40 AM Last Post: Nacho

Forum Jump: 