Placement AptitudeHardInfosys SP · Amazon aptitude

In how many ways can 15 be written as x + y + z, where x, y, z are integers from 1 to 7 and order matters?

  1. A. 91
  2. B. 28
  3. C. 7
  4. D. 21

Correct answer: B. 28

Without the upper limit there are C(14, 2) = 91 solutions. If one variable is ≥ 8, write it as 7 + x′ (x′ ≥ 1): x′ + y + z = 8 has C(7, 2) = 21 solutions, and two variables cannot both exceed 7. So 91 − 3 × 21 = 28. Subtracting 3 × C(8, 2) instead gives 7.

More Advanced Quantitative Ability (Placement) questions

Exams that ask this topic