Let the number of marbles in box A be \( 3x \) and the number of marbles in box B be \( 5x \), where \( x \) is a common factor.
-
Initial counts:
- Box A: \( 3x \)
- Box B: \( 5x \)
-
Transfer 1/3 of marbles from A to B:
- Amount transferred from A to B: \( \frac{1}{3} \times 3x = x \)
- New counts:
- Box A: \( 3x - x = 2x \)
- Box B: \( 5x + x = 6x \)
-
Transfer 1/3 of marbles from B to A:
- Amount transferred from B to A: \( \frac{1}{3} \times 6x = 2x \)
- New counts:
- Box A: \( 2x + 2x = 4x \)
- Box B: \( 6x - 2x = 4x \)
-
Final ratio of marbles:
- The number of marbles in box A and box B is both \( 4x \).
- The final ratio of the number of marbles in box A to the number of marbles in box B is:
\[ \frac{4x}{4x} = 1:1 \]
Thus, the ratio of the number of marbles in box A to the number of marbles in box B is \( \boxed{1:1} \).