Step 1:
Finding number of signals for 2 flags.
Number of ways for first flag =5
Number of ways for second flag =4
∴ Required number of signals =5×4=20
Step 2:
Finding number of signals for 3 flags.
Number of ways for first flag =5
Number of ways for second flah =4
Number of ways for third flag =3
∴ Required number of signals =5×4×3=60
Step 3:
Finding number of signals for 4 flags.
Number of ways for first flag =5
Number of ways for second flag =4
Number of ways for third flag =3
Number of ways for fourth flag =2
∴ Required number of signals =5×4×3×2=120
Step 4:
Finding number of signals for 5 flags.
Number of ways for first flag =5
Number of ways for second flag =4
Number of ways for third flag =3
Number of ways for fourth flag =2
Number of ways for fourth flag =1
∴ Required number of signals =5×4×3×2×1=120
Step 5:
∴ Total number of signals =20+60+120+120=320