This is a basic algebraic word problem. Make x equal the miles you traveled. multiply that by 2 and add the 3 initial dollars, then add the one dollar tip, finally make all this equal to 20. So your equation should look like this:
2x + 3 + 1 = 20
add the 3 and 1:
2x + 4 =20
move the 4 to the right side:
2x = 16
devide both sides by 2:
x = 8
So you traveled 8 miles.