```markdown
### Example: Water-Filling (Assume \( \alpha_i > 0 \))

#### Problem Statement
- **Objective:** Minimize \( -\sum_{i=1}^n \log(x_i + \alpha_i) \)
- **Constraints:** 
  - \( x \succeq 0 \)
  - \( 1^T x = 1 \)

#### Optimality Conditions
- \( x \) is optimal if:
  - \( x \succeq 0 \)
  - \( 1^T x = 1 \)
  - There exist \( \lambda \in \mathbb{R}^n \), \( \nu \in \mathbb{R} \) such that:
    - \( \lambda \succeq 0 \)
    - \( \lambda_i x_i = 0 \)
    - \( \frac{1}{x_i + \alpha_i} + \lambda_i = \nu \)

#### Conditions for \( \nu \)
- If \( \nu < 1/\alpha_i \):
  - \( \lambda_i = 0 \)
  - \( x_i = 1/\nu - \alpha_i \)
- If \( \nu \geq 1/\alpha_i \):
  - \( \lambda_i = \nu - 1/\alpha_i \)
  - \( x_i = 0 \)
- Determine \( \nu \) from:
  - \( 1^T x = \sum_{i=1}^n \max\{0, 1/\nu - \alpha_i\} = 1 \)

#### Interpretation
- **n patches:** Level of patch \( i \) is at height \( \alpha_i \)
- **Flood area:** With unit amount of water
- **Resulting level:** \( 1/\nu^\star \)

#### Diagram
- A diagram illustrates the water-filling concept with patches at different heights \( \alpha_i \) and the resulting water level \( 1/\nu^\star \).

---

*A. d’Aspremont. Convex Optimization M2.* (Slide 23/49)
```
