Step 1: Set up the Venn diagram regions.
Let only-M = 3, only-C = 15 (given). Let "all three" = \(\frac{1}{5}(40)-3 = 8-3 = 5\).
Let \(x\) = students studying M and P only (not C), \(y\) = students studying M and C only (not P), \(z\) = students studying P and C only (not M).
Given: "M as well as P" = "M as well as C", i.e. \(x+5 = y+5\), so \(x=y\).
Step 2: Express the total and physics-total equations.
Total: only-M + only-P + only-C + \(x+y+z\) + all-three = 40
\(3+\text{only-P}+15+x+y+z+5=40 \Rightarrow \text{only-P}+x+y+z=17\)
Since \(x=y\): \(\text{only-P}+2x+z=17\) ... (i)
Physics total = 20: only-P + \(x+z\) + 5 = 20 \(\Rightarrow\) only-P + \(x+z\) = 15 ... (ii)
Step 3: Solve for x.
Subtracting (ii) from (i): \(2x - x = 17-15 \Rightarrow x = 2\), so \(y=2\) as well.
Step 4: Cross-check using the mathematics-total condition (not required for the final answer, but confirms consistency).
Mathematics total \(=\) only-M \(+x+y+\)all-three \(=3+2+2+5=12\)
only-P \(=\) M-total \(-2=12-2=10\)
From (ii): \(10+2+z=15\wedge... \) actually \(10+x+z=15 \Rightarrow 10+2+z=15\Rightarrow z=3\)
Chemistry total \(=\) only-C \(+y+z+\)all-three \(=15+2+3+5=25\)
Check: \(0.4\times25+2=10+2=12\), which matches M-total \(=12\), confirming all values are consistent.
Overall total check: \(3+10+15+2+2+3+5=40\ ✓\)
Step 5: Answer the question.
"Both mathematics and chemistry but not all three" is exactly the region \(y\), which was found to be 2.
So the answer is 2, matching option (e).