Density distribution of segments of a terminally adsorbed macromolecule