Sam went for a run in the morning. In the afternoon, he went grocery shopping and walked twice the distance through the store as he had run that morning. That evening, he went on a bike ride with his family and biked for 12 miles. In all, he went 18 miles that day. How many miles was Sam’s morning run? Let's think step by step and output the final answer after "####".
user
Let X be the distance Sam ran.
His walk through the store was twice the distance of his run, so his walk was 2X.
He biked for 12 miles and went 18 miles in all, so he walked and ran 18 - 12 = <<18-12=6>>6 miles.
Thus, his walk and run together were X + 2X = 3X = <<6=6>>6 miles.
Thus, he ran X = 6 / 3 = <<6/3=2>>2 miles.
#### 2
Sam went for a run in the morning. In the afternoon, he went grocery shopping and walked twice the distance through the store as he had run that morning. That evening, he went on a bike ride with his family and biked for 12 miles. In all, he went 18 miles that day. How many miles was Sam’s morning run?
train