http://qs321.pair.com?node_id=521389


in reply to Re: Obtaining terms in an expansion
in thread Obtaining terms in an expansion

You have N terms going in, and N terms coming out. He says in the OP that he wants 2^N expressions returned. This is considered 2 terms, so there are 4 expressions returned.

Update: my mistake. Did not read carefully enough.

Replies are listed 'Best First'.
Re^3: Obtaining terms in an expansion
by trammell (Priest) on Jan 06, 2006 at 15:16 UTC
    That's funny, because when I run the program for N=2, I get:
    term[0] = a[0][0] a[1][0] a[2][0] term[1] = a[0][0] a[1][0] a[2][1] term[2] = a[0][0] a[1][1] a[2][0] term[3] = a[0][0] a[1][1] a[2][1] term[4] = a[0][1] a[1][0] a[2][0] term[5] = a[0][1] a[1][0] a[2][1] term[6] = a[0][1] a[1][1] a[2][0] term[7] = a[0][1] a[1][1] a[2][1]
    So perhaps I have an off-by-one error, but certainly I'm generating 2^N terms.