Mr. X and Mr. Y have certain number of marbles with them. If Mr. X gives 3 marbles to Mr. Y, they will have the same number of marbles. But, if Mr. Y gives 4 marbles to Mr. X, then Mr. X will have twice as many marbles as are left with Mr. Y. How many marbles does Y have?
Let them have X and Y marbles, respectively. We have X - 3 = Y + 3, which gives X - Y = 6. By the second condition, X + 4 = 2(Y - 4), which can be re-arranged to X - 2Y = -12. Solving for Y, we get Y = 18.