MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: How to calculate a union

  • To: mathgroup at
  • Subject: [mg104462] Re: How to calculate a union
  • From: ADL <alberto.dilullo at>
  • Date: Sun, 1 Nov 2009 03:59:57 -0500 (EST)
  • References: <hcgmv6$d16$>

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.


On Oct 31, 7:54 am, Ramiro <ramiro.barran... at> 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.
> ...

  • Prev by Date: SetDelayed and Evaluate
  • Next by Date: Re: Opportunities and Player Pro
  • Previous by thread: Re: SetDelayed and Evaluate
  • Next by thread: Re: How to calculate a union