  Carbon enhanced metal poor (CEMP) stars with low abundances of neutron
capture elements (CEMP-no stars) are ubiquitous among metal poor stars in the
Milky Way. Recent observations have uncovered their two subgroups that differ
in the carbon to magnesium ([C/Mg]) abundance ratio. Here we demonstrate that
similar abundance patterns are also present in Milky Way-like galaxies in the
EAGLE cosmological hydrodynamical simulation, where these patterns originate
from the fact that stars may form from gas enriched predominantly by asymptotic
giant branch (AGB) stars or by type-II supernovae. This occurs when stars form
in the poorly mixed interstellar medium of Milky Way progenitor galaxies that
are undergoing bursty star formation. The CEMP-no stars with lower [C/Mg] form
at the onset of a starburst from gas enriched by low metallicity type-II
supernovae that power a strong outflow, quenching further star formation. When
star formation resumes following cosmological gas accretion, the CEMP-no stars
with higher [C/Mg] form, with enrichment by AGB ejecta evident in their higher
abundance of barium and lower abundance of magnesium. This suggests that bursty
star formation in the progenitors of the Galaxy leaves a permanent imprint in
the abundance patterns of CEMP stars.
