Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Generating a finite sigma-algebra

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103828] Generating a finite sigma-algebra
  • From: Valeri Astanoff <astanoff at gmail.com>
  • Date: Thu, 8 Oct 2009 07:51:02 -0400 (EDT)

Good day,

Given a set and a list of its subsets, how can one
generate *the* sigma-algebra generated by the subsets ?
The original question was posted on another CAS group
and I tried and did it with Mathematica this way :

In[1]:= sigmaAlgebra[set_List, parts_List /; Depth[parts]==3] :=
 With[{}, int[subs_List]:=
 Outer[Intersection,subs,subs,1] // Flatten[#,1]& // Union;

 un[subs_List]:=
 Outer[Union,subs,subs,1] // Flatten[#,1]& // Union;

 comp[om_List, subs_List]:=
 Union[subs, Complement[om,#]& /@subs] ;

 FixedPoint[int[un[comp[set,#]]]&,parts]
];

sigmaAlgebra[set_List, elements_List/;Depth[elements]==2] :=
sigmaAlgebra[set, List /@ elements];

In[3]:= sigmaAlgebra[{1,2,3,4,5}, {{1,2,3,4},{1,3},{4}}]

Out[3]= {{},{2},{4},{5},{1,3},{2,4},{2,5},{4,5},
{1,2,3},{1,3,4},{1,3,5},{2,4,5},
{1,2,3,4},{1,2,3,5},{1,3,4,5},{1,2,3,4,5}}

In[4]:= sigmaAlgebra[{1,2,3,4},{2,4}]

Out[4]= {{},{2},{4},{1,3},{2,4},
{1,2,3},{1,3,4},{1,2,3,4}}

Is that way correct and optimal, and if not, what is
the best and fastest way to get the sigma-algebra ?

Thanks

--
V.Astanoff


  • Prev by Date: Re: Google Trends Data and Mathematica
  • Next by Date: Re: How to find which variable caused the trigger in Manipulate[]
  • Previous by thread: Re: Grad in VectorAnalysis`
  • Next by thread: Re: Generating a finite sigma-algebra