Ken and Tom had a total of $40. Ken gave 3/7 of his money to Tom. Tom then gave 1/6 of the same amount of money he had to Ken. In the end, each of them had the same amount of money. How much money did each of them have at first?

assuming that by "same amount of money" you mean what he had after Tom gave him some, then

k+t = 40
k - 3/7 k + 1/6 (t + 3/7 k) = 5/6 (t + 3/7 k)
or, more simply,
7t = 3k
so
Ken had $28 and Tom had $12

check: Ken gave Tom $12
\then Tom gave Ken $4
and the both wound up with $20