We first write the functions that are being described in the problem, as follows:
For Joe:
2w + 180
Here w is the number of weeks that will pass and 180 is the number of pounds he originally had.
For Marty:
-w + 240
Here w is the number of weeks that will pass and 240 is the amount of pounds he originally had.
Now, we equal both functions:
And now, we solve for w:
From this, we have that the number of weeks that would have to pass is 20.