Let R = the number of red marbles at the beginning.
Let B = the number of blue marbles at the beginning,
Let x = the the number of blue marbles exchanged for red marbles. <--the answer
There are R+B marbles at the beginning and at the end.
The given information
R, B, and x are all positive integers.
Since B is a multiple of 7, say B=7p, where p is a positive
integer.
Then
or R=5p
So p must be a multiple of 3, say p=3n, where n is a positive integer.
So every solution in integers is of the form.
You did not list the possible choices, but all you have to do is look for x
being a multiple of 5.
Let's check the smallest possible solution where n=1. B=21, R=15, x=5
There were 5/7 as many red marbles as blue marbles in a jar.That checks because 15=(5/7)(21). Now there are R+B=21+15=36 marbles total, before
and after the swapping is done.
Dave took some blue marbles out of the jar and replaced them with
the same number of red marbles. The number of red marbles became 5/9
of all the marbles in the jar.When 5 blues are swapped for reds there are 21-5=16 blues and 15+5=20 reds,
and indeed, 20 = (5/9)(36). So that checks also.
Edwin