Step 1: Start with the easy ones
Glucose is the hexose and ribose is the pentose, so (D)-(II) and (C)-(IV).
Step 2: Use elimination
Only option D has (C)-(IV) and (D)-(II) together.
Step 3: Check
This leaves glyceraldehyde (3 carbons) for triose and erythrose (4 carbons) for tetrose, which agrees with option D.
Final Answer:
Option D gives the correct match.
\[ \boxed{\text{(D) }\text{(A) - (III), (B) - (I), (C) - (IV), (D) - (II)}} \]