From Josiah's statement, we know that if Mia gives him $8.50, they will have an equal amount of money. This can be expressed as:
J + 8.50 = M - 8.50
Simplifying this equation, we get:
J = M - 17
From Mia's statement, we know that if Josiah gives her $8.50, she will have twice as much money as Josiah. This can be expressed as:
M + 8.50 = 2(J - 8.50)
Substituting J = M - 17, we get:
M + 8.50 = 2(M - 17 - 8.50)
Simplifying this equation, we get:
M + 8.50 = 2M - 51
Solving for M, we get:
M = 59.50
Substituting M = 59.50 into J = M - 17, we get:
J = 42.50
Therefore, Josiah had $42.50 in the beginning, and Mia had $59.50.