Each signal requires the use of 2 flags.

There will be as many flags as there are ways of filling in 2 vacant places in succession by the given 5 flags of different colours.

The upper vacant place can be filled in 5 different ways by any one of the 5 flags following which, the lower vacant place can be filled in 4 different ways by any one of the remaining 4 different flags.

Thus, by multiplication principle, the number of different signals that can be generated is 5 × 4 = 20.