Your intuition that there is a little extra diameter on the large marble past 6 is a great insight.
Let's write down some equations to describe the system. I'll put the small marble to the left of the large marble.
If the container is 10 cm across, then moving from the left side of the container to the right, we first have the radius of the small marble (which is given at 2 cm), then we have the distance between the centers of the two marbles, we don't know what that is, so we'll call it d, and last we have radius of the big marble to bring us to the right edge of the container. We also don't know what that is, so we'll call it r.
Therefore, we have:
2 + d + r = 10
Now, there's a right triangle hiding in here, because the center of the second marble is slightly above the center of the smaller marble.
The base of that triangle, is the horizontal distance between the two marbles which we defined as d.
The height of that triangle is just how much higher the center of the second marble is from the first marble, this is whatever the radius of the large marble is, subtract 2 (the radius of the smaller marble). (r - 2)
The hypotenuse will be, the radius of the big marble plus the radius of the small marble. This is the diagonal line connecting the centers of the two marbles. (r + 2)
Now, let's set up the Pythagorean Theorem.
(r - 2)2 + d2 = (r + 2)2
Now, we can replace d with what it is in terms of r from the first distance equation we defined.
2 + d + r = 10
d = 8 - r
So we have,
(r - 2)2 + (8-r)2 = (r + 2)2
Expand:
r2 - 4r + 4 + r2 - 16r + 64 = r2 + 4r + 4
Combine like terms:
r2 - 24r + 64 = 0
Apply the quadratic formula for two solutions:
r = -4(sqrt(5) - 3)
r = 4(3 + sqrt(5))
Since the diameter can't be more than 10, we ignore the second solution and choose the first,
r = -4(sqrt(5) - 3) = 3.056
Lastly, double the radius for the diameter:
3.056*2 = 6.111