# Given collection of sets how to turn it to collection of disjoint sets?

Suppose we have a finite collection of sets $A_1$,...,$A_n$. Is there an algorithm which gives a new collection $B_1$,...,$B_m$, which consist of pairwise disjoint sets, $\cup B_i=\cup A_j$ and each $B_i$ is a subset of some $A_j$?

-
Let $B_1=\bigcup A_j$. Then the collection of $B_1$ alone satifies your property. –  Michael Greinecker Dec 20 '12 at 15:34
@MichaelGreinecker thanks for spotting this, I've clarified the question. I already got the answer, I needed. –  mpiktas Dec 20 '12 at 15:38
Write $B_k=A_k\setminus\bigcup_{j<k}A_j$. It might be the case that several of the sets will end up as being empty. Remove those.