Given as
The total number of courses is 9
Therefore out of 9 courses 2 courses are compulsory. Student can choose from 7(i.e., 5+2) courses only.
This too out of 5 courses student has to choose, 2 courses are compulsory.
Therefore they have to choose 3 courses out of 7 courses.
This can be done in 7C3 ways.
On using the formula,
nCr = n!/r!(n – r)!
7C3 = 7! / 3! (7 – 3)!
= 7! / (3! 4!)
= [7 × 6 × 5 × 4!] / (3! 4!)
= [7 × 6 × 5] / (3 × 2 × 1)
= 7 × 5
= 35
Hence, the total number of ways of choosing 5 subjects out of 9 subjects in which 2 are compulsory is 35 ways.