Figure 3:
The Generate-Params algorithm.