To determine the cost price of the whole stock of rice, let's denote the total cost price of the stock as \( C \).
1. The shopkeeper sold \( \frac{2}{3} \) of the stock at a profit of \( 5\% \):
Profit on \(\frac{2}{3}\) stock = \( \frac{2}{3} \times C \times \frac{5}{100} = \frac{C}{30} \).
2. The remaining \( \frac{1}{3} \) stock was sold at a loss of \( 2\% \):
Loss on \(\frac{1}{3}\) stock = \( \frac{1}{3} \times C \times \frac{2}{100} = \frac{C}{150} \).
3. Total profit is given as ₹ 1000:
\(\frac{C}{30} - \frac{C}{150} = 1000\)
4. Simplify the equation:
\(\frac{C}{30} - \frac{C}{150} = 1000\)
Convert to a common denominator: \(\frac{5C}{150} - \frac{C}{150} = 1000\)
\(\frac{4C}{150} = 1000\)
5. Solve for \( C \):
\(4C = 150 \times 1000\)
\(4C = 150000\)
\(C = \frac{150000}{4}\)
\(C = 37500\)
Therefore, the cost price of the whole stock of rice is ₹ 37,500.