A fruit vendor brought a bag full of mangoes to the market. He kept some of the mangoes into the basket and put them for sale. He sold one-third of the mangoes in the basket to Mr. A and adds 18 more to it. He sold three-fourth of the remaining mangoes in the basket to Mr. B, and adds 12 more to it, after which he left with 25 mangoes in his basket. How many mangoes did the fruit vendor take in his basket in the beginning?
Let's assume the total number of mangoes that the fruit vendor initially had in his basket is \(x\).
According to the problem, the vendor sold one-third of the mangoes in the basket to Mr. A and then added 18 more. Therefore, the number of mangoes sold to Mr. A plus the added mangoes is: \(\frac{x}{3} + 18\)
After selling mangoes to Mr. A, the remaining number of mangoes in the basket is: \(x - \left(\frac{x}{3} + 18\right)\) Simplifying this, we get: \(x - \frac{x}{3} - 18\) \(= \frac{2x}{3} - 18\)
Next, he sold three-fourths of the remaining mangoes to Mr. B and added 12 more. The continued equation becomes: Selling \(\frac{3}{4}\) of the remaining mangoes: \(\frac{3}{4}\left(\frac{2x}{3} - 18\right) + 12\)
After these transactions, the vendor is left with 25 mangoes. Hence, we have: \(\frac{2x}{3} - 18 - \left(\frac{3}{4}\left(\frac{2x}{3} - 18\right) + 12\right) = 25\)