Let $S$ be a set with $n$ elements. Take a positive integer $k$. Let $A_1, A_2, \ldots, A_k$ be any distinct subsets of $S$. For each $i$ take $B_i = A_i$ or $B_i = S - A_i$. Find the smallest $k$ such that we can always choose $B_i$ so that $\bigcup_{i=1}^k B_i = S$, no matter what the subsets $A_i$ are.
1. **Labeling Elements of \( S \)**:
   - Consider each element \( x \in S \). We can label \( x \) by a \( k \)-tuple \((B_1, B_2, \ldots, B_k)\), where \( B_i = A_i \) if \( x \in A_i \) and \( B_i = S - A_i \) (the complement of \( A_i \)) if \( x \notin A_i \).

2. **Possible Labels**:
   - Each element \( x \) can be in or out of each subset \( A_i \). Therefore, there are \( 2^k \) possible labels (or regions in a Venn diagram with \( k \) sets).

3. **Ensuring Coverage of \( S \)**:
   - We need to ensure that the union of the chosen \( B_i \)'s covers the entire set \( S \). This means that every element \( x \in S \) must be included in at least one \( B_i \).

4. **Minimum \( k \) Calculation**:
   - For \( \bigcup_{i=1}^k B_i = S \) to hold for any choice of \( A_i \)'s, each element \( x \in S \) must be covered by at least one \( B_i \). Since there are \( 2^k \) possible labels and \( n \) elements, we need \( 2^k \geq n \) to ensure that every element can be uniquely labeled.
   - Solving for \( k \), we get:
     \[
     2^k \geq n \implies k \geq \log_2(n)
     \]
   - Since \( k \) must be an integer, we take the ceiling of \( \log_2(n) \):
     \[
     k \geq \lceil \log_2(n) \rceil
     \]

5. **Verification**:
   - To verify, consider the case where \( k = \lceil \log_2(n) \rceil \). This ensures that there are at least \( n \) possible labels, which means we can always choose \( B_i \) such that \( \bigcup_{i=1}^k B_i = S \).

6. **Constructing Sets**:
   - It is possible to construct such sets where this bound is achieved. For example, if \( n = 2^k \), we can place one element in each of the \( 2^k \) regions created by a Venn diagram with \( k \) sets.

The final answer is \( \boxed{ k \geq \lceil \log_2(n) \rceil } \).