Based on the question:
x = number of bags Megan plans to make
y = total number of cookies Megan needs to bake
The equation y = 8x means that for every bag of cookies, Megan has to bake 8 cookies. For example, if Megan wants to make 2 bags, she has to bake 16 cookies.
Now, looking at the table that Heidi recorded, we can divide the number of cookies by the number of bags to see much Heidi needs to bake for every bag. See table below.
As we can see in the table above, for every bag of cookies, Heidi only needs to bake 6 cookies.
Therefore, if they are going to make the same number of bags of cookies, Heidi will have to make the least amount of cookies. (Option 1)
Example: 6 bags of cookies
Megan has to bake 6 bags x 8 cookies = 48 cookies.
Heidi has to bake 6 bags x 6 cookies = 36 cookies only.