cardinality of sigma algebra generated by a finite collections of sets Let $X$ be a non-empty set. Let $\mathcal{B}=\{B_i: 1\le i\le k\}$, where $B_i\subset X$ for $1\le i\le k$. Find a surjection from $P(P(\{1,\ldots,k\}))$ to $\mathcal{F}$ where $\mathcal{F}$ is the $\sigma$-algebra generated by $\mathcal{B}$ and $P(A)$ is the set of subsets of $A$.
Can any one give me the hints for this problem ?
 A: Small case $k=2$ to put you on track: let's say $\mathcal B=\{B_1,B_2\}$. 
Then the sets $B_1\cap B_2$, $B_1\cap B_2^c$, $B_1^c\cap B_2$ and $B_1^c\cap B_2^c$ belong to $\mathcal B$, are disjoint and cover $X$.
Note that we are talking about at most $2^2=4$ distinct sets here.
The sets in $\sigma(\mathcal B)$ are exactly the sets that can be written as a union of these sets, this under allowance of the empty union. 
That leads to the conclusion that there are at most $2^{2^2}=2^4=16$ distinct sets in $\sigma(\mathcal B)$.

edit:
E.g. sent set $\{\varnothing,\{1\},\{1,2\}\}\in\wp(\wp(\{1,2\}))$ to $(B_1^c\cap B_2^c)\cup(B_1\cap B_2^c)\cup(B_1\cap B_2)\in\mathcal B$.
Do you see the pattern?

edit2
Construction of surjection $f:\wp(\wp(\{1,\dots,k\}))\rightarrow\sigma(\mathcal B)$:
For $A\subseteq\left\{ 1,\dots,k\right\} $ let $f\left(\left\{ A\right\} \right):=R_{1}\cap\cdots\cap R_{k}$
where $R_{i}=B_{i}$ if $i\in A$ and $R_{i}=B_{i}^{c}$ otherwise.
Based on this define $f\left(\left\{ A_{1},\dots,A_{r}\right\} \right):=\bigcup_{i=1}^{r}f\left(\left\{ A_{i}\right\} \right)$
where $A_{1},\dots,A_{r}$ denote distinct subsets of $\left\{ 1,\dots,k\right\} $.
