Cell fate commitment relies upon making a choice between different developmental pathways and subsequently remembering that choice. Experimental studies have thoroughly investigated this central theme in biology for sex determination. In the somatic cells of Drosophila melanogaster, Sex-lethal (Sxl) is the master regulatory gene that specifies sexual identity. We have developed a theoretical model for the initial sex-specific regulation of Sxl expression. The model is based on the well-documented molecular details of the system and uses a stochastic formulation of transcription. Numerical simulations allow quantitative assessment of the role of different regulatory mechanisms in achieving a robust switch. We establish on a formal basis that the autoregulatory loop involved in the alternative splicing of Sxl primary transcripts generates an all-or-none bistable behavior and constitutes an efficient stabilization and memorization device. The model indicates that production of a small amount of early Sxl proteins leaves the autoregulatory loop in its off state. Numerical simulations of mutant genotypes enable us to reproduce and explain the phenotypic effects of perturbations induced in the dosage of genes whose products participate in the early Sxl promoter activation.