Step-by-step explanation:
Density is defined as the amount of mass present in per unit volume of a substance.
Mathematically, Density =

An organic substance is defined as the substance that contains carbon and hydrogen atoms as their main elements.
Whereas a substance that does not contain carbon atom is known as an inorganic compound.
Hardness of a substance is defined as the closeness within the molecules of a substance such that it resists a scratch.
Therefore, the given items are correctly matched as follows.
1. Mass per unit volume - density
2. Resistance of a material to being scratched - hardness
3. Compounds that contain carbon - organic
4. Compounds that do not contain carbon - inorganic