HP-48: extract coefficient of power series


The following problem was posted recently in a math-forum:

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:

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 \.d
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


Edited: 20 Oct 2012, 8:39 a.m.


With the 50G

'f(z)=(1+z+2*z^2)/4' DEFINE

'f(f(f(z)))' EVAL



The z^6 coef is : 11/256

But I dont understand the mathematical aspect of this....

Edited: 20 Oct 2012, 11:53 a.m.


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.

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.



Edited: 21 Oct 2012, 8:34 a.m.


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


1/2z^1 * 1/2z^1 = 1/4*z^2


1/4z^2 * 1/4z^0 = 1/16*z^2

Summing up: 3/8*z^2


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,498 10-27-2013, 01:41 PM
Last Post: Michael de Estrada
  HP-10C Series Family Photo Max Stone 5 938 10-24-2013, 10:31 PM
Last Post: Eddie W. Shore
  Low power warning for HP-15C LE and batteries Nick_S 1 554 09-16-2013, 09:34 AM
Last Post: Hans Brueggemann
  Nibble reverse (HP-48,49,50g) Gerson W. Barbosa 44 4,224 07-28-2013, 10:10 PM
Last Post: Gerson W. Barbosa
  (OT) Pandigital expression (HP-48,49,50g) Gerson W. Barbosa 19 2,039 07-19-2013, 05:59 AM
Last Post: Gilles Carpentier
  Questions about building a RAM card for hp 48 Waon Shinyoe (China) 0 450 07-09-2013, 09:53 PM
Last Post: Waon Shinyoe (China)
  HP 9845 option 200 power supply Dave F 2 661 05-30-2013, 08:10 AM
Last Post: Dave F
  HP 50g Takes hours to compute a convergent series Matthew Richards 10 1,214 05-14-2013, 03:30 PM
Last Post: Thomas Klemm
  HP Calc Series Mic 3 628 03-21-2013, 01:34 AM
Last Post: Mic
  HP 48G series -> 20 years NACHO 0 391 12-13-2012, 09:40 AM
Last Post: Nacho

Forum Jump: