The correct order of basic strength is:
piperidine > pyridine > pyrrole
Reasoning (in brief):
- In piperidine, the nitrogen is sp³-hybridized and the lone pair is “free” (not delocalized into any aromatic system), so it can readily accept a proton → very basic.
- In pyridine, the nitrogen is sp² and its lone pair resides in an orbital perpendicular to the aromatic π system (i.e. not part of the aromatic sextet), so it is available for protonation, but less “free” than in piperidine → moderate base.
- In pyrrole, the nitrogen’s lone pair is part of the aromatic π system (delocalized), and protonating it would disrupt aromaticity; hence the lone pair is not readily available → very weak base
