Stochastic switching of cell fate in microbes