Specific gravity of soil particles

Consider the following figure.

W1= weight of empty vessel
W2= Weight of vessel + weight of sample
W3=Weight of vessel + weight of sample+Water
W4=Weight of vessel + Water

Here,
$Weight of solid = W2-W1$

Similarly, from last two figures
$W3-W4=Weight of solid- Weight of water$
or, $W3-W4= W2-W1 -Weight of water$
or, $Weight of water=(W2-W1)-(W3-W4)$(= weight of equal volume of water as that of solid)

Now,
$specific-gravity=\frac{weight of solid}{weight of equal volume of water}$
i.e. $\rho_s=\frac{(W2-W1)}{(W2-W1)-(W3-W4)}$