Equation to find specific gravity (or density) from a solution of sugar and water Is there an equation or simple way to calculate the final density of a solution made from x grams of sugar and y liters of water?

And would it work in reverse? if we have y liters of water at z density or specific gravity, can we know how much sugar is in the solution?

I'd like to run an experiment for my nephews, something like This.

However, lacking any background in chemistry, the precise math is tough to nail down. It would be great to have some deeper understanding of how this works...
Here an empirical approach:

1) A simple way to calculate density: mass/volume

mass = x g of sugar + (y L of water*1000 mL/L*1g/mL)

1 g/mL = water density

Then measure the total volume (total mL) of the mix:

density = (x g of sugar + (y L of water * 1000 mL/L * 1g/mL))/(total mL)

2) For the reverse calculation, you can determine density as a function of sugar content by preparing solutions with different sugar concentrations and use this to interpolate your specific density value to a sugar concentration.

You can also use preexisting tables or graphs as Felipe suggested