Example 9.35: Discrete randomization and formatted output