Re: How to calculate a union
- To: mathgroup at smc.vnet.net
- Subject: [mg104462] Re: How to calculate a union
- From: ADL <alberto.dilullo at tiscali.it>
- Date: Sun, 1 Nov 2009 03:59:57 -0500 (EST)
- References: <email@example.com>
I do not know why Export seems to behave as you say, but you can compute in advance the number of terms in each file with this formula: filelengths = Reverse@CoefficientList[Expand[(x + 1)^n], x] where the first value (always 1) is for index 0, and so on. The total Total[filelengths] is of course equal to 2^n. With this, you might compute in advance the memory required for your operation and establish when it is too much. ADL On Oct 31, 7:54 am, Ramiro <ramiro.barran... at gmail.com> wrote: > Hi, > > I am trying to compute the probability of a union, the formula > requires to sum and subtract all possible combinations of > intersections for all pairs, triplets, etc. When n is big, getting > all the terms is a challenge. > ...