Section 4. (a) A tax is hereby imposed on the transfer of a nonresident decedent's real and tangible personal property having an actual situs in Massachusetts, if such property would have been included in the Massachusetts gross estate had the decedent been a resident.
(b) The tax imposed under subsection (a) shall be an amount which bears the same ratio to the tax that would be due if the decedent had been a resident as (i) the value of all real and tangible personal property, diminished by any mortgage or lien thereon, having an actual situs in Massachusetts, the transfer of which is subject to tax under said subsection (a) bears to (ii) the value of the decedent's Massachusetts gross estate, diminished by any mortgage or lien or property included therein, determined as if he had been a resident.