Star formation and chemical evolution in smoothed particle hydrodynamics simulations: a statistical approach | Synapse