There are $100$ boxes, each containing either a red cube or a blue cube. Alex has a sum of money initially, and places bets on the colour of the cube in each box in turn. The bet can be anywhere from $0$ up to everything he has at the time. After the bet has been placed, the box is opened. If Alex loses, his bet will be taken away. If he wins, he will get his bet back, plus a sum equal to the bet. Then he moves onto the next box, until he has bet on the last one, or until he runs out of money. What is the maximum factor by which he can guarantee to increase his amount of money, if he knows that the exact number of blue cubes is
[list][b](a)[/b] $1$;
[b](b)[/b] some integer $k$, $1 < k \leq 100$.[/list]
1. **Part (a):**
   - We define \( f(n, a) \) as the largest factor by which Alex can increase his money, given that there are \( n \) cubes left and \( a \) of them are blue.
   - We need to find \( f(100, 1) \).

2. **Base Cases:**
   - If there are no blue cubes left, \( f(n, 0) = 2^n \) because Alex can go all-in every time and win.
   - If there is only one cube left and it is blue, \( f(1, 1) = 2 \) because Alex can go all-in and double his money.

3. **Recursive Relation:**
   - For \( 0 < b < a \), we claim that \( f(a, b) \) is the harmonic mean of \( f(a-1, b) \) and \( f(a-1, b-1) \).
   - To maximize the guaranteed amount of money, Alex should select \( x \) such that:
     \[
     (1-x) f(a-1, b) = (1+x) f(a-1, b-1)
     \]
   - Solving for \( x \), we get:
     \[
     x = \frac{f(a-1, b) - f(a-1, b-1)}{f(a-1, b) + f(a-1, b-1)}
     \]
   - Substituting \( x \) back, we get:
     \[
     f(a, b) = \frac{2 f(a-1, b) f(a-1, b-1)}{f(a-1, b) + f(a-1, b-1)}
     \]
   - This is the harmonic mean of \( f(a-1, b) \) and \( f(a-1, b-1) \).

4. **Induction:**
   - By induction, we can show that \( f(n, 1) = \frac{2^n}{n} \) for all \( n \in \mathbb{Z}_{\ge 0} \).

5. **Conclusion for Part (a):**
   - Therefore, \( f(100, 1) = \frac{2^{100}}{100} = \boxed{\frac{2^{98}}{25}} \).

6. **Part (b):**
   - We define \( t(n, a) \) as the maximum factor by which Alex can increase his money, given that there are \( n \) cubes left and at least \( a \) of them are blue.
   - We need to find \( t(100, 2) \).

7. **Base Cases:**
   - If there are no blue cubes left, \( t(n, 0) = 1 \) because Alex has no information and cannot guarantee an increase.
   - If there is one blue cube left, \( t(1, 1) = 2 \).
   - If there are two blue cubes left, \( t(2, 2) = 4 \) because Alex knows all cubes are blue.

8. **Recursive Relation:**
   - For \( 0 < a < n \), we claim that \( t(n, a) \) is the harmonic mean of \( t(n-1, a-1) \) and \( t(n-1, a) \).
   - This is proven similarly to part (a).

9. **Induction:**
   - By induction, we can show that \( t(n, 1) = \frac{2^n}{2^n-1} \) for all \( n \in \mathbb{N} \).
   - For \( t(n, 2) \), we have:
     \[
     t(n, 2) = \frac{2^n}{2^n - n - 1}
     \]

10. **Conclusion for Part (b):**
    - Therefore, \( t(100, 2) = \frac{2^{100}}{2^{100} - 101} = \boxed{\frac{2^{100}}{2^{100} - 101}} \).