A girl bought mangoes at 7.50 each. There were two types of mangoes: good ones and not so good ones. She sold the good ones at 7.90 each and the not-so-good ones at 7.70 each. If she earned 34, how many mangoes did she buy?

number of good ones --- x

number of not-goods --- y

cost = 7.5x + 7.5y

return = 7.90x + 7.70y

7.9x + 7.7y - 7.5x - 7.5y = 34
.4x + .2y = 34
2x + y = 170

y = 170-2x

There is no unique answer, unless you supply more information.
I could pick any value of x between 0 and 85, and have a solution

e.g. let x = 50, then y = 70
cost = 7.50(50+70) = 900
revenue = 7.9(50) + 7.7(70) = 934
for a profit of $34

let x = 10, then y = 150
cost = 7.5(160) = 1200
revenue = 7.9(10) + 7.7(150) = 1234
for a profit of $34

etc

To find the number of mangoes the girl bought, let's assume she bought x good mangoes and y not-so-good mangoes.

The cost of each good mango is $7.50, so the total cost of good mangoes is 7.50x.
The cost of each not-so-good mango is also $7.50, so the total cost of not-so-good mangoes is 7.50y.

She sold each good mango for $7.90, so the total earning from good mangoes is 7.90x.
She sold each not-so-good mango for $7.70, so the total earning from not-so-good mangoes is 7.70y.

The total earnings from selling all the mangoes is given as $34, so we can write the equation:
7.90x + 7.70y = 34

We also know that the total cost of all the mangoes is the sum of the cost of good mangoes and not-so-good mangoes, so we can write another equation:
7.50x + 7.50y = total cost

Unfortunately, we don't have the value for the total cost. However, we can proceed by assuming that the girl didn't make any profit or loss from the transaction. So, the total cost is equal to the total earnings:

7.50x + 7.50y = 7.90x + 7.70y

To solve for x and y, we need two independent equations. Let's subtract the second equation from the first:

(7.50x - 7.90x) + (7.50y - 7.70y) = 0

Simplifying this equation, we get:

-0.40x - 0.20y = 0

Now, we have two equations:

7.90x + 7.70y = 34
-0.40x - 0.20y = 0

To solve these equations, we can use the method of substitution or elimination. Let's use substitution:

From the second equation, we can solve for x:

-0.40x = 0.20y
x = (0.20y) / (-0.40)

Substituting this value of x into the first equation:

7.90[(0.20y) / (-0.40)] + 7.70y = 34

Simplifying and solving for y:

3.95y - 1.925y = 34
2.025y = 34
y = 34 / 2.025

Calculating the value of y:

y ≈ 16.79

Since y represents the number of not-so-good mangoes, it should be a whole number. We can assume that the girl bought 17 not-so-good mangoes.

Now, substitute the value of y back into the second equation to find x:

-0.40x - 0.20(17) = 0
-0.40x - 3.40 = 0
-0.40x = 3.40
x = 3.40 / (-0.40)

Calculating the value of x:

x ≈ -8.5

However, since x represents the number of good mangoes, it cannot be a negative value. This means our initial assumption that the girl bought a negative number of good mangoes is incorrect.

Therefore, there is no valid solution to this problem. It appears there may be an error in the given information or calculations.