The first marble was replaced, so the original state of the bag hasn’t changed overall. The probability isn’t changed either. We can treat the second selection entirely independent of the first one.

If the first marble wasn’t replaced, then the marble count of course goes down by 1. That affects the probability of the second selection and we’d consider these events to be dependent.

———

An example:

Consider a bag with 4 red marbles and 6 green ones. The chances of picking red on the first try are 4/10 = 2/5. The chances of picking red again would be 2/5 assuming we put that red marble back. We can see the second selection is independent of the first.

If the marble wasn’t put back, then the chances of picking a 2nd red marble would be 3/9 = 1/3. I subtracted 1 from the numerator and denominator of 4/10 to get to 3/9. In this case, the 2nd selection’s probability depends on the first event (whether red was picked or not).

Answer: Independent