For Bed B, we're told that the gardener must include exactly 2 types of shrub and at least 1 type of annual flower. This bed must also contain a total of 5 different types of shrubs or flowers.
To choose 2 shrubs from 7 possibilities, we calculate 7!/(5!2!) = 21.
Choosing bed B flowers is more tricky. We have three possible scenarios: the gardener chooses 1 annual flower (and therefore 2 perennials) OR the gardener chooses 2 annuals (and therefore 1 perennial) OR the gardener chooses 3 annuals (and therefore 0 perennials). We need to calculate the number of combinations for each and then add them together.
1 annual and 2 perennials: choosing 1 always matches the number of options, so there are 6 ways to choose the 1 annual flower. We calculated the number of possible combinations for 2 perennials when we did bed A: the number of possible combinations is 6. There are, therefore, 6 × 6 = 36 possible ways to have 1 annual and 2 perennials.
2 annuals and 1 perennial: We calculated the number of possible combinations for 2 annuals when we did bed A above: the number of possible combinations is 15. For the perennials, we're choosing only 1, so there are 4 possible ways to choose a perennial. There are 15 × 4 = 60 possible ways to have 2 annuals and 1 perennial.
3 annuals and 0 perennials: to have three annuals, we calculate 6!/(3!3!) = 20.
To have 1 OR 2 OR 3 annuals, we have 36 + 60 + 20 = 116 possible ways. In order to have this AND our 2 shrubs, we have 116 × 21 = 2,436 possibilities for bed B.