Answer:
9
Step-by-step explanation:
Let y represent the yellow packets and n represent the non-yellow packets.
We know that the two yellow packets are separated by 3 non-yellow packets; this gives us
y n n n y
somewhere in the middle of the shelf.
We are not told which packets is 6th from the left and which is 8th from the right. To minimize the total number of packages, assume the y on the left is 8th from the right. Counting from it to the right, we have 5 already; this means we would have 3 more n's after the y on the right:
y n n n y n n n
Now we will assume the y on the right is 6th from the left. Counting from it to the left, we have 5 already; this means we would have 1 more n before the y on the left:
n y n n n y n n n
Counting these together, we have 9 packages.