A girl went to market to buy brinjal,onion and coconut.........she gives
Rs 2 and buys 40 brianjals
Rs 1 and buys 01 onion
Rs 5 and buys 01 coconut..........
....................BUT...................
The total amount of rupees spent and the number of vegetables bought should be 100....
Question: How many of each onion, brinjal, coconut does the girl buy with the above prices so that the total rupees spent and the net quantity bought is exactly 100??
Example:-
Rs Quantity (indicative)
2 $\quad$ 40 Brinjals
1 $\quad$ 1 Onion
5 $\quad$ 1 Coconut
--- ----
100 100 ----> Expected sum(Once the quantities are provided by the solution)
Let $x,y$, and $z$ be respectively the numbers of brinjals, onions, and coconuts bought. The requirement that $100$ items be bought means that $x+y+z=100$. If $40$ brinjals cost $2$ rupees, the cost of one brinjal is $\frac2{40}=0.05$ rupees. Each onion costs one rupee, and each coconut costs $5$ rupees, so the total cost is $0.05x+y+5z$. Thus, we want a solution in non-negative integers to the system
$$\left\{\begin{align*} &x+y+z=100\\ &0.05x+y+5z=100\;. \end{align*}\right.\tag{1}$$
Multiply the second equation by $20$ to get $x+20z+100z=2000$ and subtract the first to get $19y+99z=1900$. Solving for $z$ in terms of $y$, we find that $$z=\frac{1900-19y}{99}=\frac{19}{99}(100-y)\;.$$
This is non-negative if and only if $y\le 100$, and since we also want $y\ge 0$, the only possible values of $y$ are the integers from $0$ through $100$. In order for $z$ to be an integer, $100-y$ must be a multiple of $99$, so either $y=100$, or $y=1$.
If $y=100$, then $z=0$, and from $(1)$ we see that $x=0$ as well. One solution, then, is to buy $100$ onions and nothing else.
If $y=1$, then $z=19$, and from $(1)$ we find that $x=80$: she can buy $80$ brinjals (for $4$ rupees), one onion (for $1$ rupee), and $19$ coconuts (for $95$ rupees).
If she is required to buy a non-zero amount of each of the three items, the only solution is the second one.
(For those who are unfamiliar with the term, brindjal, like aubergine, is another name for eggplant.)